import { type Editor, type Extensions } from '@tiptap/core'; import * as Y from 'yjs'; import { createWorkDocumentExtensions } from '../features/work/work-document-extensions'; import type { WorkDocumentChangeDecisionAction, WorkDocumentContent, WorkDocumentNode } from '../features/work/work-types'; import { type WorkOfficeCollaborationOrigin, type WorkOfficeCollaborationSession } from './office-collaboration'; export interface WorkOfficeDocumentCollaborationBindingOptions { /** * Behavior-only extensions are supported. Node and mark extensions must be * part of the versioned Office schema before they can enter shared content. */ additionalExtensions?: Extensions; captureTimeoutMs?: number; onFirstRender?: () => void; origin?: WorkOfficeCollaborationOrigin; workExtensions?: Omit[0], 'collaborative'>; } export interface WorkOfficeDocumentCollaborationChange { content: WorkDocumentContent; local: boolean; origin: unknown; } export interface WorkOfficeDocumentChangeDecisionOptions { decidedAt?: string; } export interface WorkOfficeDocumentCollaborationBinding { readonly extensions: Extensions; readonly fragment: Y.XmlFragment; readonly origin: WorkOfficeCollaborationOrigin; content(): WorkDocumentContent; updateSidecars(previous: WorkDocumentContent, next: WorkDocumentContent): boolean; decideChanges(editor: Editor, changeIds: readonly string[], decision: WorkDocumentChangeDecisionAction, options?: WorkOfficeDocumentChangeDecisionOptions): boolean; canUndo(): boolean; canRedo(): boolean; undo(): boolean; redo(): boolean; stopCapturing(): void; subscribe(listener: (change: WorkOfficeDocumentCollaborationChange) => void): () => void; subscribeError(listener: (error: unknown) => void): () => void; subscribeHistory(listener: () => void): () => void; destroy(): void; } export declare function initializeWorkOfficeDocumentCollaboration(session: WorkOfficeCollaborationSession, content: WorkDocumentContent): { initialized: boolean; content: WorkDocumentContent; }; export declare function readWorkOfficeDocumentCollaboration(session: WorkOfficeCollaborationSession): WorkDocumentContent; export declare function createWorkOfficeDocumentCollaborationBinding(session: WorkOfficeCollaborationSession, options?: WorkOfficeDocumentCollaborationBindingOptions): WorkOfficeDocumentCollaborationBinding; export declare function workOfficeDocumentCollaborationFragment(session: WorkOfficeCollaborationSession): Y.XmlFragment; export declare function workOfficeDocumentCollaborationNode(session: WorkOfficeCollaborationSession): WorkDocumentNode;