123456789101112131415161718192021222324252627 |
- import * as T from "./Types";
- import * as I from "./Interfaces"
-
- /**
- * Interface for all classes that may export RPCs
- */
- export interface RPCExporter<T = {}>{
- name: T.Name
- exportRPCs() : T.RPC<T>[]
- }
-
- /**
- * 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<any>) => I.Socket
- unhook: (rpcname:T.Name) => I.Socket
- call: (rpcname:T.Name, ...args: T.Any[]) => Promise<T.Any>
- fire: (rpcname:T.Name, ...args: T.Any[]) => Promise<T.Any>
- on: T.OnFunction
- close() : void
- }
-
- export interface Destroyable{
- destroy() : void
- }
|