import { MediaInfo } from "../ffmpeg/types/FFmpeg.types"; /** * Describes the source media that may need transcoding. */ export interface TranscodeMediaDetails { mediaInfo?: MediaInfo; mimeType?: string; url?: string; fileName?: string; } /** * Represents the result of a transcode operation. */ export interface TranscodeResult { source: Uint8Array | URL; mimeType?: string; extension?: string; } /** * Describes an output format a transcode provider may be asked to generate. */ export interface TranscodeSupportType { mimeType: string; hasAlpha: boolean; } /** * Progress information reported by a transcode provider. */ export interface TranscodeProgressInfo { state: string; progress: number; } /** * Control signals sent from the SDK to a running transcode provider. */ export declare enum TranscodeControlStateEnum { RUN = "RUN", CANCEL = "CANCEL" } /** * Mutable control object used to coordinate cancellation or state changes during transcoding. */ export interface TranscodeControl { state: TranscodeControlStateEnum; isRead: boolean; } /** * Contract implemented by custom transcode providers used by the SDK. */ export interface ITranscodeProvider { /** * Initializes the provider and allocates any runtime resources it needs. * * @returns A promise that resolves after initialization completes. */ init(): Promise; /** * Releases all resources owned by the provider. * * @returns A promise that resolves after teardown completes. */ destroy(): Promise; /** * Indicates whether the provider can transcode the supplied source media. * * @param mediaMetadata Source media details used for capability checks. * @returns A promise that resolves to `true` if the provider can accept the input. */ supportsInput(mediaMetadata: TranscodeMediaDetails): Promise; /** * Indicates whether the provider can produce the requested output format. * * @param outputType Requested output format description. * @returns A promise that resolves to `true` if the output is supported. */ supportsOutput(outputType: TranscodeSupportType): Promise; /** * Indicates whether the provider can transcode media using only a URL reference. * * @returns A promise that resolves to `true` if URL-only inputs are supported. */ supportsInputURL(): Promise; /** * Transcodes source media into a supported output format. * * @param source Source media bytes or URL. * @param mediaMetadata Source media details used during transcoding. * @param outputType Requested output format description. * @param control Mutable control object used to signal cancellation. * @param progressCallback Optional callback that receives normalized progress updates. * @returns A promise that resolves to the transcoded output, or `null` if transcoding is canceled or fails cleanly. */ transcode(source: Uint8Array | URL, mediaMetadata: TranscodeMediaDetails, outputType: TranscodeSupportType, control: TranscodeControl, progressCallback?: (progressInfo: TranscodeProgressInfo) => void): Promise; }