/** * Lossless append-log JSON publishing over MoQ tracks: the counterpart to the lossy `Snapshot` * module. Instead of one value updated over time, a stream is an ordered log of self-contained * records that preserves everything; every {@link Producer.append} writes one JSON object as one * frame, nothing is ever superseded, and a {@link Consumer} yields every record in order. * * The whole log rides a **single group** that is never rolled: with {@link ProducerConfig.compression} * on, that one group is one DEFLATE window, so every record compresses against the earlier ones. * There is deliberately no group rolling (and so no catch-up machinery); a caller that wants to * bound the record rate throttles at the source. Interoperable on the wire with the Rust * `moq_json::stream`. * * @module */ import type * as Moq from "@moq/net"; /** Options for a stream {@link Producer}. */ export interface ProducerConfig { /** * Compress the group as one sync-flushed `deflate-raw` stream, so each record reuses the earlier * ones as context and shrinks sharply. A {@link Consumer} reading the track must set the same * flag. Defaults to `false`. */ compression?: boolean; } /** Options for a stream {@link Consumer}. */ export interface ConsumerConfig { /** Whether the track's frames are `deflate-raw` compressed. Must match the producer. Defaults to `false`. */ compression?: boolean; } /** * Publishes an ordered log of JSON records to a track, one record per frame in a single group. */ export declare class Producer { #private; /** Wrap a track to publish a record log into it. */ constructor(track: Moq.Track.Producer, config?: ProducerConfig); /** Append one record to the log. */ append(value: T): void; /** Finish the track, closing the group. */ finish(): void; } /** * Consumes an ordered log of JSON records from a track, yielding every record in order. * * The log rides a single group, so this reads that group's frames in order; one record per frame. */ export declare class Consumer { #private; constructor(track: Moq.Track.Subscriber, config?: ConsumerConfig); /** Get the next record, or `undefined` once the track ends. */ next(): Promise; [Symbol.asyncIterator](): AsyncIterator; } //# sourceMappingURL=stream.d.ts.map