import { type VideoPrepIntent, type VideoPrepPolicy, type VideoPrepSourceMetadata, type VideoPrepValidationError } from '../../media-core/src/index';
import { type Result } from '../../core/src/index';
import { loadBrowserFfmpeg, type BrowserFfmpegLoadError } from './ffmpegLoader';
import { type VideoFrameExtractionError } from './videoFrameExtraction';
export type VideoPrepProgressEvent = {
    readonly tag: 'metadata';
} | {
    readonly tag: 'validated';
    readonly metadata: VideoPrepSourceMetadata;
} | {
    readonly tag: 'ffmpeg-load';
} | {
    readonly tag: 'compressing';
    readonly progress: number;
} | {
    readonly tag: 'fallback-original';
    readonly reason: BrowserVideoPrepCompressionError;
} | {
    readonly tag: 'complete';
    readonly output: BrowserVideoPrepOutputTag;
};
export type BrowserVideoPrepOutputTag = 'original' | 'compressed' | 'fallback-original';
export type BrowserVideoPrepResult = {
    readonly file: File;
    readonly originalFile: File;
    readonly policy: VideoPrepPolicy;
    readonly metadata: VideoPrepSourceMetadata;
    readonly preparedMetadata: VideoPrepSourceMetadata;
    readonly posterBlob: Blob;
    readonly output: {
        readonly tag: BrowserVideoPrepOutputTag;
        readonly originalBytes: number;
        readonly preparedBytes: number;
    };
};
export type BrowserVideoPrepError = {
    readonly tag: 'metadata-load-failed';
    readonly error: VideoFrameExtractionError;
} | {
    readonly tag: 'source-validation-failed';
    readonly error: VideoPrepValidationError;
} | {
    readonly tag: 'ffmpeg-load-failed';
    readonly error: BrowserFfmpegLoadError;
} | BrowserVideoPrepCompressionError;
export type BrowserVideoPrepCompressionError = {
    readonly tag: 'compression-failed';
    readonly message: string;
} | {
    readonly tag: 'timed-out';
} | {
    readonly tag: 'aborted';
} | {
    readonly tag: 'compressed-output-invalid';
};
export type BrowserVideoPrepInput = {
    readonly file: File;
    readonly intent: VideoPrepIntent;
    readonly signal?: AbortSignal;
    readonly timeoutMs?: number;
    readonly onProgress?: (event: VideoPrepProgressEvent) => void;
    readonly loadFfmpeg?: typeof loadBrowserFfmpeg;
};
/**
 * Prepares a browser video upload with metadata extraction, poster generation,
 * policy validation, and optional FFmpeg transcoding.
 */
export declare function prepareBrowserVideoUpload(input: BrowserVideoPrepInput): Promise<Result<BrowserVideoPrepResult, BrowserVideoPrepError>>;
export declare function preparedMetadataForOutput(metadata: VideoPrepSourceMetadata, policy: VideoPrepPolicy, outputTag: BrowserVideoPrepOutputTag): VideoPrepSourceMetadata;
