@hocuspocus/extension-database 1.0.0-alpha.16 → 1.0.0-alpha.17
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.
- package/dist/packages/extension-redis/src/Redis.d.ts +5 -1
- package/dist/packages/provider/src/HocuspocusProvider.d.ts +4 -0
- package/dist/packages/server/src/Document.d.ts +1 -1
- package/dist/packages/server/src/Hocuspocus.d.ts +4 -0
- package/dist/packages/server/src/MessageReceiver.d.ts +1 -1
- package/dist/packages/server/src/OutgoingMessage.d.ts +1 -0
- package/dist/packages/server/src/types.d.ts +9 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RedisClient from 'ioredis';
|
|
2
2
|
import Redlock from 'redlock';
|
|
3
|
-
import { Document, Extension, afterLoadDocumentPayload, afterStoreDocumentPayload, onDisconnectPayload, onStoreDocumentPayload, onAwarenessUpdatePayload, Debugger, onConfigurePayload, onListenPayload } from '@hocuspocus/server';
|
|
3
|
+
import { Document, Extension, afterLoadDocumentPayload, afterStoreDocumentPayload, onDisconnectPayload, onStoreDocumentPayload, onAwarenessUpdatePayload, onChangePayload, Debugger, onConfigurePayload, onListenPayload } from '@hocuspocus/server';
|
|
4
4
|
export interface Configuration {
|
|
5
5
|
/**
|
|
6
6
|
* Redis port
|
|
@@ -82,6 +82,10 @@ export declare class Redis implements Extension {
|
|
|
82
82
|
* in Redis to filter these.
|
|
83
83
|
*/
|
|
84
84
|
private handleIncomingMessage;
|
|
85
|
+
/**
|
|
86
|
+
* if the ydoc changed, we'll need to inform other Hocuspocus servers about it.
|
|
87
|
+
*/
|
|
88
|
+
onChange(data: onChangePayload): Promise<any>;
|
|
85
89
|
/**
|
|
86
90
|
* Make sure to *not* listen for further changes, when there’s
|
|
87
91
|
* noone connected anymore.
|
|
@@ -120,6 +120,7 @@ export declare class HocuspocusProvider extends EventEmitter {
|
|
|
120
120
|
} | null;
|
|
121
121
|
constructor(configuration: HocuspocusProviderConfiguration);
|
|
122
122
|
setConfiguration(configuration?: Partial<HocuspocusProviderConfiguration>): void;
|
|
123
|
+
boundConnect: () => Promise<void>;
|
|
123
124
|
connect(): Promise<void>;
|
|
124
125
|
createWebSocketConnection(): Promise<unknown>;
|
|
125
126
|
resolveConnectionAttempt(): void;
|
|
@@ -129,6 +130,8 @@ export declare class HocuspocusProvider extends EventEmitter {
|
|
|
129
130
|
get awareness(): Awareness;
|
|
130
131
|
checkConnection(): void;
|
|
131
132
|
forceSync(): void;
|
|
133
|
+
boundBeforeUnload: () => void;
|
|
134
|
+
beforeUnload(): void;
|
|
132
135
|
registerEventListeners(): void;
|
|
133
136
|
documentUpdateHandler(update: Uint8Array, origin: any): void;
|
|
134
137
|
awarenessUpdateHandler({ added, updated, removed }: any, origin: any): void;
|
|
@@ -148,6 +151,7 @@ export declare class HocuspocusProvider extends EventEmitter {
|
|
|
148
151
|
onClose(event: CloseEvent): void;
|
|
149
152
|
destroy(): void;
|
|
150
153
|
get broadcastChannel(): string;
|
|
154
|
+
boundBroadcastChannelSubscriber: (data: ArrayBuffer) => void;
|
|
151
155
|
broadcastChannelSubscriber(data: ArrayBuffer): void;
|
|
152
156
|
subscribeToBroadcastChannel(): void;
|
|
153
157
|
disconnectBroadcastChannel(): void;
|
|
@@ -8,6 +8,6 @@ export declare class MessageReceiver {
|
|
|
8
8
|
logger: Debugger;
|
|
9
9
|
constructor(message: IncomingMessage, logger: Debugger);
|
|
10
10
|
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void;
|
|
11
|
-
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 | 2 | 1;
|
|
11
|
+
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void, requestFirstSync?: boolean): 0 | 2 | 1;
|
|
12
12
|
applyQueryAwarenessMessage(awareness: Awareness, reply?: (message: Uint8Array) => void): void;
|
|
13
13
|
}
|
|
@@ -7,6 +7,7 @@ export declare class OutgoingMessage {
|
|
|
7
7
|
category?: string;
|
|
8
8
|
constructor();
|
|
9
9
|
createSyncMessage(): OutgoingMessage;
|
|
10
|
+
createSyncReplyMessage(): OutgoingMessage;
|
|
10
11
|
createAwarenessUpdateMessage(awareness: Awareness, changedClients?: Array<any>): OutgoingMessage;
|
|
11
12
|
writeQueryAwareness(): OutgoingMessage;
|
|
12
13
|
writeAuthenticated(): OutgoingMessage;
|
|
@@ -9,7 +9,8 @@ export declare enum MessageType {
|
|
|
9
9
|
Sync = 0,
|
|
10
10
|
Awareness = 1,
|
|
11
11
|
Auth = 2,
|
|
12
|
-
QueryAwareness = 3
|
|
12
|
+
QueryAwareness = 3,
|
|
13
|
+
SyncReply = 4
|
|
13
14
|
}
|
|
14
15
|
export interface AwarenessUpdate {
|
|
15
16
|
added: Array<any>;
|
|
@@ -79,6 +80,13 @@ export interface Configuration extends Extension {
|
|
|
79
80
|
* By default, the servers show a start screen. If passed false, the server will start quietly.
|
|
80
81
|
*/
|
|
81
82
|
quiet: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* options to pass to the ydoc document
|
|
85
|
+
*/
|
|
86
|
+
yDocOptions: {
|
|
87
|
+
gc: boolean;
|
|
88
|
+
gcFilter: () => boolean;
|
|
89
|
+
};
|
|
82
90
|
/**
|
|
83
91
|
* Function which returns the (customized) document name based on the request
|
|
84
92
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-database",
|
|
3
3
|
"description": "a generic Hocuspocus persistence driver for the database",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.17",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"hocuspocus",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@hocuspocus/server": "^1.0.0-alpha.
|
|
29
|
+
"@hocuspocus/server": "^1.0.0-alpha.103",
|
|
30
30
|
"yjs": "^13.5.29"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "af278e7c5d91c74afefd9234379c8179c8b91e6d"
|
|
36
36
|
}
|