current-doc.ts 960 B

1234567891011121314151617181920212223242526272829303132
  1. import { EditorFacade } from '../modules/source-editor/frontend/js/extensions/realtime'
  2. import {
  3. AnyOperation,
  4. Change,
  5. ChangeOperation,
  6. CommentOperation,
  7. DeleteOperation,
  8. InsertOperation,
  9. } from './change'
  10. export type CurrentDoc = {
  11. doc_id: string
  12. docName: string
  13. track_changes_as: string | null
  14. ranges: {
  15. changes: Change<InsertOperation | ChangeOperation | DeleteOperation>[]
  16. comments: Change<CommentOperation>[]
  17. resolvedThreadIds: Record<string, any>
  18. removeCommentId: (id: string) => void
  19. removeChangeIds: (ids: string[]) => void
  20. getChanges: (
  21. ids: string[]
  22. ) => Change<InsertOperation | ChangeOperation | DeleteOperation>[]
  23. validate: (text: string) => void
  24. }
  25. attachToCM6: (editor: EditorFacade) => void
  26. detachFromCM6: () => void
  27. on: (eventName: string, listener: EventListener) => void
  28. off: (eventName: string) => void
  29. submitOp: (op: AnyOperation) => void
  30. getSnapshot: () => string
  31. }