import type { VoiceHandoffChannel } from "./handoff-contract.ts"; type Stage = "prepared" | "activate" | "active"; type RequestMethod = "peer.start" | "peer.close" | "session.send" | "session.rpc"; export type HandoffNotification = { type: "peer.command"; generation: number; command: string; value: unknown; } | { type: "peer.event"; generation: number; event: unknown; } | { type: "session.mute"; muted: boolean; } | { type: "session.event"; event: string; data: unknown; }; interface HandoffHandlers { request(method: RequestMethod, value: unknown): Promise; notification(message: HandoffNotification): void; closed(error: Error): void; } /** Call setup/control only. Audio stays on the original host's WebRTC peer. */ export declare class VoiceHandoffLink { private readonly pending; private readonly stages; private readonly stageWaiters; private sequence; private failure; private readonly removeMessage; private readonly removeClose; private readonly channel; private readonly handlers; constructor(channel: VoiceHandoffChannel, handlers: HandoffHandlers); get closed(): boolean; request(method: RequestMethod, value?: unknown): Promise; notify(message: HandoffNotification): void; stage(stage: Stage, value?: unknown): void; waitFor(stage: Stage): Promise; close(): void; fail(error: Error): void; private send; private finish; private receive; } export declare function isRecord(value: unknown): value is Record; export declare function asError(error: unknown): Error; export {};