import type { Announced } from "../announced"; import type { Broadcast } from "../broadcast"; import type { Established } from "../connection/established"; import * as Path from "../path"; import { type Stream } from "../stream"; import { type IetfVersion } from "./version"; /** * Represents a connection to a MoQ server using moq-transport protocol. * * @public */ export declare class Connection implements Established { #private; readonly url: URL; readonly version: string; /** * Creates a new Connection instance. * @param url - The URL of the connection * @param quic - The WebTransport session * @param control - The control/setup stream * @param maxRequestId - The initial max request ID * @param version - The negotiated protocol version * * @internal */ constructor({ url, quic, control, maxRequestId, version, }: { url: URL; quic: WebTransport; control: Stream; maxRequestId: bigint; version: IetfVersion; }); /** * Closes the connection. */ close(): void; /** * Publishes a broadcast to the connection. * @param name - The broadcast path to publish * @param broadcast - The broadcast to publish */ publish(path: Path.Valid, broadcast: Broadcast): void; /** * Gets an announced reader for the specified prefix. * @param prefix - The prefix for announcements * @returns An Announced instance */ announced(prefix?: Path.Valid): Announced; /** * Consumes a broadcast from the connection. * * @remarks * If the broadcast is not found, a "not found" error will be thrown when requesting any tracks. * * @param broadcast - The path of the broadcast to consume * @returns A Broadcast instance */ consume(broadcast: Path.Valid): Broadcast; /** * Returns a promise that resolves when the connection is closed. * @returns A promise that resolves when closed */ get closed(): Promise; } //# sourceMappingURL=connection.d.ts.map