import type { MediaTraceContext } from '@atlaskit/media-common/analytics/types'; import { type UploadEndEventPayload, type UploadErrorEventPayload, type UploadPreviewUpdateEventPayload, type UploadsStartEventPayload, type UploadParams, type UploadRejectionData, type FileEmptyData } from '../types'; export type UploadServiceEventPayloadTypes = { readonly 'files-added': UploadsStartEventPayload; readonly 'file-preview-update': UploadPreviewUpdateEventPayload; readonly 'file-converting': UploadEndEventPayload; readonly 'file-upload-error': UploadErrorEventPayload; readonly 'file-dropped': DragEvent; }; export type UploadServiceEventListener = (payload: UploadServiceEventPayloadTypes[E]) => void; export declare const MAX_FILE_SIZE_FOR_PREVIEW = 10000000; export interface UploadService { setUploadParams(uploadParams: UploadParams): void; addFile(file: File, replaceFileId?: string): void; addFiles(files: File[]): void; addFilesWithSource(files: LocalFileWithSource[], traceContext?: MediaTraceContext): Promise; cancel(id?: string): void; on(event: E, listener: UploadServiceEventListener): void; off(event: E, listener: UploadServiceEventListener): void; onFileEmpty(handler: (fileEmptyData: FileEmptyData) => void): void; onFileRejection(handler: (rejectionData: UploadRejectionData) => void): void; } export declare enum LocalFileSource { PastedFile = "pastedFile", PastedScreenshot = "pastedScreenshot", LocalUpload = "localUpload" } export interface LocalFileWithSource { file: File; source: LocalFileSource; replaceFileId?: string; }