12345678910111213141516171819202122232425262728293031 |
- import * as T from "./Types";
- import * as I from "./Interfaces"
-
- /**
- * Interface for all classes that may export RPCs
- */
- export interface RPCExporter<
- Ifc extends T.RPCInterface,
- K extends keyof Ifc,
- SubresT = {}
- >{
- name: K
- exportRPCs() : T.RPC<Ifc[K], keyof Ifc[K], SubresT>[]
- }
-
- /**
- * 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<any>
- fire: (rpcname:string, ...args: any[]) => Promise<any>
- on: T.OnFunction
- close() : void
- }
-
- export interface Destroyable{
- destroy() : void
- }
|