@hocuspocus/extension-database
Advanced tools
Comparing version 1.0.0-alpha.20 to 1.0.0-alpha.21
@@ -30,2 +30,6 @@ /// <reference types="node" /> | ||
/** | ||
* Set a callback that will be triggered before an message is handled | ||
*/ | ||
beforeHandleMessage(callback: (payload: Document, update: Uint8Array) => Promise<any>): Connection; | ||
/** | ||
* Send the given message | ||
@@ -32,0 +36,0 @@ */ |
@@ -39,2 +39,3 @@ /// <reference types="node" /> | ||
afterLoadDocument?(data: onLoadDocumentPayload): Promise<any>; | ||
beforeHandleMessage?(data: beforeHandleMessagePayload): Promise<any>; | ||
onChange?(data: onChangePayload): Promise<any>; | ||
@@ -52,3 +53,3 @@ onStoreDocument?(data: onStoreDocumentPayload): Promise<any>; | ||
*/ | ||
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy'; | ||
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy'; | ||
export declare type HookPayload = onConfigurePayload | onListenPayload | onUpgradePayload | onConnectPayload | connectedPayload | onAuthenticatePayload | onLoadDocumentPayload | onChangePayload | onStoreDocumentPayload | afterStoreDocumentPayload | onAwarenessUpdatePayload | onRequestPayload | onDisconnectPayload | onDestroyPayload; | ||
@@ -160,2 +161,13 @@ export interface Configuration extends Extension { | ||
} | ||
export interface beforeHandleMessagePayload { | ||
clientsCount: number; | ||
context: any; | ||
document: Document; | ||
documentName: string; | ||
instance: Hocuspocus; | ||
requestHeaders: IncomingHttpHeaders; | ||
requestParameters: URLSearchParams; | ||
update: Uint8Array; | ||
socketId: string; | ||
} | ||
export interface onStoreDocumentPayload { | ||
@@ -162,0 +174,0 @@ clientsCount: number; |
{ | ||
"name": "@hocuspocus/extension-database", | ||
"description": "a generic Hocuspocus persistence driver for the database", | ||
"version": "1.0.0-alpha.20", | ||
"version": "1.0.0-alpha.21", | ||
"homepage": "https://hocuspocus.dev", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hocuspocus/server": "^1.0.0-alpha.106", | ||
"@hocuspocus/server": "^1.0.0-alpha.107", | ||
"yjs": "^13.5.29" | ||
@@ -36,3 +36,3 @@ }, | ||
}, | ||
"gitHead": "6074a6cb832b40bc579f28db2823ba5723887312" | ||
"gitHead": "3dc62aedd8d19d4a9c346188885657ea814271c0" | ||
} |
65633
120
1721