interface MessageEmitter { emit: (event: any) => void; on(event: string, handler: Function): void; once(event: string, handler: Function): void; off(event: string, handler?: Function): void; } interface RPC extends MessageEmitter { init(): void; setConfig(config: any): void; getRemoteCallStack(): any; getRemote(): any; setInterface(_interface: any, config?: any): Promise; sendInterface(): void; disposeObject(obj: any): Promise; requestRemote(): void; reset(): void; disconnect(): void; } interface hRPC extends MessageEmitter { register_codec(config: any): void; ping(client_id: any, timeout: any): Promise; reset(): void; disconnect(): Promise; get_manager_service(timeout: any): Promise; get_all_local_services(): any; get_local_service(service_id: any, context: any): any; get_remote_service(service_uri: any, timeout?: any): Promise; add_service(api: any, overwrite?: any): any; register_service( api: any, overwrite?: any, notify?: any, context?: any ): Promise; unregister_service(service: any, notify?: any): Promise; get_client_info(): any; encode(aObject: any, session_id: any): any; decode(aObject: any): Promise; } interface HyphaServer { url: string; WebSocketClass: any; } interface ServerConfig { server?: HyphaServer; server_url?: string; client_id?: string; workspace?: string; token?: string; method_timeout?: number; name?: string; WebSocketClass?: any; } interface LoginConfig { server_url: string; login_service_id?: string; login_timeout?: string; login_callback?: Function; } interface API { id: string; name: string; } declare module "imjoy-rpc" { const imjoyRPCModule: { imjoyRPC: { RPC: string; API_VERSION: string; VERSION: string; loadRequirements: (config: any) => Promise; waitForInitialization: (config: any) => void; setupRPC: (config: any) => Promise; }, imjoyRPCSocketIO: { RPC: any; API_VERSION: string; VERSION: string; loadRequirements: (config: any) => Promise; waitForInitialization: (config: any) => void; setupRPC: (config: any) => Promise; Connection: any; connectToServer: (config: any) => Promise; }; hyphaRPC: { API_VERSION: string; RPC: hRPC; }; hyphaWebsocketClient: { RPC: hRPC; API_VERSION: string; VERSION: string; loadRequirements: (config: any) => Promise; login: (config: LoginConfig) => Promise; connectToServer: (config: ServerConfig) => Promise; registerRTCService: (server: any, service_id: string, config?: any) => Promise; getRTCService: (server: any, service_id: string, config?: any) => Promise; }; hyphaSSEClient: { RPC: hRPC; API_VERSION: string; VERSION: string; loadRequirements: (config: any) => Promise; login: (config: LoginConfig) => Promise; connectToServer: (config: ServerConfig) => Promise; registerRTCService: (server: any, service_id: string, config?: any) => Promise; getRTCService: (server: any, service_id: string, config?: any) => Promise; }; }; export = imjoyRPCModule; }