@hocuspocus/extension-database
Advanced tools
Comparing version 2.9.1-rc.0 to 2.9.2-rc.0
import type { AbstractType, YArrayEvent } from 'yjs'; | ||
import { HocuspocusProvider, HocuspocusProviderConfiguration } from './HocuspocusProvider.js'; | ||
import { TiptapCollabProviderWebsocket } from './TiptapCollabProviderWebsocket.js'; | ||
import type { THistoryVersion } from './types.js'; | ||
import type { TCollabComment, TCollabThread, THistoryVersion } from './types.js'; | ||
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'baseUrl'>>); | ||
@@ -43,2 +43,17 @@ export interface AdditionalTiptapCollabProviderConfiguration { | ||
disableAutoVersioning(): 0; | ||
private getYThreads; | ||
getThreads<Data, CommentData>(): TCollabThread<Data, CommentData>[]; | ||
private getThreadIndex; | ||
getThread<Data, CommentData>(id: string): TCollabThread<Data, CommentData> | null; | ||
private getYThread; | ||
createThread(data: TCollabThread): TCollabThread | null; | ||
updateThread(id: TCollabThread['id'], data: Pick<TCollabThread, 'data'>): TCollabThread | null; | ||
deleteThread(id: TCollabThread['id']): void; | ||
getThreadComments(threadId: TCollabThread['id']): TCollabComment[] | null; | ||
getThreadComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabComment | null; | ||
addComment(threadId: TCollabThread['id'], data: TCollabComment): TCollabThread | null; | ||
updateComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], data: TCollabComment): TCollabThread | null; | ||
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabThread | null; | ||
watchThreads(callback: () => void): void; | ||
unwatchThreads(callback: () => void): void; | ||
} |
@@ -87,2 +87,16 @@ import { Encoder } from 'lib0/encoding'; | ||
}[]; | ||
export type TCollabThread<Data = any, CommentData = any> = { | ||
id: string; | ||
createdAt: number; | ||
updatedAt: number; | ||
comments: TCollabComment<CommentData>[]; | ||
data: Data; | ||
}; | ||
export type TCollabComment<Data = any> = { | ||
id: string; | ||
createdAt: number; | ||
updatedAt: number; | ||
data: Data; | ||
content: any; | ||
}; | ||
export type THistoryVersion = { | ||
@@ -89,0 +103,0 @@ name?: string; |
@@ -1,2 +0,2 @@ | ||
declare const _default: import("vite").UserConfigExport; | ||
declare const _default: import("vite").UserConfig; | ||
export default _default; |
{ | ||
"name": "@hocuspocus/extension-database", | ||
"description": "a generic Hocuspocus persistence driver for the database", | ||
"version": "2.9.1-rc.0", | ||
"version": "2.9.2-rc.0", | ||
"homepage": "https://hocuspocus.dev", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hocuspocus/server": "^2.9.1-rc.0" | ||
"@hocuspocus/server": "^2.9.2-rc.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77960
2029