import * as T from "./Types"; /** * 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.GenericFunction) => void call: (rpcname: string, ...args: any[]) => Promise fire: (rpcname: string, ...args: any[]) => Promise on: (type: string, f: T.GenericFunction)=>any emit: (eventName: string, ...args: any[]) => void close(): void }