import { AgentInfo } from "../signaller/types.js"; import { BrowserApiOptions } from "./types.js"; export type BrowserApi = ReturnType; /** * each browser peer exposes these functions to the signalling server. * each exposed function is like a lever that the signalling server can pull to remotely control the browser peer. * thus, the signalling server is really the one calling the shots and driving the webrtc negotiation. * think of the signalling server as a traffic cop (with the whistle) commanding each browser peer throughout the negotation process. */ export declare function makeBrowserApi({ rtcConfigurator, cableConfig, signallerApi, allow, welcome, }: BrowserApiOptions): { v1: { /** somebody wants to join a room you are hosting.. will you allow it? */ knock(buddy: AgentInfo): Promise; startPeerConnection(attemptId: string, buddy: AgentInfo): Promise; produceOffer(attemptId: string): Promise; produceAnswer(attemptId: string, offer: RTCSessionDescription): Promise; acceptAnswer(attemptId: string, answer: RTCSessionDescription): Promise; acceptIceCandidate(attemptId: string, candidate: RTCIceCandidate): Promise; waitUntilReady(attemptId: string): Promise; completed(attemptId: string): Promise; cancel(attemptId: string): Promise; }; };