Browse Source

generated from tag 2.4.0

tags/2.4.0
nitowa 8 months ago
parent
commit
9a05d8eb87
6 changed files with 163 additions and 57 deletions
  1. 57
    16
      README.md
  2. 5
    4
      classes/promiseio.md
  3. 2
    2
      classes/promiseioclient.md
  4. 27
    4
      classes/rpcserver.md
  5. 16
    16
      classes/rpcsocket.md
  6. 56
    15
      globals.md

+ 57
- 16
README.md View File

@@ -303,7 +303,7 @@ new RPCSocket<TProject>(port, host).connect().then(async sock => {
303 303
 
304 304
 ### Version
305 305
 
306
-2.3.1
306
+2.4.0
307 307
 
308 308
 
309 309
 ### Classes
@@ -326,6 +326,7 @@ new RPCSocket<TProject>(port, host).connect().then(async sock => {
326 326
 * [BaseInfo](globals.md#baseinfo)
327 327
 * [CallInfo](globals.md#callinfo)
328 328
 * [CallRPC](globals.md#callrpc)
329
+* [ClientConfig](globals.md#clientconfig)
329 330
 * [CloseHandler](globals.md#closehandler)
330 331
 * [ConnectedSocket](globals.md#connectedsocket)
331 332
 * [ConnectionHandler](globals.md#connectionhandler)
@@ -353,7 +354,6 @@ new RPCSocket<TProject>(port, host).connect().then(async sock => {
353 354
 * [ServerConf](globals.md#serverconf)
354 355
 * [SesameConf](globals.md#sesameconf)
355 356
 * [SesameFunction](globals.md#sesamefunction)
356
-* [SocketConf](globals.md#socketconf)
357 357
 * [SuccessResponse](globals.md#successresponse)
358 358
 * [Visibility](globals.md#visibility)
359 359
 * [exportT](globals.md#exportt)
@@ -373,6 +373,11 @@ new RPCSocket<TProject>(port, host).connect().then(async sock => {
373 373
 * [rpcToRpcinfo](globals.md#const-rpctorpcinfo)
374 374
 * [stripAfterEquals](globals.md#stripafterequals)
375 375
 
376
+### Object literals
377
+
378
+* [defaultClientConfig](globals.md#const-defaultclientconfig)
379
+* [defaultConfig](globals.md#const-defaultconfig)
380
+
376 381
 ## Type aliases
377 382
 
378 383
 ###  AccessFilter
@@ -454,6 +459,12 @@ ___
454 459
 
455 460
 ___
456 461
 
462
+###  ClientConfig
463
+
464
+Ƭ **ClientConfig**: *ConnectOpts & object*
465
+
466
+___
467
+
457 468
 ###  CloseHandler
458 469
 
459 470
 Ƭ **CloseHandler**: *function*
@@ -498,13 +509,13 @@ ___
498 509
 
499 510
 #### Type declaration:
500 511
 
501
-▸ (`socket`: [Socket](interfaces/socket.md) | [PromiseIO](classes/promiseio.md), `error`: any, `rpcName`: string, `args`: any[]): *void*
512
+▸ (`socket`: [Socket](interfaces/socket.md), `error`: any, `rpcName`: string, `args`: any[]): *void*
502 513
 
503 514
 **Parameters:**
504 515
 
505 516
 Name | Type |
506 517
 ------ | ------ |
507
-`socket` | [Socket](interfaces/socket.md) &#124; [PromiseIO](classes/promiseio.md) |
518
+`socket` | [Socket](interfaces/socket.md) |
508 519
 `error` | any |
509 520
 `rpcName` | string |
510 521
 `args` | any[] |
@@ -727,16 +738,6 @@ Name | Type |
727 738
 
728 739
 ___
729 740
 
730
-###  SocketConf
731
-
732
-Ƭ **SocketConf**: *object*
733
-
734
-#### Type declaration:
735
-
736
-* **tls**: *boolean*
737
-
738
-___
739
-
740 741
 ###  SuccessResponse
741 742
 
742 743
 Ƭ **SuccessResponse**: *[Respose](globals.md#respose)‹T› & object*
@@ -910,13 +911,13 @@ ___
910 911
 
911 912
 ###  rpcHooker
912 913
 
913
-▸ **rpcHooker**(`serverSocket`: [Socket](interfaces/socket.md), `exporter`: I.RPCExporter‹any, any›, `errorHandler`: T.ErrorHandler, `sesame?`: T.SesameFunction, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
914
+▸ **rpcHooker**(`socket`: [Socket](interfaces/socket.md), `exporter`: I.RPCExporter‹any, any›, `errorHandler`: T.ErrorHandler, `sesame?`: T.SesameFunction, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
914 915
 
915 916
 **Parameters:**
916 917
 
917 918
 Name | Type | Default | Description |
918 919
 ------ | ------ | ------ | ------ |
919
-`serverSocket` | [Socket](interfaces/socket.md) | - | The websocket (implementation: socket.io) to hook on |
920
+`socket` | [Socket](interfaces/socket.md) | - | The websocket (implementation: socket.io) to hook on |
920 921
 `exporter` | I.RPCExporter‹any, any› | - | The exporter |
921 922
 `errorHandler` | T.ErrorHandler | - | - |
922 923
 `sesame?` | T.SesameFunction | - | - |
@@ -955,3 +956,43 @@ Name | Type | Description |
955 956
 `str` | string | The parameter to modify  |
956 957
 
957 958
 **Returns:** *string*
959
+
960
+## Object literals
961
+
962
+### `Const` defaultClientConfig
963
+
964
+### ▪ **defaultClientConfig**: *object*
965
+
966
+###  protocol
967
+
968
+• **protocol**: *"http"* = "http"
969
+
970
+###  reconnection
971
+
972
+• **reconnection**: *false* = false
973
+
974
+###  reconnectionAttempts
975
+
976
+• **reconnectionAttempts**: *number* = 2
977
+
978
+###  reconnectionDelay
979
+
980
+• **reconnectionDelay**: *number* = 200
981
+
982
+###  timeout
983
+
984
+• **timeout**: *number* = 450
985
+
986
+___
987
+
988
+### `Const` defaultConfig
989
+
990
+### ▪ **defaultConfig**: *object*
991
+
992
+###  cookie
993
+
994
+• **cookie**: *false* = false
995
+
996
+###  path
997
+
998
+• **path**: *string* = "/socket.io"

+ 5
- 4
classes/promiseio.md View File

@@ -39,13 +39,14 @@ ___
39 39
 
40 40
 ###  attach
41 41
 
42
-▸ **attach**(`httpServer`: [httpServer](undefined)): *void*
42
+▸ **attach**(`httpServer`: [httpServer](undefined), `options`: socketio.ServerOptions): *void*
43 43
 
44 44
 **Parameters:**
45 45
 
46
-Name | Type |
47
------- | ------ |
48
-`httpServer` | [httpServer](undefined) |
46
+Name | Type | Default |
47
+------ | ------ | ------ |
48
+`httpServer` | [httpServer](undefined) | - |
49
+`options` | socketio.ServerOptions |  defaultConfig |
49 50
 
50 51
 **Returns:** *void*
51 52
 

+ 2
- 2
classes/promiseioclient.md View File

@@ -15,7 +15,7 @@
15 15
 
16 16
 ### `Static` connect
17 17
 
18
-▸ **connect**(`port`: number, `host`: string, `protocol`: "http" | "https"): *Promise‹[Socket](../interfaces/socket.md)›*
18
+▸ **connect**(`port`: number, `host`: string, `options`: [ClientConfig](../globals.md#clientconfig)): *Promise‹[Socket](../interfaces/socket.md)›*
19 19
 
20 20
 **Parameters:**
21 21
 
@@ -23,6 +23,6 @@ Name | Type | Default |
23 23
 ------ | ------ | ------ |
24 24
 `port` | number | - |
25 25
 `host` | string | "localhost" |
26
-`protocol` | "http" &#124; "https" | "http" |
26
+`options` | [ClientConfig](../globals.md#clientconfig) |  defaultClientConfig |
27 27
 
28 28
 **Returns:** *Promise‹[Socket](../interfaces/socket.md)›*

+ 27
- 4
classes/rpcserver.md View File

@@ -20,6 +20,7 @@
20 20
 * [accessFilter](rpcserver.md#private-accessfilter)
21 21
 * [attached](rpcserver.md#private-attached)
22 22
 * [closeHandler](rpcserver.md#private-closehandler)
23
+* [conf](rpcserver.md#private-conf)
23 24
 * [connectionHandler](rpcserver.md#private-connectionhandler)
24 25
 * [errorHandler](rpcserver.md#private-errorhandler)
25 26
 * [exporters](rpcserver.md#private-exporters)
@@ -44,7 +45,7 @@
44 45
 Name | Type | Default | Description |
45 46
 ------ | ------ | ------ | ------ |
46 47
 `exporters` | T.ExporterArray‹InterfaceT› |  [] | A list of [RPCExporter](../globals.md#rpcexporter) to publish |
47
-`conf` | T.ServerConf‹InterfaceT› |  {} | A [SocketConf](../globals.md#socketconf) object with optional settings  |
48
+`conf` | T.ServerConf‹InterfaceT› |  {} | A {@link SocketConf} object with optional settings  |
48 49
 
49 50
 **Returns:** *[RPCServer](rpcserver.md)*
50 51
 
@@ -68,6 +69,12 @@ ___
68 69
 
69 70
 ___
70 71
 
72
+### `Private` conf
73
+
74
+• **conf**: *T.ServerConf‹InterfaceT›*
75
+
76
+___
77
+
71 78
 ### `Private` connectionHandler
72 79
 
73 80
 • **connectionHandler**: *T.ConnectionHandler*
@@ -76,7 +83,21 @@ ___
76 83
 
77 84
 ### `Private` errorHandler
78 85
 
79
-• **errorHandler**: *T.ErrorHandler*
86
+• **errorHandler**: *function*
87
+
88
+#### Type declaration:
89
+
90
+▸ (`socket`: [Socket](../interfaces/socket.md), `error`: any, `rpcName`: string, `args`: any[], `forward?`: undefined | false | true): *void*
91
+
92
+**Parameters:**
93
+
94
+Name | Type |
95
+------ | ------ |
96
+`socket` | [Socket](../interfaces/socket.md) |
97
+`error` | any |
98
+`rpcName` | string |
99
+`args` | any[] |
100
+`forward?` | undefined &#124; false &#124; true |
80 101
 
81 102
 ___
82 103
 
@@ -100,13 +121,14 @@ ___
100 121
 
101 122
 ###  attach
102 123
 
103
-▸ **attach**(`httpServer`: Server): *[RPCServer](rpcserver.md)‹InterfaceT›*
124
+▸ **attach**(`httpServer`: Server, `options?`: SocketIO.ServerOptions): *[RPCServer](rpcserver.md)‹InterfaceT›*
104 125
 
105 126
 **Parameters:**
106 127
 
107 128
 Name | Type | Default |
108 129
 ------ | ------ | ------ |
109 130
 `httpServer` | Server |  new http.Server() |
131
+`options?` | SocketIO.ServerOptions | - |
110 132
 
111 133
 **Returns:** *[RPCServer](rpcserver.md)‹InterfaceT›*
112 134
 
@@ -136,12 +158,13 @@ ___
136 158
 
137 159
 ###  listen
138 160
 
139
-▸ **listen**(`port`: number): *[RPCServer](rpcserver.md)‹InterfaceT›*
161
+▸ **listen**(`port`: number, `options?`: SocketIO.ServerOptions): *[RPCServer](rpcserver.md)‹InterfaceT›*
140 162
 
141 163
 **Parameters:**
142 164
 
143 165
 Name | Type |
144 166
 ------ | ------ |
145 167
 `port` | number |
168
+`options?` | SocketIO.ServerOptions |
146 169
 
147 170
 **Returns:** *[RPCServer](rpcserver.md)‹InterfaceT›*

+ 16
- 16
classes/rpcsocket.md View File

@@ -22,9 +22,9 @@
22 22
 ### Properties
23 23
 
24 24
 * [address](rpcsocket.md#address)
25
+* [conf](rpcsocket.md#private-conf)
25 26
 * [hooks](rpcsocket.md#private-hooks)
26 27
 * [port](rpcsocket.md#port)
27
-* [protocol](rpcsocket.md#private-protocol)
28 28
 * [socket](rpcsocket.md#private-socket)
29 29
 
30 30
 ### Methods
@@ -51,7 +51,7 @@
51 51
 
52 52
 ###  constructor
53 53
 
54
-\+ **new RPCSocket**(`port`: number, `address`: string, `conf`: T.SocketConf): *[RPCSocket](rpcsocket.md)*
54
+\+ **new RPCSocket**(`port`: number, `address`: string, `conf`: T.ClientConfig): *[RPCSocket](rpcsocket.md)*
55 55
 
56 56
 **Parameters:**
57 57
 
@@ -59,7 +59,7 @@ Name | Type | Default | Description |
59 59
 ------ | ------ | ------ | ------ |
60 60
 `port` | number | - | Port to connect to |
61 61
 `address` | string | - | - |
62
-`conf` | T.SocketConf |  { tls: false } | - |
62
+`conf` | T.ClientConfig |  defaultClientConfig | - |
63 63
 
64 64
 **Returns:** *[RPCSocket](rpcsocket.md)*
65 65
 
@@ -71,6 +71,12 @@ Name | Type | Default | Description |
71 71
 
72 72
 ___
73 73
 
74
+### `Private` conf
75
+
76
+• **conf**: *T.ClientConfig*
77
+
78
+___
79
+
74 80
 ### `Private` hooks
75 81
 
76 82
 • **hooks**: *object*
@@ -85,12 +91,6 @@ ___
85 91
 
86 92
 ___
87 93
 
88
-### `Private` protocol
89
-
90
-• **protocol**: *"http" | "https"*
91
-
92
-___
93
-
94 94
 ### `Private` socket
95 95
 
96 96
 • **socket**: *[Socket](../interfaces/socket.md)*
@@ -287,7 +287,7 @@ ___
287 287
 
288 288
 ### `Static` makeSocket
289 289
 
290
-▸ **makeSocket**<**T**>(`port`: number, `server`: string, `sesame?`: undefined | string, `conf?`: T.SocketConf): *Promise‹T.ConnectedSocket‹T››*
290
+▸ **makeSocket**<**T**>(`port`: number, `server`: string, `sesame?`: undefined | string, `conf`: T.ClientConfig): *Promise‹T.ConnectedSocket‹T››*
291 291
 
292 292
 **Type parameters:**
293 293
 
@@ -295,12 +295,12 @@ ___
295 295
 
296 296
 **Parameters:**
297 297
 
298
-Name | Type |
299
------- | ------ |
300
-`port` | number |
301
-`server` | string |
302
-`sesame?` | undefined &#124; string |
303
-`conf?` | T.SocketConf |
298
+Name | Type | Default |
299
+------ | ------ | ------ |
300
+`port` | number | - |
301
+`server` | string | - |
302
+`sesame?` | undefined &#124; string | - |
303
+`conf` | T.ClientConfig |  defaultClientConfig |
304 304
 
305 305
 **Returns:** *Promise‹T.ConnectedSocket‹T››*
306 306
 

+ 56
- 15
globals.md View File

@@ -19,6 +19,7 @@
19 19
 * [BaseInfo](globals.md#baseinfo)
20 20
 * [CallInfo](globals.md#callinfo)
21 21
 * [CallRPC](globals.md#callrpc)
22
+* [ClientConfig](globals.md#clientconfig)
22 23
 * [CloseHandler](globals.md#closehandler)
23 24
 * [ConnectedSocket](globals.md#connectedsocket)
24 25
 * [ConnectionHandler](globals.md#connectionhandler)
@@ -46,7 +47,6 @@
46 47
 * [ServerConf](globals.md#serverconf)
47 48
 * [SesameConf](globals.md#sesameconf)
48 49
 * [SesameFunction](globals.md#sesamefunction)
49
-* [SocketConf](globals.md#socketconf)
50 50
 * [SuccessResponse](globals.md#successresponse)
51 51
 * [Visibility](globals.md#visibility)
52 52
 * [exportT](globals.md#exportt)
@@ -66,6 +66,11 @@
66 66
 * [rpcToRpcinfo](globals.md#const-rpctorpcinfo)
67 67
 * [stripAfterEquals](globals.md#stripafterequals)
68 68
 
69
+### Object literals
70
+
71
+* [defaultClientConfig](globals.md#const-defaultclientconfig)
72
+* [defaultConfig](globals.md#const-defaultconfig)
73
+
69 74
 ## Type aliases
70 75
 
71 76
 ###  AccessFilter
@@ -147,6 +152,12 @@ ___
147 152
 
148 153
 ___
149 154
 
155
+###  ClientConfig
156
+
157
+Ƭ **ClientConfig**: *ConnectOpts & object*
158
+
159
+___
160
+
150 161
 ###  CloseHandler
151 162
 
152 163
 Ƭ **CloseHandler**: *function*
@@ -191,13 +202,13 @@ ___
191 202
 
192 203
 #### Type declaration:
193 204
 
194
-▸ (`socket`: [Socket](interfaces/socket.md) | [PromiseIO](classes/promiseio.md), `error`: any, `rpcName`: string, `args`: any[]): *void*
205
+▸ (`socket`: [Socket](interfaces/socket.md), `error`: any, `rpcName`: string, `args`: any[]): *void*
195 206
 
196 207
 **Parameters:**
197 208
 
198 209
 Name | Type |
199 210
 ------ | ------ |
200
-`socket` | [Socket](interfaces/socket.md) &#124; [PromiseIO](classes/promiseio.md) |
211
+`socket` | [Socket](interfaces/socket.md) |
201 212
 `error` | any |
202 213
 `rpcName` | string |
203 214
 `args` | any[] |
@@ -420,16 +431,6 @@ Name | Type |
420 431
 
421 432
 ___
422 433
 
423
-###  SocketConf
424
-
425
-Ƭ **SocketConf**: *object*
426
-
427
-#### Type declaration:
428
-
429
-* **tls**: *boolean*
430
-
431
-___
432
-
433 434
 ###  SuccessResponse
434 435
 
435 436
 Ƭ **SuccessResponse**: *[Respose](globals.md#respose)‹T› & object*
@@ -603,13 +604,13 @@ ___
603 604
 
604 605
 ###  rpcHooker
605 606
 
606
-▸ **rpcHooker**(`serverSocket`: [Socket](interfaces/socket.md), `exporter`: I.RPCExporter‹any, any›, `errorHandler`: T.ErrorHandler, `sesame?`: T.SesameFunction, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
607
+▸ **rpcHooker**(`socket`: [Socket](interfaces/socket.md), `exporter`: I.RPCExporter‹any, any›, `errorHandler`: T.ErrorHandler, `sesame?`: T.SesameFunction, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
607 608
 
608 609
 **Parameters:**
609 610
 
610 611
 Name | Type | Default | Description |
611 612
 ------ | ------ | ------ | ------ |
612
-`serverSocket` | [Socket](interfaces/socket.md) | - | The websocket (implementation: socket.io) to hook on |
613
+`socket` | [Socket](interfaces/socket.md) | - | The websocket (implementation: socket.io) to hook on |
613 614
 `exporter` | I.RPCExporter‹any, any› | - | The exporter |
614 615
 `errorHandler` | T.ErrorHandler | - | - |
615 616
 `sesame?` | T.SesameFunction | - | - |
@@ -648,3 +649,43 @@ Name | Type | Description |
648 649
 `str` | string | The parameter to modify  |
649 650
 
650 651
 **Returns:** *string*
652
+
653
+## Object literals
654
+
655
+### `Const` defaultClientConfig
656
+
657
+### ▪ **defaultClientConfig**: *object*
658
+
659
+###  protocol
660
+
661
+• **protocol**: *"http"* = "http"
662
+
663
+###  reconnection
664
+
665
+• **reconnection**: *false* = false
666
+
667
+###  reconnectionAttempts
668
+
669
+• **reconnectionAttempts**: *number* = 2
670
+
671
+###  reconnectionDelay
672
+
673
+• **reconnectionDelay**: *number* = 200
674
+
675
+###  timeout
676
+
677
+• **timeout**: *number* = 450
678
+
679
+___
680
+
681
+### `Const` defaultConfig
682
+
683
+### ▪ **defaultConfig**: *object*
684
+
685
+###  cookie
686
+
687
+• **cookie**: *false* = false
688
+
689
+###  path
690
+
691
+• **path**: *string* = "/socket.io"

Loading…
Cancel
Save