@hocuspocus/common 2.9.1-rc.0 → 2.9.2-rc.0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AbstractType, YArrayEvent } from 'yjs';
|
|
2
2
|
import { HocuspocusProvider, HocuspocusProviderConfiguration } from './HocuspocusProvider.js';
|
|
3
3
|
import { TiptapCollabProviderWebsocket } from './TiptapCollabProviderWebsocket.js';
|
|
4
|
-
import type { THistoryVersion } from './types.js';
|
|
4
|
+
import type { TCollabComment, TCollabThread, THistoryVersion } from './types.js';
|
|
5
5
|
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'baseUrl'>>);
|
|
6
6
|
export interface AdditionalTiptapCollabProviderConfiguration {
|
|
7
7
|
/**
|
|
@@ -40,4 +40,19 @@ export declare class TiptapCollabProvider extends HocuspocusProvider {
|
|
|
40
40
|
isAutoVersioning(): boolean;
|
|
41
41
|
enableAutoVersioning(): 1;
|
|
42
42
|
disableAutoVersioning(): 0;
|
|
43
|
+
private getYThreads;
|
|
44
|
+
getThreads<Data, CommentData>(): TCollabThread<Data, CommentData>[];
|
|
45
|
+
private getThreadIndex;
|
|
46
|
+
getThread<Data, CommentData>(id: string): TCollabThread<Data, CommentData> | null;
|
|
47
|
+
private getYThread;
|
|
48
|
+
createThread(data: TCollabThread): TCollabThread | null;
|
|
49
|
+
updateThread(id: TCollabThread['id'], data: Pick<TCollabThread, 'data'>): TCollabThread | null;
|
|
50
|
+
deleteThread(id: TCollabThread['id']): void;
|
|
51
|
+
getThreadComments(threadId: TCollabThread['id']): TCollabComment[] | null;
|
|
52
|
+
getThreadComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabComment | null;
|
|
53
|
+
addComment(threadId: TCollabThread['id'], data: TCollabComment): TCollabThread | null;
|
|
54
|
+
updateComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], data: TCollabComment): TCollabThread | null;
|
|
55
|
+
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabThread | null;
|
|
56
|
+
watchThreads(callback: () => void): void;
|
|
57
|
+
unwatchThreads(callback: () => void): void;
|
|
43
58
|
}
|
|
@@ -84,6 +84,20 @@ export type StatesArray = {
|
|
|
84
84
|
clientId: number;
|
|
85
85
|
[key: string | number]: any;
|
|
86
86
|
}[];
|
|
87
|
+
export type TCollabThread<Data = any, CommentData = any> = {
|
|
88
|
+
id: string;
|
|
89
|
+
createdAt: number;
|
|
90
|
+
updatedAt: number;
|
|
91
|
+
comments: TCollabComment<CommentData>[];
|
|
92
|
+
data: Data;
|
|
93
|
+
};
|
|
94
|
+
export type TCollabComment<Data = any> = {
|
|
95
|
+
id: string;
|
|
96
|
+
createdAt: number;
|
|
97
|
+
updatedAt: number;
|
|
98
|
+
data: Data;
|
|
99
|
+
content: any;
|
|
100
|
+
};
|
|
87
101
|
export type THistoryVersion = {
|
|
88
102
|
name?: string;
|
|
89
103
|
version: number;
|
|
@@ -8,6 +8,6 @@ export declare class MessageReceiver {
|
|
|
8
8
|
defaultTransactionOrigin?: string;
|
|
9
9
|
constructor(message: IncomingMessage, logger: Debugger, defaultTransactionOrigin?: string);
|
|
10
10
|
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void;
|
|
11
|
-
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void, requestFirstSync?: boolean): 0 |
|
|
11
|
+
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void, requestFirstSync?: boolean): 0 | 1 | 2;
|
|
12
12
|
applyQueryAwarenessMessage(document: Document, reply?: (message: Uint8Array) => void): void;
|
|
13
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vite").
|
|
1
|
+
declare const _default: import("vite").UserConfig;
|
|
2
2
|
export default _default;
|