import type { Stream as StreamInner } from "../stream"; import { Fetch, FetchCancel, FetchError, FetchOk } from "./fetch"; import { GoAway } from "./goaway"; import { Publish, PublishDone, PublishError, PublishOk } from "./publish"; import { PublishNamespace, PublishNamespaceCancel, PublishNamespaceDone, PublishNamespaceError, PublishNamespaceOk } from "./publish_namespace"; import { MaxRequestId, RequestError, RequestOk, RequestsBlocked } from "./request"; import * as Setup from "./setup"; import { Subscribe, SubscribeError, SubscribeOk, SubscribeUpdate, Unsubscribe } from "./subscribe"; import { SubscribeNamespaceError, SubscribeNamespaceLegacy, SubscribeNamespaceOk, UnsubscribeNamespace } from "./subscribe_namespace"; import { TrackStatus, TrackStatusRequest } from "./track"; import { type IetfVersion } from "./version"; declare const MessagesV14: { readonly [Setup.ClientSetup.id]: typeof Setup.ClientSetup; readonly [Setup.ServerSetup.id]: typeof Setup.ServerSetup; readonly [SubscribeUpdate.id]: typeof SubscribeUpdate; readonly [Subscribe.id]: typeof Subscribe; readonly [SubscribeOk.id]: typeof SubscribeOk; readonly [SubscribeError.id]: typeof SubscribeError; readonly [PublishNamespace.id]: typeof PublishNamespace; readonly [PublishNamespaceOk.id]: typeof PublishNamespaceOk; readonly [PublishNamespaceError.id]: typeof PublishNamespaceError; readonly [PublishNamespaceCancel.id]: typeof PublishNamespaceCancel; readonly [TrackStatusRequest.id]: typeof TrackStatusRequest; readonly [TrackStatus.id]: typeof TrackStatus; readonly [GoAway.id]: typeof GoAway; readonly [Fetch.id]: typeof Fetch; readonly [FetchCancel.id]: typeof FetchCancel; readonly [FetchOk.id]: typeof FetchOk; readonly [FetchError.id]: typeof FetchError; readonly [SubscribeNamespaceLegacy.id]: typeof SubscribeNamespaceLegacy; readonly [SubscribeNamespaceOk.id]: typeof SubscribeNamespaceOk; readonly [SubscribeNamespaceError.id]: typeof SubscribeNamespaceError; readonly [UnsubscribeNamespace.id]: typeof UnsubscribeNamespace; readonly [Publish.id]: typeof Publish; readonly [PublishOk.id]: typeof PublishOk; readonly [PublishError.id]: typeof PublishError; readonly [MaxRequestId.id]: typeof MaxRequestId; readonly [RequestsBlocked.id]: typeof RequestsBlocked; readonly 9: typeof PublishNamespaceDone; readonly 10: typeof Unsubscribe; readonly 11: typeof PublishDone; }; declare const MessagesV15: { readonly [Setup.ClientSetup.id]: typeof Setup.ClientSetup; readonly [Setup.ServerSetup.id]: typeof Setup.ServerSetup; readonly [SubscribeUpdate.id]: typeof SubscribeUpdate; readonly [Subscribe.id]: typeof Subscribe; readonly [SubscribeOk.id]: typeof SubscribeOk; readonly [RequestError.id]: typeof RequestError; readonly [PublishNamespace.id]: typeof PublishNamespace; readonly [RequestOk.id]: typeof RequestOk; readonly [PublishNamespaceCancel.id]: typeof PublishNamespaceCancel; readonly [TrackStatusRequest.id]: typeof TrackStatusRequest; readonly [GoAway.id]: typeof GoAway; readonly [Fetch.id]: typeof Fetch; readonly [FetchCancel.id]: typeof FetchCancel; readonly [FetchOk.id]: typeof FetchOk; readonly [SubscribeNamespaceLegacy.id]: typeof SubscribeNamespaceLegacy; readonly [UnsubscribeNamespace.id]: typeof UnsubscribeNamespace; readonly [Publish.id]: typeof Publish; readonly [MaxRequestId.id]: typeof MaxRequestId; readonly [RequestsBlocked.id]: typeof RequestsBlocked; readonly 9: typeof PublishNamespaceDone; readonly 10: typeof Unsubscribe; readonly 11: typeof PublishDone; }; declare const MessagesV16: { readonly [Setup.ClientSetup.id]: typeof Setup.ClientSetup; readonly [Setup.ServerSetup.id]: typeof Setup.ServerSetup; readonly [SubscribeUpdate.id]: typeof SubscribeUpdate; readonly [Subscribe.id]: typeof Subscribe; readonly [SubscribeOk.id]: typeof SubscribeOk; readonly [RequestError.id]: typeof RequestError; readonly [PublishNamespace.id]: typeof PublishNamespace; readonly [RequestOk.id]: typeof RequestOk; readonly [PublishNamespaceCancel.id]: typeof PublishNamespaceCancel; readonly [TrackStatusRequest.id]: typeof TrackStatusRequest; readonly [GoAway.id]: typeof GoAway; readonly [Fetch.id]: typeof Fetch; readonly [FetchCancel.id]: typeof FetchCancel; readonly [FetchOk.id]: typeof FetchOk; readonly [Publish.id]: typeof Publish; readonly [MaxRequestId.id]: typeof MaxRequestId; readonly [RequestsBlocked.id]: typeof RequestsBlocked; readonly 9: typeof PublishNamespaceDone; readonly 10: typeof Unsubscribe; readonly 11: typeof PublishDone; }; declare const MessagesV17: { readonly [Setup.Setup.id]: typeof Setup.Setup; readonly [SubscribeUpdate.id]: typeof SubscribeUpdate; readonly [Subscribe.id]: typeof Subscribe; readonly [SubscribeOk.id]: typeof SubscribeOk; readonly [RequestError.id]: typeof RequestError; readonly [PublishNamespace.id]: typeof PublishNamespace; readonly [RequestOk.id]: typeof RequestOk; readonly [TrackStatusRequest.id]: typeof TrackStatusRequest; readonly [GoAway.id]: typeof GoAway; readonly [Fetch.id]: typeof Fetch; readonly [FetchOk.id]: typeof FetchOk; readonly [SubscribeNamespaceLegacy.id]: typeof SubscribeNamespaceLegacy; readonly [Publish.id]: typeof Publish; readonly 11: typeof PublishDone; }; type V14MessageType = (typeof MessagesV14)[keyof typeof MessagesV14]; type V15MessageType = (typeof MessagesV15)[keyof typeof MessagesV15]; type V16MessageType = (typeof MessagesV16)[keyof typeof MessagesV16]; type V17MessageType = (typeof MessagesV17)[keyof typeof MessagesV17]; type MessageType = V14MessageType | V15MessageType | V16MessageType | V17MessageType; export type Message = InstanceType; export declare class Stream { #private; stream: StreamInner; version: IetfVersion; constructor({ stream, maxRequestId, version, }: { stream: StreamInner; maxRequestId: bigint; version?: IetfVersion; }); /** * Writes a control message to the control stream with proper framing. * Format: Message Type (varint) + Message Length (u16) + Message Payload */ write(message: T): Promise; /** * Reads a control message from the control stream. * Returns the message type and a reader for the payload. */ read(): Promise; maxRequestId(max: bigint): void; nextRequestId(): Promise; close(): void; } export {}; //# sourceMappingURL=control.d.ts.map