@hocuspocus/extension-throttle 2.3.1 → 2.4.0-rc.1

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.
@@ -21,8 +21,13 @@ export interface CompleteHocuspocusProviderConfiguration {
21
21
  broadcast: boolean;
22
22
  /**
23
23
  * An Awareness instance to keep the presence state of all clients.
24
+ *
25
+ * You can disable sharing awareness information by passing `null`.
26
+ * Note that having no awareness information shared across all connections will break our ping checks
27
+ * and thus trigger reconnects. You should always have at least one Provider with enabled awareness per
28
+ * socket connection, or ensure that the Provider receives messages before running into `HocuspocusProviderWebsocket.messageReconnectTimeout`.
24
29
  */
25
- awareness: Awareness;
30
+ awareness: Awareness | null;
26
31
  /**
27
32
  * A token that’s sent to the backend for authentication purposes.
28
33
  */
@@ -68,6 +73,9 @@ export interface CompleteHocuspocusProviderConfiguration {
68
73
  */
69
74
  preserveConnection: boolean;
70
75
  }
76
+ export declare class AwarenessError extends Error {
77
+ code: number;
78
+ }
71
79
  export declare class HocuspocusProvider extends EventEmitter {
72
80
  configuration: CompleteHocuspocusProviderConfiguration;
73
81
  subscribedToBroadcastChannel: boolean;
@@ -94,7 +102,7 @@ export declare class HocuspocusProvider extends EventEmitter {
94
102
  onStatus({ status }: onStatusParameters): void;
95
103
  setConfiguration(configuration?: Partial<HocuspocusProviderConfiguration>): void;
96
104
  get document(): Y.Doc;
97
- get awareness(): Awareness;
105
+ get awareness(): Awareness | null;
98
106
  get hasUnsyncedChanges(): boolean;
99
107
  incrementUnsyncedChanges(): void;
100
108
  decrementUnsyncedChanges(): void;
@@ -24,7 +24,7 @@ export declare class Document extends Doc {
24
24
  */
25
25
  constructor(name: string, logger: Debugger, yDocOptions: {});
26
26
  /**
27
- * Check if the Document is empty
27
+ * Check if the Document (XMLFragment or Map) is empty
28
28
  */
29
29
  isEmpty(fieldName: string): boolean;
30
30
  /**
@@ -7,10 +7,13 @@ export declare class IncomingMessage {
7
7
  */
8
8
  decoder: Decoder;
9
9
  /**
10
- * Access to the reply.
10
+ * Private encoder; can be undefined.
11
+ *
12
+ * Lazy creation of the encoder speeds up IncomingMessages that need only a decoder.
11
13
  */
12
- encoder: Encoder;
14
+ private encoderInternal?;
13
15
  constructor(input: any);
16
+ get encoder(): Encoder;
14
17
  readVarUint8Array(): Uint8Array;
15
18
  readVarUint(): number;
16
19
  readVarString(): string;
@@ -31,6 +31,7 @@ export interface ConnectionConfiguration {
31
31
  }
32
32
  export interface Extension {
33
33
  priority?: number;
34
+ extensionName?: string;
34
35
  onConfigure?(data: onConfigurePayload): Promise<any>;
35
36
  onListen?(data: onListenPayload): Promise<any>;
36
37
  onUpgrade?(data: onUpgradePayload): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-throttle",
3
- "version": "2.3.1",
3
+ "version": "2.4.0-rc.1",
4
4
  "description": "hocuspocus throttle extension",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@hocuspocus/server": "^2.3.1"
31
+ "@hocuspocus/server": "^2.4.0-rc.1"
32
32
  },
33
33
  "gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
34
34
  }