ydoc-status.ts 720 B

1234567891011121314151617181920
  1. /**
  2. * NEW: The document is newly created and not yet synced with the latest revision.
  3. * SYNCED: The document is synced with the latest revision.
  4. * DRAFT: The document advances as a draft compared to the latest revision
  5. * OUTDATED: The document is outdated and needs to be synced with the latest revision.
  6. * ISOLATED: The latest revision does not exist and the document is isolated from the page.
  7. */
  8. export const YDocStatus = {
  9. NEW: 'new',
  10. SYNCED: 'synced',
  11. DRAFT: 'draft',
  12. OUTDATED: 'outdated',
  13. ISOLATED: 'isolated',
  14. } as const;
  15. export type YDocStatus = (typeof YDocStatus)[keyof typeof YDocStatus];
  16. /**
  17. * The base path for Yjs WebSocket connections.
  18. */
  19. export const YJS_WEBSOCKET_BASE_PATH = '/yjs';