import type { MediaClient } from '@atlaskit/media-client/media-client'; import type { MediaTraceContext } from '@atlaskit/media-common/analytics/types'; import { LocalFileSource, type LocalFileWithSource } from '../service/types'; import { type FileEmptyData, type MediaFile, type UploadParams } from '../types'; import { type UploadRejectionData } from '../types'; import { type UploadService, type UploadServiceEventListener, type UploadServiceEventPayloadTypes } from './types'; export interface CancellableFileUpload { mediaFile: MediaFile; file: File; source: LocalFileSource; cancel?: () => void; } export declare class UploadServiceImpl implements UploadService { private readonly tenantMediaClient; private tenantUploadParams; private readonly shouldCopyFileToRecents; private readonly maxUploadBatchSize; private readonly uploadBatchSize; private readonly uploadBatchDelayMs; private readonly userMediaClient?; private readonly emitter; private cancellableFilesUploads; private fileRejectionHandler?; private fileEmptyHandler?; constructor(tenantMediaClient: MediaClient, tenantUploadParams: UploadParams, shouldCopyFileToRecents: boolean, maxUploadBatchSize?: number, // Max supported batch is 255. We parametrise it for testing purposes uploadBatchSize?: number, uploadBatchDelayMs?: number); setUploadParams(uploadParams: UploadParams): void; private createUploadController; addFiles(files: File[]): void; addFile(file: File, replaceFileId?: string): void; addFilesWithSource(files: LocalFileWithSource[], traceContext?: MediaTraceContext): Promise; isCancellableFileUpload(fileUpload: null | CancellableFileUpload): fileUpload is CancellableFileUpload; cancel(id?: string): void; on(event: E, listener: UploadServiceEventListener): void; off(event: E, listener: UploadServiceEventListener): void; private addFilesAndUpload; private readonly emit; private emitPreviews; private getMediaTypeFromFile; private releaseCancellableFile; private readonly onFileSuccess; private readonly onFileError; onFileEmpty(handler: (fileEmptyData: FileEmptyData) => void): void; onFileRejection(handler: (rejectionData: UploadRejectionData) => void): void; }