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