automate documentation

This commit is contained in:
Daniel Hübleitner
2019-09-22 11:25:01 +02:00
parent 2bab836faf
commit 387aa3f8eb
15 changed files with 60 additions and 1233 deletions
-9
View File
@@ -1,9 +0,0 @@
[rpclibrary](../README.md) [Globals](../globals.md) ["Backend"](_backend_.md)
# External module: "Backend"
## Index
### Classes
* [RPCServer](../classes/_backend_.rpcserver.md)
-31
View File
@@ -1,31 +0,0 @@
[rpclibrary](../README.md) [Globals](../globals.md) ["Frontend"](_frontend_.md)
# External module: "Frontend"
## Index
### Classes
* [RPCSocket](../classes/_frontend_.rpcsocket.md)
### Functions
* [stripAfterEquals](_frontend_.md#stripafterequals)
## Functions
### stripAfterEquals
**stripAfterEquals**(`str`: string): *string*
Defined in Frontend.ts:12
Utility function to strip parameters like "a = 3" of their defaults
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`str` | string | The parameter to modify |
**Returns:** *string*
-11
View File
@@ -1,11 +0,0 @@
[rpclibrary](../README.md) [Globals](../globals.md) ["Interfaces"](_interfaces_.md)
# External module: "Interfaces"
## Index
### Interfaces
* [Destroyable](../interfaces/_interfaces_.destroyable.md)
* [RPCExporter](../interfaces/_interfaces_.rpcexporter.md)
* [Socket](../interfaces/_interfaces_.socket.md)
-387
View File
@@ -1,387 +0,0 @@
[rpclibrary](../README.md) [Globals](../globals.md) ["Types"](_types_.md)
# External module: "Types"
## Index
### Type aliases
* [Any](_types_.md#any)
* [Arg](_types_.md#arg)
* [AsyncFunction](_types_.md#asyncfunction)
* [BaseInfo](_types_.md#baseinfo)
* [CallInfo](_types_.md#callinfo)
* [CallRPC](_types_.md#callrpc)
* [CallbackFunction](_types_.md#callbackfunction)
* [CloseHandler](_types_.md#closehandler)
* [ConnectionHandler](_types_.md#connectionhandler)
* [ErrorHandler](_types_.md#errorhandler)
* [ErrorResponse](_types_.md#errorresponse)
* [ExtendedRpcInfo](_types_.md#extendedrpcinfo)
* [HookCloseFunction](_types_.md#hookclosefunction)
* [HookFunction](_types_.md#hookfunction)
* [HookInfo](_types_.md#hookinfo)
* [HookRPC](_types_.md#hookrpc)
* [Name](_types_.md#name)
* [OnFunction](_types_.md#onfunction)
* [Outcome](_types_.md#outcome)
* [Owner](_types_.md#owner)
* [RPC](_types_.md#rpc)
* [RPCType](_types_.md#rpctype)
* [ResponseType](_types_.md#responsetype)
* [Respose](_types_.md#respose)
* [RpcInfo](_types_.md#rpcinfo)
* [SocketConf](_types_.md#socketconf)
* [SubscriptionResponse](_types_.md#subscriptionresponse)
* [SuccessResponse](_types_.md#successresponse)
* [Visibility](_types_.md#visibility)
## Type aliases
### Any
Ƭ **Any**: *any*
Defined in Types.ts:4
___
### Arg
Ƭ **Arg**: *string*
Defined in Types.ts:5
___
### AsyncFunction
Ƭ **AsyncFunction**: *function*
Defined in Types.ts:65
#### Type declaration:
▸ (...`args`: any): *Promiseany*
**Parameters:**
Name | Type |
------ | ------ |
`...args` | any |
___
### BaseInfo
Ƭ **BaseInfo**: *object*
Defined in Types.ts:43
#### Type declaration:
* **argNames**: *[Name](_types_.md#name)[]*
* **name**: *[Name](_types_.md#name)*
* **owner**: *[Name](_types_.md#name)*
___
### CallInfo
Ƭ **CallInfo**: *[BaseInfo](_types_.md#baseinfo) & object*
Defined in Types.ts:54
___
### CallRPC
Ƭ **CallRPC**: *object | Function*
Defined in Types.ts:36
___
### CallbackFunction
Ƭ **CallbackFunction**: *function*
Defined in Types.ts:66
#### Type declaration:
▸ (...`args`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`...args` | any |
___
### CloseHandler
Ƭ **CloseHandler**: *function*
Defined in Types.ts:10
#### Type declaration:
▸ (`socket`: [Socket](../interfaces/_interfaces_.socket.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`socket` | [Socket](../interfaces/_interfaces_.socket.md) |
___
### ConnectionHandler
Ƭ **ConnectionHandler**: *function*
Defined in Types.ts:8
#### Type declaration:
▸ (`socket`: [Socket](../interfaces/_interfaces_.socket.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`socket` | [Socket](../interfaces/_interfaces_.socket.md) |
___
### ErrorHandler
Ƭ **ErrorHandler**: *function*
Defined in Types.ts:9
#### Type declaration:
▸ (`socket`: [Socket](../interfaces/_interfaces_.socket.md), `error`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`socket` | [Socket](../interfaces/_interfaces_.socket.md) |
`error` | any |
___
### ErrorResponse
Ƭ **ErrorResponse**: *[Respose](_types_.md#respose)T & object*
Defined in Types.ts:24
___
### ExtendedRpcInfo
Ƭ **ExtendedRpcInfo**: *[RpcInfo](_types_.md#rpcinfo) & object*
Defined in Types.ts:60
___
### HookCloseFunction
Ƭ **HookCloseFunction**: *function*
Defined in Types.ts:63
#### Type declaration:
▸ (`res`: [SubscriptionResponse](_types_.md#subscriptionresponse)T, `rpc`: [HookRPC](_types_.md#hookrpc)T): *any*
**Parameters:**
Name | Type |
------ | ------ |
`res` | [SubscriptionResponse](_types_.md#subscriptionresponse)T |
`rpc` | [HookRPC](_types_.md#hookrpc)T |
___
### HookFunction
Ƭ **HookFunction**: *function*
Defined in Types.ts:64
#### Type declaration:
▸ (...`args`: any): *Promise[SubscriptionResponse](_types_.md#subscriptionresponse)T | [ErrorResponse](_types_.md#errorresponse)*
**Parameters:**
Name | Type |
------ | ------ |
`...args` | any |
___
### HookInfo
Ƭ **HookInfo**: *[BaseInfo](_types_.md#baseinfo) & object*
Defined in Types.ts:49
___
### HookRPC
Ƭ **HookRPC**: *object*
Defined in Types.ts:29
#### Type declaration:
* **hook**: *[HookFunction](_types_.md#hookfunction)T*
* **name**: *[Name](_types_.md#name)*
* **onCallback**? : *[CallbackFunction](_types_.md#callbackfunction)*
* **onClose**? : *[HookCloseFunction](_types_.md#hookclosefunction)T*
___
### Name
Ƭ **Name**: *[Arg](_types_.md#arg)*
Defined in Types.ts:6
___
### OnFunction
Ƭ **OnFunction**: *function*
Defined in Types.ts:62
#### Type declaration:
▸ (`type`: "error" | "close", `f`: function): *[Socket](../interfaces/_interfaces_.socket.md)*
**Parameters:**
**type**: *"error" | "close"*
**f**: *function*
▸ (`e?`: any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`e?` | any |
___
### Outcome
Ƭ **Outcome**: *"Success" | "Error"*
Defined in Types.ts:19
___
### Owner
Ƭ **Owner**: *[Name](_types_.md#name)*
Defined in Types.ts:7
___
### RPC
Ƭ **RPC**: *[CallRPC](_types_.md#callrpc) | [HookRPC](_types_.md#hookrpc)T*
Defined in Types.ts:41
___
### RPCType
Ƭ **RPCType**: *"Hook" | "Unhook" | "Call"*
Defined in Types.ts:27
___
### ResponseType
Ƭ **ResponseType**: *"Subscribe" | "Success" | "Error"*
Defined in Types.ts:18
___
### Respose
Ƭ **Respose**: *T & object*
Defined in Types.ts:22
___
### RpcInfo
Ƭ **RpcInfo**: *[HookInfo](_types_.md#hookinfo) | [CallInfo](_types_.md#callinfo)*
Defined in Types.ts:59
___
### SocketConf
Ƭ **SocketConf**: *object*
Defined in Types.ts:11
#### Type declaration:
* **closeHandler**? : *[CloseHandler](_types_.md#closehandler)*
* **connectionHandler**? : *[ConnectionHandler](_types_.md#connectionhandler)*
* **errorHandler**? : *[ErrorHandler](_types_.md#errorhandler)*
* **visibility**? : *[Visibility](_types_.md#visibility)*
___
### SubscriptionResponse
Ƭ **SubscriptionResponse**: *[Respose](_types_.md#respose)T & object*
Defined in Types.ts:25
___
### SuccessResponse
Ƭ **SuccessResponse**: *[Respose](_types_.md#respose)T & object*
Defined in Types.ts:23
___
### Visibility
Ƭ **Visibility**: *"127.0.0.1" | "0.0.0.0"*
Defined in Types.ts:3
-124
View File
@@ -1,124 +0,0 @@
[rpclibrary](../README.md) [Globals](../globals.md) ["Utils"](_utils_.md)
# External module: "Utils"
## Index
### Functions
* [extractArgs](_utils_.md#const-extractargs)
* [hookGenerator](_utils_.md#const-hookgenerator)
* [makeSubResponse](_utils_.md#makesubresponse)
* [rpcHooker](_utils_.md#rpchooker)
* [rpcToRpcinfo](_utils_.md#const-rpctorpcinfo)
## Functions
### `Const` extractArgs
**extractArgs**(`f`: Function): *T.Arg[]*
Defined in Utils.ts:110
Extract a string list of parameters from a function
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`f` | Function | The source function |
**Returns:** *T.Arg[]*
___
### `Const` hookGenerator
**hookGenerator**(`rpc`: T.HookRPCany): *function*
Defined in Utils.ts:85
Utility function to generate [HookFunction](_types_.md#hookfunction) from a RPC
**Parameters:**
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:**
Name | Type |
------ | ------ |
`socket?` | I.Socket |
___
### makeSubResponse
**makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
Defined in Utils.ts:119
Simple utility function to create basic [SubscriptionResponse](_types_.md#subscriptionresponse)
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`uuid?` | undefined | string | optional uuid to use, otherwise defaults to uuid/v4 |
**Returns:** *[SubscriptionResponse](_types_.md#subscriptionresponse)*
___
### rpcHooker
**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 [RPCExporter](../interfaces/_interfaces_.rpcexporter.md).
**Type parameters:**
**SubResT**
**Parameters:**
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`socket` | [Socket](../interfaces/_interfaces_.socket.md) | - | The websocket (implementation: bsock) to hook on |
`exporter` | [RPCExporter](../interfaces/_interfaces_.rpcexporter.md)SubResT | - | The exporter |
`makeUnique` | boolean | true | @default true Attach a suffix to RPC names |
**Returns:** *T.ExtendedRpcInfo[]*
___
### `Const` rpcToRpcinfo
**rpcToRpcinfo**<**SubResT**>(`rpc`: T.RPCSubResT, `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.RPCSubResT | The RPC to transform |
`owner` | T.Owner | The owning RPC group's name |
**Returns:** *T.RpcInfo*