@hocuspocus/extension-redis 2.15.1-rc.0 → 2.15.2

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.
@@ -147,7 +147,7 @@ export declare class TiptapCollabProvider extends HocuspocusProvider {
147
147
  * @param options A set of options that control how the comment is deleted
148
148
  * @returns The updated thread or null if the thread or comment is not found
149
149
  */
150
- deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], options: DeleteCommentOptions): TCollabThread | null | undefined;
150
+ deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], options?: DeleteCommentOptions): TCollabThread | null | undefined;
151
151
  /**
152
152
  * Start watching threads for changes
153
153
  * @param callback The callback function to be called when a thread changes
@@ -50,10 +50,11 @@ export interface Extension {
50
50
  onAwarenessUpdate?(data: onAwarenessUpdatePayload): Promise<any>;
51
51
  onRequest?(data: onRequestPayload): Promise<any>;
52
52
  onDisconnect?(data: onDisconnectPayload): Promise<any>;
53
+ beforeUnloadDocument?(data: beforeUnloadDocumentPayload): Promise<any>;
53
54
  afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>;
54
55
  onDestroy?(data: onDestroyPayload): Promise<any>;
55
56
  }
56
- export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
57
+ export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'beforeUnloadDocument' | 'afterUnloadDocument' | 'onDestroy';
57
58
  export type HookPayloadByName = {
58
59
  onConfigure: onConfigurePayload;
59
60
  onListen: onListenPayload;
@@ -74,6 +75,7 @@ export type HookPayloadByName = {
74
75
  onRequest: onRequestPayload;
75
76
  onDisconnect: onDisconnectPayload;
76
77
  afterUnloadDocument: afterUnloadDocumentPayload;
78
+ beforeUnloadDocument: beforeUnloadDocumentPayload;
77
79
  onDestroy: onDestroyPayload;
78
80
  };
79
81
  export interface Configuration extends Extension {
@@ -310,6 +312,10 @@ export interface afterUnloadDocumentPayload {
310
312
  instance: Hocuspocus;
311
313
  documentName: string;
312
314
  }
315
+ export interface beforeUnloadDocumentPayload {
316
+ instance: Hocuspocus;
317
+ documentName: string;
318
+ }
313
319
  export interface DirectConnection {
314
320
  transact(transaction: (document: Document) => void): Promise<void>;
315
321
  disconnect(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-redis",
3
- "version": "2.15.1-rc.0",
3
+ "version": "2.15.2",
4
4
  "description": "Scale Hocuspocus horizontally with Redis",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -33,7 +33,7 @@
33
33
  "@types/redlock": "^4.0.3"
34
34
  },
35
35
  "dependencies": {
36
- "@hocuspocus/server": "^2.15.1-rc.0",
36
+ "@hocuspocus/server": "^2.15.2",
37
37
  "ioredis": "^4.28.2",
38
38
  "kleur": "^4.1.4",
39
39
  "lodash.debounce": "^4.0.8",