import * as T from "./Types"; import * as I from "./Interfaces" /** * Interface for all classes that export RPCs */ export interface RPCExporter< Ifc extends T.RPCInterface, Name extends keyof Ifc, SubresT = {} >{ name: Name exportRPCs() : T.RPCInterfaceArray[Name] } /** * Generic socket interface that can apply to bsock as well as RPCSocket */ export interface Socket extends Destroyable { port: number hook: (rpcname: string, handler: T.AnyFunction) => I.Socket unhook: (rpcname:string) => I.Socket call: (rpcname:string, ...args: any[]) => Promise fire: (rpcname:string, ...args: any[]) => Promise on: T.OnFunction close() : void } export interface Destroyable{ destroy() : void }