import * as T from "./Types"; import * as I from "./Interfaces" /** * Interface for all classes that export RPCs */ export type RPCExporter< Ifc extends T.RPCInterface = T.RPCInterface, Name extends keyof Ifc = keyof Ifc, > = { name: Name RPCs : T.RPCDefinitions[Name] | (() => T.RPCDefinitions[Name]) } export interface Socket { id?: string bind: (name: string, listener: T.PioBindListener) => void hook: (rpcname: string, handler: T.PioHookListener) => void unhook: (rpcname: string, listener?:T.AnyFunction) => void call: (rpcname: string, ...args: any[]) => Promise fire: (rpcname: string, ...args: any[]) => Promise on: (type: string, f: T.AnyFunction)=>any emit: (eventName: string, data: any) => void close(): void }