This commit is contained in:
2019-09-22 10:25:15 +02:00
parent d0204faf47
commit 3dadc48b32
2 changed files with 17 additions and 10 deletions
+11 -9
View File
@@ -18,7 +18,7 @@
**extractArgs**(`f`: Function): *T.Arg[]*
Defined in Utils.ts:91
Defined in Utils.ts:96
**Parameters:**
@@ -34,7 +34,7 @@ ___
**hookGenerator**(`rpc`: T.HookRPCany): *function*
Defined in Utils.ts:70
Defined in Utils.ts:75
**Parameters:**
@@ -58,7 +58,7 @@ ___
**makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
Defined in Utils.ts:96
Defined in Utils.ts:101
**Parameters:**
@@ -74,7 +74,7 @@ ___
**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:**
@@ -96,7 +96,9 @@ ___
**rpcToRpcinfo**<**SubResT**>(`rpc`: T.RPCSubResT, `owner`: T.Owner): *T.RpcInfo*
Defined in Utils.ts:8
Defined in Utils.ts:13
Translate an RPC to RPCInfo for serialization.
**Type parameters:**
@@ -104,9 +106,9 @@ Defined in Utils.ts:8
**Parameters:**
Name | Type |
------ | ------ |
`rpc` | T.RPCSubResT |
`owner` | T.Owner |
Name | Type | Description |
------ | ------ | ------ |
`rpc` | T.RPCSubResT | The RPC to transform |
`owner` | T.Owner | The owning RPC group's name |
**Returns:** *T.RpcInfo*
+6 -1
View File
@@ -4,7 +4,12 @@ import * as T from "./Types";
import * as I from "./Interfaces";
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 => {
switch (typeof rpc){
case "object":