Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

_utils_.md 2.4KB

rpclibraryGlobals“Utils”

External module: “Utils”

Index

Functions

Functions

Const extractArgs

extractArgs(f: Function): T.Arg[]

Defined in Utils.ts:102

Parameters:

Name Type
f Function

Returns: T.Arg[]


Const hookGenerator

hookGenerator(rpc: T.HookRPC‹any›): function

Defined in Utils.ts:81

Parameters:

Name Type
rpc T.HookRPC‹any›

Returns: function

▸ (socket?: I.Socket): HookFunction‹T›

Parameters:

Name Type
socket? I.Socket

makeSubResponse

makeSubResponse(uuid?: undefined | string): SubscriptionResponse

Defined in Utils.ts:107

Parameters:

Name Type
uuid? undefined | string

Returns: SubscriptionResponse


rpcHooker

rpcHooker<SubResT>(socket: Socket, exporter: Exporter‹SubResT›, makeUnique: boolean): T.ExtendedRpcInfo[]

Defined in Utils.ts:59

Utility function to apply the RPCs of an Exporter.

Type parameters:

SubResT

Parameters:

Name Type Default Description
socket Socket - The websocket (implementation: bsock) to hook on
exporter Exporter‹SubResT› - The exporter
makeUnique boolean true @default true Attach a suffix to RPC names

Returns: T.ExtendedRpcInfo[]


Const rpcToRpcinfo

rpcToRpcinfo<SubResT>(rpc: T.RPC‹SubResT›, owner: T.Owner): T.RpcInfo

Defined in Utils.ts:13

Translate an RPC to RPCInfo for serialization.

Type parameters:

SubResT

Parameters:

Name Type Description
rpc T.RPC‹SubResT› The RPC to transform
owner T.Owner The owning RPC group’s name

Returns: T.RpcInfo