import { type Throws } from '@livekit/throws-transformer/throws'; import { LivekitReasonedError } from '../errors'; import { type DataTrackFrameInternal } from './frame'; import { DataTrackPacket } from './packet'; /** An error indicating a frame was dropped. */ export declare class DataTrackDepacketizerDropError extends LivekitReasonedError { readonly name = "DataTrackDepacketizerDropError"; reason: Reason; reasonName: string; frameNumber: number; constructor(message: string, reason: Reason, frameNumber: number, options?: { cause?: unknown; }); static interrupted(frameNumber: number, newFrameNumber: number): DataTrackDepacketizerDropError; static unknownFrame(frameNumber: number): DataTrackDepacketizerDropError; static bufferFull(frameNumber: number): DataTrackDepacketizerDropError; static incomplete(frameNumber: number, receivedPackets: number, expectedPackets: number): DataTrackDepacketizerDropError; } /** Reason why a frame was dropped. */ export declare enum DataTrackDepacketizerDropReason { Interrupted = 0, UnknownFrame = 1, BufferFull = 2, Incomplete = 3 } type PushOptions = { /** If true, throws an error instead of logging a warning when a new frame is encountered half way * through processing a pre-existing frame. */ errorOnPartialFrames: boolean; }; export default class DataTrackDepacketizer { /** Maximum number of packets to buffer per frame before dropping. */ static MAX_BUFFER_PACKETS: number; private partial; /** Should be repeatedly called with received {@link DataTrackPacket}s - intermediate calls * aggregate the packet's state internally, and return null. * * Once this method is called with the final packet to form a frame, a new {@link DataTrackFrameInternal} * is returned.*/ push(packet: DataTrackPacket, options?: PushOptions): Throws; reset(): void; private frameFromSingle; /** Begin assembling a new packet. */ private beginPartial; /** Push to the existing partial frame. */ private pushToPartial; /** Try to reassemble the complete frame. */ private finalize; } export {}; //# sourceMappingURL=depacketizer.d.ts.map