iosignal 9.19.0 → 9.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +22 -2
- package/README.md +33 -2
- package/dist/browser/esm/broker.js +24 -0
- package/dist/browser/esm/broker.js.map +1 -0
- package/dist/browser/esm/io.d.ts +28 -0
- package/dist/browser/esm/io.js +4 -4
- package/dist/browser/esm/io.js.map +1 -1
- package/dist/browser/iife/io.js +4 -4
- package/dist/browser/iife/io.js.map +1 -1
- package/dist/node/iosignal.cjs +400 -141
- package/dist/node/iosignal.d.cts +45 -6
- package/dist/node/iosignal.d.ts +45 -6
- package/dist/node/iosignal.js +400 -142
- package/dist/types/client/IOCore.d.ts +14 -0
- package/dist/types/client/browser/IOWebSocket.d.ts +14 -0
- package/dist/types/common/constants.d.ts +8 -0
- package/package.json +4 -1
package/dist/browser/esm/io.d.ts
CHANGED
|
@@ -69,6 +69,16 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
69
69
|
* @type {number}
|
|
70
70
|
*/
|
|
71
71
|
lastTxRxTime: number;
|
|
72
|
+
/**
|
|
73
|
+
* Last time anything was received from the server (see keepAlive()).
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
lastRxTime: number;
|
|
77
|
+
/** @private Time of a PING that has had no answer yet; 0 when none is pending. */
|
|
78
|
+
private _pingSentAt;
|
|
79
|
+
/** @private Connections closed since the last ready, and the earliest time of the next automatic attempt. */
|
|
80
|
+
private _reconnectAttempts;
|
|
81
|
+
_nextConnectAt: number;
|
|
72
82
|
/**
|
|
73
83
|
* Period for connection checker.
|
|
74
84
|
* @type {number}
|
|
@@ -188,6 +198,10 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
188
198
|
* is implemented keepConnection() in the child classes (IOWS, IOCongSocket, etc.).
|
|
189
199
|
*/
|
|
190
200
|
keepAlive(): void;
|
|
201
|
+
/** @private When keepAlive() may connect again after this close: see SIZE_LIMIT.RECONNECT_*. */
|
|
202
|
+
private scheduleReconnect;
|
|
203
|
+
/** @private True from the socket opening until it closes (any state a server message can arrive in). */
|
|
204
|
+
private isLinkUp;
|
|
191
205
|
/**
|
|
192
206
|
* Redirects the connection to a new URL.
|
|
193
207
|
* @param {string} url2 - The new URL to redirect to.
|
|
@@ -486,6 +500,13 @@ declare class IO extends IOCore {
|
|
|
486
500
|
* @type {object}
|
|
487
501
|
*/
|
|
488
502
|
static constants: object;
|
|
503
|
+
/**
|
|
504
|
+
* The WebSocket class to connect with; null uses the global WebSocket. Set it on IO or on a
|
|
505
|
+
* subclass to connect through something with the browser WebSocket API (readyState,
|
|
506
|
+
* binaryType, onopen/onmessage/onerror/onclose, send, close), e.g. a test double.
|
|
507
|
+
* @type {(new (url: string) => WebSocket) | null}
|
|
508
|
+
*/
|
|
509
|
+
static WebSocket: (new (url: string) => WebSocket) | null;
|
|
489
510
|
/**
|
|
490
511
|
* Tracks the number of IO instances created.
|
|
491
512
|
* @type {number}
|
|
@@ -505,6 +526,13 @@ declare class IO extends IOCore {
|
|
|
505
526
|
* Keeps the connection alive by re-connecting if closed.
|
|
506
527
|
*/
|
|
507
528
|
keepConnection(): void;
|
|
529
|
+
/**
|
|
530
|
+
* Makes the socket for a connection: new IO.WebSocket(url) (the class set on this client's
|
|
531
|
+
* class), else the global WebSocket. Override it to choose the socket by URL.
|
|
532
|
+
* @param {string} url - The URL to connect to.
|
|
533
|
+
* @returns {WebSocket}
|
|
534
|
+
*/
|
|
535
|
+
createWebSocket(url: string): WebSocket;
|
|
508
536
|
/**
|
|
509
537
|
* Creates a new WebSocket connection.
|
|
510
538
|
* @param {string} url - The WebSocket URL to connect to.
|