doc
This commit is contained in:
+11
-9
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
▸ **extractArgs**(`f`: Function): *T.Arg[]*
|
▸ **extractArgs**(`f`: Function): *T.Arg[]*
|
||||||
|
|
||||||
Defined in Utils.ts:91
|
Defined in Utils.ts:96
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ ___
|
|||||||
|
|
||||||
▸ **hookGenerator**(`rpc`: T.HookRPC‹any›): *function*
|
▸ **hookGenerator**(`rpc`: T.HookRPC‹any›): *function*
|
||||||
|
|
||||||
Defined in Utils.ts:70
|
Defined in Utils.ts:75
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ ___
|
|||||||
|
|
||||||
▸ **makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
|
▸ **makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
|
||||||
|
|
||||||
Defined in Utils.ts:96
|
Defined in Utils.ts:101
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ ___
|
|||||||
|
|
||||||
▸ **rpcHooker**<**SubResT**>(`socket`: [Socket](../interfaces/_interfaces_.socket.md), `exporter`: [Exporter](../interfaces/_interfaces_.exporter.md)‹SubResT›, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
|
▸ **rpcHooker**<**SubResT**>(`socket`: [Socket](../interfaces/_interfaces_.socket.md), `exporter`: [Exporter](../interfaces/_interfaces_.exporter.md)‹SubResT›, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
|
||||||
|
|
||||||
Defined in Utils.ts:48
|
Defined in Utils.ts:53
|
||||||
|
|
||||||
**Type parameters:**
|
**Type parameters:**
|
||||||
|
|
||||||
@@ -96,7 +96,9 @@ ___
|
|||||||
|
|
||||||
▸ **rpcToRpcinfo**<**SubResT**>(`rpc`: T.RPC‹SubResT›, `owner`: T.Owner): *T.RpcInfo*
|
▸ **rpcToRpcinfo**<**SubResT**>(`rpc`: T.RPC‹SubResT›, `owner`: T.Owner): *T.RpcInfo*
|
||||||
|
|
||||||
Defined in Utils.ts:8
|
Defined in Utils.ts:13
|
||||||
|
|
||||||
|
Translate an RPC to RPCInfo for serialization.
|
||||||
|
|
||||||
**Type parameters:**
|
**Type parameters:**
|
||||||
|
|
||||||
@@ -104,9 +106,9 @@ Defined in Utils.ts:8
|
|||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
Name | Type |
|
Name | Type | Description |
|
||||||
------ | ------ |
|
------ | ------ | ------ |
|
||||||
`rpc` | T.RPC‹SubResT› |
|
`rpc` | T.RPC‹SubResT› | The RPC to transform |
|
||||||
`owner` | T.Owner |
|
`owner` | T.Owner | The owning RPC group's name |
|
||||||
|
|
||||||
**Returns:** *T.RpcInfo*
|
**Returns:** *T.RpcInfo*
|
||||||
|
|||||||
+6
-1
@@ -4,7 +4,12 @@ import * as T from "./Types";
|
|||||||
import * as I from "./Interfaces";
|
import * as I from "./Interfaces";
|
||||||
import { SubscriptionResponse } from "./Types";
|
import { SubscriptionResponse } from "./Types";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translate an RPC to RPCInfo for serialization.
|
||||||
|
* @param rpc The RPC to transform
|
||||||
|
* @param owner The owning RPC group's name
|
||||||
|
* @throws Error on RPC without name property
|
||||||
|
*/
|
||||||
export const rpcToRpcinfo = <SubResT = {}>(rpc : T.RPC<SubResT>, owner: T.Owner):T.RpcInfo => {
|
export const rpcToRpcinfo = <SubResT = {}>(rpc : T.RPC<SubResT>, owner: T.Owner):T.RpcInfo => {
|
||||||
switch (typeof rpc){
|
switch (typeof rpc){
|
||||||
case "object":
|
case "object":
|
||||||
|
|||||||
Reference in New Issue
Block a user