import { Signal } from "@moq/signals"; /** Reactive backing state for a {@link Group}: buffered frames, a closed flag, and the running frame count. */ export declare class GroupState { frames: Signal[]>; closed: Signal; total: Signal; } /** An ordered stream of frames within a track, delivered over a single QUIC stream. */ export declare class Group { /** Sequence number of this group within its track. */ readonly sequence: number; /** Reactive backing state. */ state: GroupState; /** Resolves with the abort error (or undefined) once closed. */ readonly closed: Promise; constructor(sequence: number); /** * Writes a frame to the group. * @param frame - The frame to write */ writeFrame(frame: Uint8Array): void; /** Write a string as a single UTF-8 encoded frame. */ writeString(str: string): void; /** Write a value as a single JSON-encoded frame. */ writeJson(json: unknown): void; /** Write a boolean as a single one-byte frame. */ writeBool(bool: boolean): void; /** * Reads the next frame from the group. * @returns A promise that resolves to the next frame or undefined */ readFrame(): Promise; /** Reads the next frame along with its sequence number within the group. */ readFrameSequence(): Promise<{ sequence: number; data: Uint8Array; } | undefined>; /** Reads the next frame and decodes it as a UTF-8 string. */ readString(): Promise; /** Reads the next frame and parses it as JSON. */ readJson(): Promise; /** Reads the next frame and decodes it as a one-byte boolean. */ readBool(): Promise; /** Closes the group, optionally with an error to abort readers. */ close(abort?: Error): void; } //# sourceMappingURL=group.d.ts.map