@hocuspocus/provider 3.1.9 → 3.1.11

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.
@@ -52,6 +52,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
52
52
  * A timeout in milliseconds. If timeout is non-zero then a timer is set using setTimeout. If the timeout is triggered then future attempts will be aborted.
53
53
  */
54
54
  timeout: number;
55
+ handleTimeout: (() => Promise<unknown>) | null;
55
56
  onOpen: (data: onOpenParameters) => void;
56
57
  onConnect: () => void;
57
58
  onMessage: (data: onMessageParameters) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/provider",
3
- "version": "3.1.9",
3
+ "version": "3.1.11",
4
4
  "description": "hocuspocus provider",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@hocuspocus/common": "^3.1.9",
32
+ "@hocuspocus/common": "^3.1.11",
33
33
  "@lifeomic/attempt": "^3.0.2",
34
34
  "lib0": "^0.2.87",
35
35
  "ws": "^8.17.1"
@@ -72,6 +72,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
72
72
  * A timeout in milliseconds. If timeout is non-zero then a timer is set using setTimeout. If the timeout is triggered then future attempts will be aborted.
73
73
  */
74
74
  timeout: number;
75
+ handleTimeout: (() => Promise<unknown>) | null;
75
76
  onOpen: (data: onOpenParameters) => void;
76
77
  onConnect: () => void;
77
78
  onMessage: (data: onMessageParameters) => void;
@@ -125,6 +126,7 @@ export class HocuspocusProviderWebsocket extends EventEmitter {
125
126
  onDestroy: () => null,
126
127
  onAwarenessUpdate: () => null,
127
128
  onAwarenessChange: () => null,
129
+ handleTimeout: null,
128
130
  providerMap: new Map(),
129
131
  };
130
132
 
@@ -249,6 +251,7 @@ export class HocuspocusProviderWebsocket extends EventEmitter {
249
251
  maxDelay: this.configuration.maxDelay,
250
252
  jitter: this.configuration.jitter,
251
253
  timeout: this.configuration.timeout,
254
+ handleTimeout: this.configuration.handleTimeout,
252
255
  beforeAttempt: (context) => {
253
256
  if (!this.shouldConnect || cancelAttempt) {
254
257
  context.abort();