diff --git a/src/redux/types.ts b/src/redux/types.ts index db7d586b..f17e8c6a 100644 --- a/src/redux/types.ts +++ b/src/redux/types.ts @@ -32,8 +32,60 @@ export interface IDialogProps { onDialogChange: (dialog: ValueOf) => void; } -export interface IResultWithStatus { - status: number; - data: T; - error?: string; +export interface IApiErrorResult { + detail?: string; + code?: string; } + +export interface IResultWithStatus { + status: any; + data?: Partial & IApiErrorResult; + error?: string; + debug?: string; +} + +export type UUID = string; + +export interface IFile { + id: UUID; + user_id: UUID; + node_id: UUID; + + name: string; + path: string; + full_path: string; + size: number; + + type: 'image' | 'text' | 'audio' | 'video'; + mime: MimeType; + + createdAt: string; + updatedAt: string; +} + +export interface INode { + id?: UUID; + user_id: UUID; + + files: IFile[]; + + cover: IFile['id']; + type: 'image'; + + brief?: { + thumbnail?: string; + description?: string; + owner?: string; + comments?: number; + }; + + options: { + flow: { + display: 'single' | 'double' | 'quadro'; + has_description: boolean; + } + }; + + createdAt?: string; + updatedAt?: string; +} \ No newline at end of file