import type { AudioComponentData, ComponentData, FileComponentData, ImageComponentData, MediaUploadError, VideoComponentData } from 'ricos-content'; import type { EditorCommands } from '.'; export interface ILocalFileReader { read: (file: File) => Promise; free: (url: string) => void; } export declare enum MediaUploadProgressKey { STARTED = 0, FINISHED = 1 } export type IMessage = MediaUploadError; export type IUploadProgessMessage = { key: MediaUploadProgressKey; }; export interface INotifier { notify: (message: IMessage) => void; } export type UploadedData = { data?: ImageComponentData | VideoComponentData | FileComponentData | AudioComponentData; error?: IMessage; }; export interface IFileUploader { upload: (file: File) => Promise; } export interface MediaPluginLocalLoadedData { componentData: ComponentData; fileState?: Record; componentState?: { loading?: boolean; tempData?: any; }; } export interface IMediaPluginService { createLoadingData: (file: File, url: unknown, componentData: ComponentData, fileState?: Record) => MediaPluginLocalLoadedData; createPluginData: (uploadedData: UploadedData, componentData: ComponentData, fileState?: Record) => ComponentData; createErrorData: (error: IMessage, componentData: ComponentData, fileState?: Record) => ComponentData; } export interface IUpdateService { EditorCommands?: EditorCommands; setEditorCommands: (editorCommands: EditorCommands) => void; updatePluginData: (uploadedData: UploadedData, nodeId: string, type: string, mediaPluginService: IMediaPluginService, fileState?: Record) => void; updateLoadingState: (url: unknown, file: File, nodeId: string, type: string, mediaPluginService: IMediaPluginService, fileState?: Record) => Record | undefined; updateErrorState: (error: IMessage, nodeId: string, type: string, mediaPluginService: IMediaPluginService, fileState?: Record) => void; } export interface IUploadService { streamReader: ILocalFileReader; getErrorNotifier: () => INotifier; updateService: IUpdateService; getHiddenInputElement: () => HTMLInputElement; onInputChange: ((this: HTMLInputElement, event: any) => any) | null; setErrorNotifier: (getErrorNotifier: () => INotifier) => void; setHiddenInputElement: (getHiddenInputElement: () => HTMLInputElement) => void; selectFiles: (accept: string, multiple: boolean, callback: (files: File[]) => void) => void; uploadFile: (file: File, nodeId: string, uploader: IFileUploader, type: string, MediaPluginService: IMediaPluginService, fileState?: Record) => void; } export type UploadContextType = { updateService?: IUpdateService; uploadService?: IUploadService; }; //# sourceMappingURL=uploadServicesTypes.d.ts.map