import { WebrtcEvent, Subscription, WebrtcOpenRequest, WebrtcOpenResult } from '@napplet/core'; /** * Napplet NAP webrtc shim entrypoint. * * @module */ /** * Handle webrtc.* result and event messages from the shell. * * @param msg The shell envelope to route */ declare function handleWebrtcMessage(msg: { type: string; [key: string]: unknown; }): void; /** * Open a runtime-owned WebRTC session. * * @param openRequest Session scope and channel/protocol labels * @returns Promise resolving to the opened session result */ declare function open(openRequest: WebrtcOpenRequest): Promise; /** * Send an opaque application payload over a WebRTC session. * * @param sessionId WebRTC session id * @param payload Application payload * @returns Promise resolving when the runtime accepts the send */ declare function send(sessionId: string, payload: unknown): Promise; /** * Close a WebRTC session. * * @param sessionId WebRTC session id * @param reason Optional close reason * @returns Promise resolving when the session is closed */ declare function close(sessionId: string, reason?: string): Promise; /** * Subscribe to runtime-pushed WebRTC events. * * @param handler Event handler * @returns Subscription handle */ declare function onEvent(handler: (event: WebrtcEvent) => void): Subscription; /** * Install the WebRTC shim. Registration-only -- sessions are opened on demand. * * @returns cleanup function that clears pending requests and event handlers */ declare function installWebrtcShim(): () => void; export { close, handleWebrtcMessage, installWebrtcShim, onEvent, open, send };