import type { JanusJS } from 'janus-gateway-ts'; interface Events { consentdialog: (visible: boolean) => void; detached: () => void; icestate: (state: 'connected' | 'failed') => void; mediastate: (on: boolean, type: 'audio' | 'video') => void; cleanup: () => void; data: (data: any) => void; dataopen: () => void; localstream: (stream: MediaStream) => void; message: (message: unknown, jsep: JanusJS.JSEP) => void; remotestream: (stream: MediaStream) => void; slowlink: (uplink: boolean) => void; webrtcstate: (isConnected: boolean) => void; error: (error: unknown) => void; } declare type EventKeys = keyof Events; declare type EventParams = Parameters; declare type EventRType = ReturnType; declare type EventCallback = (handle: JanusJS.PluginHandle, ...args: EventParams) => EventRType; export declare type Event = (event: K, callback: EventCallback) => void; export declare type Handle = { on: Event; } & JanusJS.PluginHandle; export declare type PluginHandle = { handle: Handle; plugin: T; }; /** * For a given connection and plugin name, create a factory function for attaching a new handle. */ export default function (janus: JanusJS.Janus, plugin: string): (opaqueId: string) => Promise; export {};