import type { Editor } from '@tiptap/core'; import type { WorkDocumentContent, WorkDocumentNode } from './work-types'; export type WorkDocumentSelectionMenuIcon = 'copy' | 'language' | 'message' | 'quote' | 'sparkles' | 'wand'; export interface WorkDocumentSelectionSnapshot { selection: { from: number; to: number; text: string; rawText: string; beforeText: string; afterText: string; model: WorkDocumentNode; }; document: { content: WorkDocumentContent; html: string; text: string; }; } export type WorkDocumentSelectionCommandFailure = 'command-rejected' | 'editor-unavailable' | 'invalid-text' | 'read-only' | 'stale-selection'; export type WorkDocumentSelectionCommandResult = { applied: true; } | { applied: false; reason: WorkDocumentSelectionCommandFailure; }; export interface WorkDocumentSelectionCommands { copyText(): Promise; insertAfter(text: string): WorkDocumentSelectionCommandResult; insertBefore(text: string): WorkDocumentSelectionCommandResult; replaceText(text: string): WorkDocumentSelectionCommandResult; } export interface WorkDocumentSelectionContext extends WorkDocumentSelectionSnapshot { commands: WorkDocumentSelectionCommands; } export interface WorkDocumentSelectionMenuItem { id: string; label: string; icon?: WorkDocumentSelectionMenuIcon; shortcut?: string; ariaKeyShortcut?: string; danger?: boolean; disabled?: boolean; separatorBefore?: boolean; onSelect(context: WorkDocumentSelectionContext): void | Promise; } export type WorkGetDocumentSelectionMenuItems = (context: WorkDocumentSelectionSnapshot) => readonly WorkDocumentSelectionMenuItem[]; export interface WorkDocumentSelectionAction { context: WorkDocumentSelectionContext; dispose(): void; } export declare function createWorkDocumentSelectionSnapshot(editor: Editor, content: WorkDocumentContent): WorkDocumentSelectionSnapshot | null; export declare function createWorkDocumentSelectionAction(editor: Editor, snapshot: WorkDocumentSelectionSnapshot, getTrackChanges: () => boolean): WorkDocumentSelectionAction; export declare function documentPlainTextAsHtml(value: string): string;