@hocuspocus/extension-sqlite 2.9.2-rc.0 → 2.11.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.
@@ -121,7 +121,7 @@ export declare class HocuspocusProvider extends EventEmitter {
121
121
  set synced(state: boolean);
122
122
  receiveStateless(payload: string): void;
123
123
  get isAuthenticationRequired(): boolean;
124
- connect(): Promise<unknown>;
124
+ connect(): Promise<any>;
125
125
  disconnect(): void;
126
126
  onOpen(event: Event): Promise<void>;
127
127
  getToken(): Promise<string | null>;
@@ -102,7 +102,7 @@ export declare class HocuspocusProviderWebsocket extends EventEmitter {
102
102
  receivedOnStatusPayload?: onStatusParameters | undefined;
103
103
  onOpen(event: Event): Promise<void>;
104
104
  onStatus(data: onStatusParameters): Promise<void>;
105
- attach(provider: HocuspocusProvider): void;
105
+ attach(provider: HocuspocusProvider): Promise<any> | undefined;
106
106
  detach(provider: HocuspocusProvider): void;
107
107
  setConfiguration(configuration?: Partial<HocuspocusProviderWebsocketConfiguration>): void;
108
108
  cancelWebsocketRetry?: () => void;
@@ -45,13 +45,13 @@ export declare class TiptapCollabProvider extends HocuspocusProvider {
45
45
  private getThreadIndex;
46
46
  getThread<Data, CommentData>(id: string): TCollabThread<Data, CommentData> | null;
47
47
  private getYThread;
48
- createThread(data: TCollabThread): TCollabThread | null;
49
- updateThread(id: TCollabThread['id'], data: Pick<TCollabThread, 'data'>): TCollabThread | null;
48
+ createThread(data: Omit<TCollabThread, 'id' | 'createdAt' | 'updatedAt' | 'comments'>): TCollabThread | null;
49
+ updateThread(id: TCollabThread['id'], data: Partial<Pick<TCollabThread, 'data' | 'resolvedAt'>>): TCollabThread | null;
50
50
  deleteThread(id: TCollabThread['id']): void;
51
51
  getThreadComments(threadId: TCollabThread['id']): TCollabComment[] | null;
52
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;
53
+ addComment(threadId: TCollabThread['id'], data: Omit<TCollabComment, 'id' | 'updatedAt' | 'createdAt'>): TCollabThread | null;
54
+ updateComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], data: Partial<Pick<TCollabComment, 'data' | 'content'>>): TCollabThread | null;
55
55
  deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabThread | null;
56
56
  watchThreads(callback: () => void): void;
57
57
  unwatchThreads(callback: () => void): void;
@@ -88,6 +88,7 @@ export type TCollabThread<Data = any, CommentData = any> = {
88
88
  id: string;
89
89
  createdAt: number;
90
90
  updatedAt: number;
91
+ resolvedAt?: string;
91
92
  comments: TCollabComment<CommentData>[];
92
93
  data: Data;
93
94
  };
@@ -87,7 +87,7 @@ export declare class Document extends Doc {
87
87
  /**
88
88
  * Broadcast stateless message to all connections
89
89
  */
90
- broadcastStateless(payload: string): void;
90
+ broadcastStateless(payload: string, filter?: (conn: Connection) => boolean): void;
91
91
  destroy(): void;
92
92
  }
93
93
  export default Document;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-sqlite",
3
3
  "description": "a generic Hocuspocus persistence driver for the sqlite",
4
- "version": "2.9.2-rc.0",
4
+ "version": "2.11.0",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
7
7
  "hocuspocus",
@@ -27,7 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@hocuspocus/extension-database": "^2.9.2-rc.0",
30
+ "@hocuspocus/extension-database": "^2.11.0",
31
31
  "kleur": "^4.1.4",
32
32
  "sqlite3": "^5.0.11"
33
33
  },