reworked the input type for more flexibility
This commit is contained in:
@@ -1,10 +1,27 @@
|
||||
export type TextInput = {
|
||||
inputType: "text";
|
||||
input: string;
|
||||
}
|
||||
|
||||
export type ImageInput = {
|
||||
inputType: "image";
|
||||
img: string;
|
||||
imgAlt: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export type AudioInput = {
|
||||
inputType: "audio";
|
||||
audio: string;
|
||||
transcript: string;
|
||||
}
|
||||
|
||||
export default class Dream{
|
||||
id: number;
|
||||
userId: number;
|
||||
title: string;
|
||||
date: Date;
|
||||
inputType: "text" | "image" | "audio" ;
|
||||
input: string;
|
||||
input: TextInput | ImageInput | AudioInput;
|
||||
ai?:{
|
||||
interpretation: string;
|
||||
image?: string;
|
||||
@@ -18,8 +35,7 @@ export default class Dream{
|
||||
userId: number;
|
||||
title: string;
|
||||
date: Date;
|
||||
inputType: "text" | "image" | "audio" ;
|
||||
input: string;
|
||||
input: TextInput | ImageInput | AudioInput;
|
||||
ai: {
|
||||
interpretation: string;
|
||||
image?: string;
|
||||
@@ -32,7 +48,6 @@ export default class Dream{
|
||||
this.userId = params.userId;
|
||||
this.title = params.title;
|
||||
this.date = params.date;
|
||||
this.inputType = params.inputType;
|
||||
this.input = params.input;
|
||||
this.ai= params.ai;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user