import { AcceptableFiles, CreateUploader, UploadJob, UploadManagerOptions, VideoFileObject } from './types'; type UploadId = string | number; /** * VideoUploadManager will manage video uploading process, * to queue and retry the videos to upload, for better experience. * * To use this manager: * 1. Create a new instance of VideoUploadManager * 2. Call `addUploadJobs` method to add a video into the queue. * 3. After adding all videos to upload, call `start` method. */ export declare class VideoUploadManager { private options; private jobQueue; private jobsByUploadId; private activeUploaderList; private pausedUploaderList; private currentJobIndex; private currentUploader; private readonly createUploader; private started; private maximumConcurrentJobs; private authorizationToken; /** * * @param options Uploading options * @param createUploader Optional parameter to custom how uploader is created. Usually use for testing only. */ constructor(options: UploadManagerOptions, createUploader?: CreateUploader); getAuthorizationToken(validPeriodInHour?: number): Promise; /** * Replace the options with the new one. * @param newOptions New options. */ setOptions(newOptions: UploadManagerOptions): void; /** * Create video objects and add them to the queue. * @param videoFileObjects An array of object with 'file' and 'videoMetadata' fields. */ addUploadJobs(videoFileObjects: VideoFileObject[]): Promise; /** * Create video objects and add them to the queue. * @param videoFileObjects An array of Files. Video titles will be a name of each file. */ addUploadJobs(videoFileObjects: AcceptableFiles): Promise; getJobQueue(): UploadJob[]; /** * Get existing job by upload id. * * @param uploadId Upload ID. It'll be "video key" for ByteArk Stream, or "video source id" for ByteArk Qoder. * @returns Detail of the upload job */ getJobByUploadId(uploadId: string | number): UploadJob | undefined; getIsUploadStarted(): boolean; getIsAllUploadCancelled(): boolean; /** * Start uploading. * * @returns Promise that will resolve after uploading has done. */ start(): Promise; /** * Execute the upload job and remove it from the active list upon completion. */ startUploadJob(): Promise; pauseUploadById(uploadId: UploadId): Promise; resumeUploadById(uploadId: UploadId): Promise; /** * Check whether we can run the next upload job and execute it if possible. */ uploadNextJob(): void; cancelUploadById(uploadId: UploadId, shouldUploadNextJob?: boolean): Promise; cancelAll(): Promise; } export {};