UNPKG

@plteam/chat-ui

Version:

CUI Kit is a free and open-source library for creating AI assistant chat interfaces, built with React, Material UI, and TypeScript

36 lines (35 loc) 1.12 kB
import { ObservableReactValue } from "../utils/observers"; import { IdType } from "../types"; export type AttachmentType = 'file' | 'image' | 'video'; export type Attachment = { type: AttachmentType; id: IdType; url: string; file?: File; poster?: string; }; declare class AttachmentModel { private _data; readonly progress: ObservableReactValue<number>; readonly error: ObservableReactValue<string | undefined>; readonly poster: ObservableReactValue<HTMLImageElement | undefined>; readonly isLoading: ObservableReactValue<boolean>; private _file; private _id; private _url; constructor(_data: Partial<Attachment>); get id(): IdType; get data(): Partial<Attachment>; get file(): File; get url(): string; get type(): AttachmentType; get name(): string; get isGallery(): boolean; private _createPoster; setProgress: (n: number) => void; setError: (e: string) => void; setId: (id: IdType) => void; get contentData(): Attachment; private _createSelf; } export default AttachmentModel;