/** * Protocol utilities and signal type constants. * * Wraps the WASM `MediaProtocolHandle` into ergonomic TypeScript. * Channel naming, peer ID formatting, and signal types are all here. * * @example * ```ts * import { createHostSdk, SIGNAL_OFFER } from "@polkadot-apps/host-sdk"; * * const sdk = await createHostSdk(); * const channel = sdk.protocol.mediaSignalChannel("myapp", myPeerId, remotePeerId); * const peerId = sdk.protocol.formatPeerId(pubkeyHex); * ``` */ export declare const SIGNAL_OFFER: "offer"; export declare const SIGNAL_ANSWER: "answer"; export declare const SIGNAL_CANDIDATE: "candidate"; export declare const SIGNAL_HANGUP: "hangup"; export declare const SIGNAL_RING: "ring"; export declare const SIGNAL_CONNECTED: "connected"; export declare const SIGNAL_CLOSED: "closed"; export declare const SIGNAL_REMOTE_TRACK: "remoteTrack"; /** Channel naming and peer identity utilities from host-extensions::protocol. */ export interface ProtocolUtils { /** Build the media signaling channel name for a directed signal (from → to). */ mediaSignalChannel(appId: string, from: string, to: string): string; /** Build the media ring channel name (incoming call listener). */ mediaRingChannel(appId: string, peerId: string): string; /** Build the data offer channel name (outgoing offer → target). */ dataOfferChannel(appId: string, targetPeer: string): string; /** Build the data answer channel name (answer back → target). */ dataAnswerChannel(appId: string, targetPeer: string): string; /** Determine which peer is the WebRTC offerer (deterministic). */ isOfferer(localPeerId: string, remotePeerId: string): boolean; /** Format a public key hex into a canonical peer ID (`peer-{16hex}`). */ formatPeerId(pubkeyHex: string): string; } //# sourceMappingURL=protocol.d.ts.map