@hocuspocus/server
Advanced tools
Comparing version 2.15.1 to 2.15.2
@@ -150,3 +150,3 @@ import type { AbstractType, YArrayEvent } from 'yjs'; | ||
*/ | ||
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], options: DeleteCommentOptions): TCollabThread | null | undefined; | ||
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], options?: DeleteCommentOptions): TCollabThread | null | undefined; | ||
/** | ||
@@ -153,0 +153,0 @@ * Start watching threads for changes |
@@ -53,6 +53,7 @@ /// <reference types="node" /> | ||
onDisconnect?(data: onDisconnectPayload): Promise<any>; | ||
beforeUnloadDocument?(data: beforeUnloadDocumentPayload): Promise<any>; | ||
afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>; | ||
onDestroy?(data: onDestroyPayload): Promise<any>; | ||
} | ||
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy'; | ||
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'beforeUnloadDocument' | 'afterUnloadDocument' | 'onDestroy'; | ||
export type HookPayloadByName = { | ||
@@ -78,2 +79,3 @@ onConfigure: onConfigurePayload; | ||
afterUnloadDocument: afterUnloadDocumentPayload; | ||
beforeUnloadDocument: beforeUnloadDocumentPayload; | ||
onDestroy: onDestroyPayload; | ||
@@ -315,2 +317,6 @@ }; | ||
} | ||
export interface beforeUnloadDocumentPayload { | ||
instance: Hocuspocus; | ||
documentName: string; | ||
} | ||
export interface DirectConnection { | ||
@@ -317,0 +323,0 @@ transact(transaction: (document: Document) => void): Promise<void>; |
{ | ||
"name": "@hocuspocus/server", | ||
"description": "plug & play collaboration backend", | ||
"version": "2.15.1", | ||
"version": "2.15.2", | ||
"homepage": "https://hocuspocus.dev", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hocuspocus/common": "^2.15.1", | ||
"@hocuspocus/common": "^2.15.2", | ||
"async-lock": "^1.3.1", | ||
@@ -35,0 +35,0 @@ "kleur": "^4.1.4", |
@@ -596,2 +596,4 @@ import { IncomingMessage } from 'http' | ||
await this.hooks('beforeUnloadDocument', { instance: this, documentName }) | ||
this.documents.delete(documentName) | ||
@@ -598,0 +600,0 @@ document.destroy() |
@@ -56,2 +56,3 @@ import { | ||
onDisconnect?(data: onDisconnectPayload): Promise<any>; | ||
beforeUnloadDocument?(data: beforeUnloadDocumentPayload): Promise<any>; | ||
afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>; | ||
@@ -80,2 +81,3 @@ onDestroy?(data: onDestroyPayload): Promise<any>; | ||
'onDisconnect' | | ||
'beforeUnloadDocument' | | ||
'afterUnloadDocument' | | ||
@@ -104,2 +106,3 @@ 'onDestroy' | ||
afterUnloadDocument: afterUnloadDocumentPayload, | ||
beforeUnloadDocument: beforeUnloadDocumentPayload, | ||
onDestroy: onDestroyPayload, | ||
@@ -378,2 +381,7 @@ } | ||
export interface beforeUnloadDocumentPayload { | ||
instance: Hocuspocus; | ||
documentName: string; | ||
} | ||
export interface DirectConnection { | ||
@@ -380,0 +388,0 @@ transact(transaction: (document: Document) => void): Promise<void>, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
833727
9898
Updated@hocuspocus/common@^2.15.2