Yuki Takei 1 anno fa
parent
commit
aee643c8b2

+ 1 - 0
packages/editor/src/consts/index.ts

@@ -1,5 +1,6 @@
 export * from './global-code-mirror-editor-key';
 export * from './ydoc-awareness-user-color';
+export * from './ydoc-status';
 export * from './editor-settings';
 export * from './editor-themes';
 export * from './keymaps';

+ 15 - 0
packages/editor/src/consts/ydoc-status.ts

@@ -0,0 +1,15 @@
+/**
+ * NEW: The document is newly created and not yet synced with the latest revision.
+ * SYNCED: The document is synced with the latest revision.
+ * DRAFT: The document advances as a draft compared to the latest revision
+ * OUTDATED: The document is outdated and needs to be synced with the latest revision.
+ * ISOLATED: The latest revision does not exist and the document is isolated from the page.
+ */
+export const YDocStatus = {
+  NEW: 'new',
+  SYNCED: 'synced',
+  DRAFT: 'draft',
+  OUTDATED: 'outdated',
+  ISOLATED: 'isolated',
+} as const;
+export type YDocStatus = typeof YDocStatus[keyof typeof YDocStatus]