12345678910111213141516171819202122232425262728293031 |
- 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<Ifc, SubresT>[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<any>
- fire: (rpcname:string, ...args: any[]) => Promise<any>
- on: T.OnFunction
- close() : void
- }
-
- export interface Destroyable{
- destroy() : void
- }
|