import type { PackagerFormat } from '../packager/media_packager.js';
export declare const MEDIA_DUMP_DEFAULT_MEDIA_TYPES: string[];
export declare const MEDIA_DUMP_DEFAULT_MAX_OBJECTS = 600;
/** What to capture, typically read from the UI / the worker `init` config. */
export interface MediaDumpConfig {
    enabled: boolean;
    mediaTypes?: string[];
    maxObjects?: number;
    maxDurationMs?: number;
}
/** Why a capture stopped, so the caller can tell a full dump from a truncated one. */
export type MediaDumpReason = 'objectCap' | 'durationCap' | 'manual' | 'sessionEnd';
/** One finished capture, ready to be written to disc by the main thread. */
export interface MediaDumpFile {
    mediaType: string;
    data: Uint8Array;
    fileName: string;
    mimeType: string;
    objects: number;
    durationMs: number;
    reason: MediaDumpReason;
}
/** File name and MIME type for a capture of `format`. */
export declare function mediaDumpFileInfo(format: PackagerFormat, mediaType: string): {
    fileName: string;
    mimeType: string;
};
export declare class MediaDumper {
    private readonly format;
    private readonly onFile;
    private states;
    constructor(format: PackagerFormat, onFile: (file: MediaDumpFile) => void);
    /** Arm every media type asked for by a config, if it is enabled at all. */
    armFromConfig(config: MediaDumpConfig): void;
    /**
     * Start capturing one media type. Capture only begins on the next group
     * boundary, so what is captured can be decoded on its own.
     */
    arm(mediaType: string, maxObjects?: number, maxDurationMs?: number): void;
    isArmed(mediaType: string): boolean;
    armedMediaTypes(): string[];
    /**
     * Add one packaged object payload to the capture of its media type.
     * `timestampMs` is the media time of the object, used for the duration cap.
     */
    capture(mediaType: string, payload: any, newGroup: boolean, timestampMs?: number): void;
    /**
     * Hand the captured bytes to the callback and disarm. `skipIfEmpty` is for
     * the end-of-session flush, which must stay quiet when nothing was captured.
     */
    flush(mediaType: string, skipIfEmpty?: boolean, reason?: MediaDumpReason): void;
    /** Save whatever every armed capture collected so far (end of session). */
    flushAll(): void;
}
//# sourceMappingURL=media_dumper.d.ts.map