/** * Stores a media segment received from the segmenter. Enforces the segment count limit by removing the oldest segment when necessary. This is for .m4s media segments, * not the init segment. * @param streamId - The numeric stream ID. * @param filename - The segment filename (e.g., "segment0.m4s"). * @param data - The segment binary data. */ export declare function storeSegment(streamId: number, filename: string, data: Buffer): void; /** * Gets a media segment by filename. * @param streamId - The numeric stream ID. * @param filename - The segment filename. * @returns The segment data, or undefined if not found. */ export declare function getSegment(streamId: number, filename: string): Buffer | undefined; /** * Returns the number of media segments currently stored for a stream. Used by the segmenter to clamp the playlist window to segments that actually exist in storage. * @param streamId - The numeric stream ID. * @returns The number of stored segments, or 0 if the stream is not found. */ export declare function getSegmentCount(streamId: number): number; /** * Stores the fMP4 initialization segment for a stream. The init segment contains codec configuration and is sent once at stream start. Unlike media segments, it is * retained for the entire stream lifetime (not subject to rotation). * @param streamId - The numeric stream ID. * @param data - The init segment binary data. */ export declare function storeInitSegment(streamId: number, data: Buffer): void; /** * Gets the fMP4 initialization segment for a stream. * @param streamId - The numeric stream ID. * @returns The init segment data, or undefined if not found or not yet received. */ export declare function getInitSegment(streamId: number): Buffer | undefined; /** * Updates the playlist content for a stream. If this is the first playlist, signals that the stream is ready. * @param streamId - The numeric stream ID. * @param content - The m3u8 playlist content. */ export declare function updatePlaylist(streamId: number, content: string): void; /** * Gets the current playlist for a stream. * @param streamId - The numeric stream ID. * @returns The playlist content, or undefined if not found. */ export declare function getPlaylist(streamId: number): string | undefined; /** * Waits for the first playlist to be available for a stream. * @param streamId - The numeric stream ID. * @param timeout - Maximum time to wait in milliseconds. * @returns True if playlist is ready, false if timeout or stream not found. */ export declare function waitForPlaylist(streamId: number, timeout: number): Promise; /** * Waits for the first init segment to be available for a stream. Used by MPEG-TS consumers to wait for codec configuration before starting their FFmpeg remuxer. * @param streamId - The numeric stream ID. * @param timeout - Maximum time to wait in milliseconds. * @returns True if init segment is ready, false if timeout or stream not found. */ export declare function waitForInitSegment(streamId: number, timeout: number): Promise;