/**
 * VideoEncoder - Encodes VideoFrame to encoded video data
 * Implements the W3C WebCodecs VideoEncoder interface
 */
import { VideoFrame } from './VideoFrame';
import { EncodedVideoChunk } from './EncodedVideoChunk';
import { CodecState, DOMException } from './types';
export type LatencyMode = 'quality' | 'realtime';
export type BitrateMode = 'constant' | 'variable' | 'quantizer';
export type AlphaOption = 'discard' | 'keep';
export interface VideoEncoderConfig {
    codec: string;
    width: number;
    height: number;
    displayWidth?: number;
    displayHeight?: number;
    bitrate?: number;
    framerate?: number;
    hardwareAcceleration?: 'no-preference' | 'prefer-hardware' | 'prefer-software';
    alpha?: AlphaOption;
    scalabilityMode?: string;
    bitrateMode?: BitrateMode;
    latencyMode?: LatencyMode;
    avc?: {
        format?: 'annexb' | 'avc';
    };
}
export interface VideoEncoderInit {
    output: (chunk: EncodedVideoChunk, metadata?: VideoEncoderOutputMetadata) => void;
    error: (error: DOMException) => void;
}
export interface VideoEncoderOutputMetadata {
    decoderConfig?: {
        codec: string;
        codedWidth: number;
        codedHeight: number;
        description?: ArrayBuffer;
    };
    svc?: {
        temporalLayerId: number;
    };
}
export interface VideoEncoderEncodeOptions {
    keyFrame?: boolean;
}
export interface VideoEncoderSupport {
    supported: boolean;
    config: VideoEncoderConfig;
}
export declare class VideoEncoder {
    private _native;
    private _state;
    private _outputCallback;
    private _errorCallback;
    private _encodeQueueSize;
    private _config;
    private _sentDecoderConfig;
    private _listeners;
    static isConfigSupported(config: VideoEncoderConfig): Promise<VideoEncoderSupport>;
    constructor(init: VideoEncoderInit);
    get state(): CodecState;
    get encodeQueueSize(): number;
    /**
     * Minimal EventTarget-style API for 'dequeue' events.
     * Mediabunny uses encoder.addEventListener('dequeue', fn, { once: true }).
     */
    addEventListener(type: string, listener: () => void, options?: {
        once?: boolean;
    }): void;
    removeEventListener(type: string, listener: () => void): void;
    private _dispatchEvent;
    configure(config: VideoEncoderConfig): void;
    encode(frame: VideoFrame, options?: VideoEncoderEncodeOptions): void;
    flush(): Promise<void>;
    reset(): void;
    close(): void;
    private _onChunk;
    private _onError;
}
//# sourceMappingURL=VideoEncoder.d.ts.map