This commit is contained in:
2019-09-22 10:52:33 +02:00
parent ab6121c8c8
commit 2bab836faf
12 changed files with 244 additions and 140 deletions
+6 -4
View File
@@ -18,12 +18,14 @@
**stripAfterEquals**(`str`: string): *string*
Defined in Frontend.ts:9
Defined in Frontend.ts:12
Utility function to strip parameters like "a = 3" of their defaults
**Parameters:**
Name | Type |
------ | ------ |
`str` | string |
Name | Type | Description |
------ | ------ | ------ |
`str` | string | The parameter to modify |
**Returns:** *string*
+1 -1
View File
@@ -7,5 +7,5 @@
### Interfaces
* [Destroyable](../interfaces/_interfaces_.destroyable.md)
* [Exporter](../interfaces/_interfaces_.exporter.md)
* [RPCExporter](../interfaces/_interfaces_.rpcexporter.md)
* [Socket](../interfaces/_interfaces_.socket.md)
+23 -15
View File
@@ -18,13 +18,15 @@
**extractArgs**(`f`: Function): *T.Arg[]*
Defined in Utils.ts:102
Defined in Utils.ts:110
Extract a string list of parameters from a function
**Parameters:**
Name | Type |
------ | ------ |
`f` | Function |
Name | Type | Description |
------ | ------ | ------ |
`f` | Function | The source function |
**Returns:** *T.Arg[]*
@@ -34,16 +36,20 @@ ___
**hookGenerator**(`rpc`: T.HookRPCany): *function*
Defined in Utils.ts:81
Defined in Utils.ts:85
Utility function to generate [HookFunction](_types_.md#hookfunction) from a RPC
**Parameters:**
Name | Type |
------ | ------ |
`rpc` | T.HookRPCany |
Name | Type | Description |
------ | ------ | ------ |
`rpc` | T.HookRPCany | The RPC to transform |
**Returns:** *function*
A [HookFunction](_types_.md#hookfunction)
▸ (`socket?`: I.Socket): *[HookFunction](_types_.md#hookfunction)T*
**Parameters:**
@@ -58,13 +64,15 @@ ___
**makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
Defined in Utils.ts:107
Defined in Utils.ts:119
Simple utility function to create basic [SubscriptionResponse](_types_.md#subscriptionresponse)
**Parameters:**
Name | Type |
------ | ------ |
`uuid?` | undefined | string |
Name | Type | Description |
------ | ------ | ------ |
`uuid?` | undefined | string | optional uuid to use, otherwise defaults to uuid/v4 |
**Returns:** *[SubscriptionResponse](_types_.md#subscriptionresponse)*
@@ -72,11 +80,11 @@ ___
### rpcHooker
**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`: [RPCExporter](../interfaces/_interfaces_.rpcexporter.md)SubResT, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
Defined in Utils.ts:59
Utility function to apply the RPCs of an [Exporter](../interfaces/_interfaces_.exporter.md).
Utility function to apply the RPCs of an [RPCExporter](../interfaces/_interfaces_.rpcexporter.md).
**Type parameters:**
@@ -87,7 +95,7 @@ Utility function to apply the RPCs of an [Exporter](../interfaces/_interfaces_.e
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`socket` | [Socket](../interfaces/_interfaces_.socket.md) | - | The websocket (implementation: bsock) to hook on |
`exporter` | [Exporter](../interfaces/_interfaces_.exporter.md)SubResT | - | The exporter |
`exporter` | [RPCExporter](../interfaces/_interfaces_.rpcexporter.md)SubResT | - | The exporter |
`makeUnique` | boolean | true | @default true Attach a suffix to RPC names |
**Returns:** *T.ExtendedRpcInfo[]*