import * as Y from "yjs"; export interface UndoKeyboardOptions { enableKeyboardShortcuts?: boolean; ignoreInputTargets?: boolean; } export type CollabUndoScope = Y.AbstractType | Y.AbstractType[] | ((doc: Y.Doc) => Y.AbstractType | Y.AbstractType[]); export interface UseCollabUndoOptions extends UndoKeyboardOptions { ydoc: Y.Doc | null | undefined; scope: CollabUndoScope; trackedOrigins?: unknown[]; captureTimeout?: number; } export interface UseCollabUndoResult { undo: () => boolean; redo: () => boolean; canUndo: boolean; canRedo: boolean; localOrigin: unknown; transactLocal: (fn: () => T) => T; undoManager: Y.UndoManager | null; } export declare function useCollabUndo(options: UseCollabUndoOptions): UseCollabUndoResult; export interface LocalOpUndoEntry { undo: TOp[]; redo: TOp[]; label?: string; coalesceKey?: string; coalesceWindowMs?: number; } export interface LocalOpUndoController { push(entry: LocalOpUndoEntry): void; undo(): Promise; redo(): Promise; canUndo(): boolean; canRedo(): boolean; clear(): void; peekUndoLabel(): string | undefined; peekRedoLabel(): string | undefined; } export interface CreateLocalOpUndoOptions { apply: (ops: TOp[], direction: "undo" | "redo", entry: LocalOpUndoEntry) => LocalOpUndoApplyOutcome | Promise; maxDepth?: number; coalesceMs?: number; onChange?: () => void; onApplyError?: (error: unknown, direction: "undo" | "redo", entry: LocalOpUndoEntry) => void; now?: () => number; } type LocalOpUndoApplyOutcome = void | boolean | "conflict"; export declare function createLocalOpUndoController(options: CreateLocalOpUndoOptions): LocalOpUndoController; export interface UseLocalOpUndoOptions extends Omit, "onChange">, UndoKeyboardOptions { } export interface UseLocalOpUndoResult { push: (entry: LocalOpUndoEntry) => void; undo: () => Promise; redo: () => Promise; canUndo: boolean; canRedo: boolean; clear: () => void; controller: LocalOpUndoController; } export declare function useLocalOpUndo(options: UseLocalOpUndoOptions): UseLocalOpUndoResult; export {};