@hocuspocus/extension-throttle 1.0.0-alpha.59 → 1.0.0-alpha.62

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.
@@ -75,7 +75,7 @@ export declare class Redis implements Extension {
75
75
  /**
76
76
  * Handle awareness update messages received directly by this Hocuspocus instance.
77
77
  */
78
- onAwarenessUpdate({ documentName, awareness }: onAwarenessUpdatePayload): Promise<number>;
78
+ onAwarenessUpdate({ documentName, awareness, added, updated, removed, }: onAwarenessUpdatePayload): Promise<number>;
79
79
  /**
80
80
  * Handle incoming messages published on all subscribed document channels.
81
81
  * Note that this will also include messages from ourselves as it is not possible
@@ -110,6 +110,7 @@ export declare class HocuspocusProvider extends EventEmitter {
110
110
  shouldConnect: boolean;
111
111
  status: WebSocketStatus;
112
112
  isSynced: boolean;
113
+ unsyncedChanges: number;
113
114
  isAuthenticated: boolean;
114
115
  lastMessageReceived: number;
115
116
  mux: mutex.mutex;
@@ -128,6 +129,7 @@ export declare class HocuspocusProvider extends EventEmitter {
128
129
  rejectConnectionAttempt(): void;
129
130
  get document(): Y.Doc;
130
131
  get awareness(): Awareness;
132
+ get hasUnsyncedChanges(): boolean;
131
133
  checkConnection(): void;
132
134
  forceSync(): void;
133
135
  boundBeforeUnload: () => void;
@@ -49,6 +49,13 @@ export declare class Connection {
49
49
  * @private
50
50
  */
51
51
  private handleMessage;
52
+ /**
53
+ * Handle a ws instance error, which is required to prevent
54
+ * the server from crashing when one happens
55
+ * See https://github.com/websockets/ws/issues/1777#issuecomment-660803472
56
+ * @private
57
+ */
58
+ private handleError;
52
59
  /**
53
60
  * Get the underlying connection instance
54
61
  * @deprecated
@@ -16,6 +16,7 @@ export declare class Document extends Doc {
16
16
  name: string;
17
17
  mux: mutex;
18
18
  logger: Debugger;
19
+ isLoading: boolean;
19
20
  /**
20
21
  * Constructor.
21
22
  */
@@ -0,0 +1,2 @@
1
+ import { ExecutionContext } from 'ava';
2
+ export declare const retryableAssertion: (t: ExecutionContext, recoverableTry: (tt: ExecutionContext) => void) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-throttle",
3
- "version": "1.0.0-alpha.59",
3
+ "version": "1.0.0-alpha.62",
4
4
  "description": "hocuspocus throttle extension",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@hocuspocus/server": "^1.0.0-alpha.103"
30
+ "@hocuspocus/server": "^1.0.0-alpha.106"
31
31
  },
32
- "gitHead": "af278e7c5d91c74afefd9234379c8179c8b91e6d"
32
+ "gitHead": "6074a6cb832b40bc579f28db2823ba5723887312"
33
33
  }
@@ -1,22 +0,0 @@
1
- import { Extension, onLoadDocumentPayload } from '@hocuspocus/server';
2
- import { LeveldbPersistence } from 'y-leveldb';
3
- export interface Configuration {
4
- options: object | undefined;
5
- path: string;
6
- }
7
- export declare class RocksDB implements Extension {
8
- configuration: Configuration;
9
- provider: LeveldbPersistence;
10
- /**
11
- * Constructor
12
- */
13
- constructor(configuration?: Partial<Configuration>);
14
- /**
15
- * onLoadDocument hook
16
- */
17
- onLoadDocument(data: onLoadDocumentPayload): Promise<any>;
18
- /**
19
- * store updates in y-leveldb persistence
20
- */
21
- store(documentName: string, update: Uint8Array): Promise<any>;
22
- }