## API Report File for "@eigenpal/docx-editor-react"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { AutoSaveStatus } from '@eigenpal/docx-editor-core';
import { ClipboardSelection } from '@eigenpal/docx-editor-core';
import { createSelectionFromDOM } from '@eigenpal/docx-editor-core';
import { CSSProperties } from 'react';
import { Document as Document_2 } from '@eigenpal/docx-editor-core/types/document';
import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { extractTrackedChanges } from '@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges';
import { FindMatch } from '@eigenpal/docx-editor-core/utils/findReplace';
import { FindOptions } from '@eigenpal/docx-editor-core/utils/findReplace';
import { formatLastSaveTime } from '@eigenpal/docx-editor-core';
import { formatStorageSize } from '@eigenpal/docx-editor-core';
import { getAutoSaveStatusLabel } from '@eigenpal/docx-editor-core';
import { getAutoSaveStorageSize } from '@eigenpal/docx-editor-core';
import { getSelectionRuns } from '@eigenpal/docx-editor-core';
import { HighlightRect } from '@eigenpal/docx-editor-core/utils';
import { isAutoSaveSupported } from '@eigenpal/docx-editor-core';
import { ParsedClipboardContent } from '@eigenpal/docx-editor-core/utils';
import * as React$1 from 'react';
import React__default from 'react';
import { RefObject } from 'react';
import { SavedDocumentData } from '@eigenpal/docx-editor-core';
import { SelectionHighlightConfig } from '@eigenpal/docx-editor-core/utils';
import { Table } from '@eigenpal/docx-editor-core/types/document';
import { TABLE_DATA_ATTRIBUTES } from '@eigenpal/docx-editor-core';
import { Theme } from '@eigenpal/docx-editor-core';
import { TrackedChangesResult } from '@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges';

export { AutoSaveStatus }

// @public
export function clampZoom(zoom: number, minZoom?: number, maxZoom?: number): number;

export { ClipboardSelection }

export { createSelectionFromDOM }

// @public
export interface DragAutoScrollOptions {
    onScrollExtendSelection: (clientX: number, clientY: number) => void;
    pagesContainerRef: React.RefObject<HTMLDivElement | null>;
}

export { extractTrackedChanges }

// @public
export function findNearestZoomPreset(zoom: number): number;

// @public
export interface FindReplaceOptions {
    initialReplaceMode?: boolean;
    onCurrentMatchChange?: (match: FindMatch | null, index: number) => void;
    onMatchesChange?: (matches: FindMatch[]) => void;
}

// @public
export interface FindReplaceState {
    currentIndex: number;
    isOpen: boolean;
    matches: FindMatch[];
    options: FindOptions;
    replaceMode: boolean;
    replaceText: string;
    searchText: string;
}

export { formatLastSaveTime }

export { formatStorageSize }

// @public
export function formatZoom(zoom: number): string;

// @public
export function generateOverlayElements(rects: HighlightRect[], config?: SelectionHighlightConfig): React__default.ReactNode[];

export { getAutoSaveStatusLabel }

export { getAutoSaveStorageSize }

// @public
export function getNextZoomPreset(zoom: number): number;

// @public
export function getPreviousZoomPreset(zoom: number): number;

export { getSelectionRuns }

// @public
export function getZoomPresets(): number[];

// @public
export interface HistoryEntry<T> {
    description?: string;
    state: T;
    timestamp: number;
}

// @public
export class HistoryManager<T> {
    constructor(initialState: T, options?: {
        maxEntries?: number;
        groupingInterval?: number;
        isEqual?: (a: T, b: T) => boolean;
    });
    // (undocumented)
    get canRedo(): boolean;
    // (undocumented)
    get canUndo(): boolean;
    // (undocumented)
    clear(): void;
    // (undocumented)
    push(newState: T, description?: string): void;
    // (undocumented)
    redo(): T | undefined;
    // (undocumented)
    reset(newInitialState?: T): void;
    // (undocumented)
    get state(): T;
    // (undocumented)
    undo(): T | undefined;
}

export { isAutoSaveSupported }

// @public
export function isZoomPreset(zoom: number): boolean;

// @public
export function parseZoom(zoomString: string): number | null;

export { SavedDocumentData }

// @public
export interface SelectionOverlayProps {
    className?: string;
    config?: SelectionHighlightConfig;
    rects: HighlightRect[];
}

export { TABLE_DATA_ATTRIBUTES }

// @public
export interface TableSelectionState {
    // (undocumented)
    columnIndex: number | null;
    // (undocumented)
    context: TableContext | null;
    // (undocumented)
    rowIndex: number | null;
    // (undocumented)
    table: Table | null;
    // (undocumented)
    tableIndex: number | null;
}

export { TrackedChangesResult }

// @public (undocumented)
export function useAspectLockedSize(): UseAspectLockedSizeReturn;

// @public
export interface UseAspectLockedSizeReturn {
    // (undocumented)
    handleHeightChange: (raw: string) => void;
    handleWidthChange: (raw: string) => void;
    // (undocumented)
    height: number | '';
    // (undocumented)
    lockAspect: boolean;
    seed: (w: number | null | undefined, h: number | null | undefined) => void;
    // (undocumented)
    setLockAspect: (locked: boolean) => void;
    // (undocumented)
    width: number | '';
}

// @public
export function useAutoHistory<T>(value: T, options?: UseHistoryOptions<T>): Omit<UseHistoryReturn<T>, 'push'>;

// @public (undocumented)
export function useAutoSave(document: Document_2 | null | undefined, options?: UseAutoSaveOptions): UseAutoSaveReturn;

// @public
export interface UseAutoSaveOptions {
    debounceDelay?: number;
    enabled?: boolean;
    interval?: number;
    maxAge?: number;
    onError?: (error: Error) => void;
    onRecoveryAvailable?: (savedDocument: SavedDocumentData) => void;
    onSave?: (timestamp: Date) => void;
    saveOnChange?: boolean;
    storageKey?: string;
}

// @public
export interface UseAutoSaveReturn {
    // (undocumented)
    acceptRecovery: () => Document_2 | null;
    // (undocumented)
    clearAutoSave: () => void;
    // (undocumented)
    disable: () => void;
    // (undocumented)
    dismissRecovery: () => void;
    // (undocumented)
    enable: () => void;
    // (undocumented)
    getRecoveryData: () => SavedDocumentData | null;
    // (undocumented)
    hasRecoveryData: boolean;
    // (undocumented)
    isEnabled: boolean;
    // (undocumented)
    lastSaveTime: Date | null;
    // (undocumented)
    save: () => Promise<boolean>;
    // (undocumented)
    status: AutoSaveStatus;
}

// @public (undocumented)
export function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;

// @public
export interface UseClipboardOptions {
    // (undocumented)
    cleanWordFormatting?: boolean;
    // (undocumented)
    editable?: boolean;
    // (undocumented)
    onCopy?: (selection: ClipboardSelection) => void;
    // (undocumented)
    onCut?: (selection: ClipboardSelection) => void;
    // (undocumented)
    onError?: (error: Error) => void;
    // (undocumented)
    onPaste?: (content: ParsedClipboardContent, asPlainText: boolean) => void;
    theme?: Theme | null;
}

// @public (undocumented)
export interface UseClipboardReturn {
    // (undocumented)
    copy: (selection: ClipboardSelection) => Promise<boolean>;
    // (undocumented)
    cut: (selection: ClipboardSelection) => Promise<boolean>;
    // (undocumented)
    handleCopy: (event: ClipboardEvent) => void;
    // (undocumented)
    handleCut: (event: ClipboardEvent) => void;
    // (undocumented)
    handleKeyDown: (event: KeyboardEvent) => void;
    // (undocumented)
    handlePaste: (event: ClipboardEvent) => void;
    // (undocumented)
    isProcessing: boolean;
    // (undocumented)
    lastPastedContent: ParsedClipboardContent | null;
    // (undocumented)
    paste: (asPlainText?: boolean) => Promise<ParsedClipboardContent | null>;
}

// @public
export function useDocumentHistory<T extends {
    package?: {
        document?: unknown;
        headers?: unknown;
        footers?: unknown;
    } | null;
} | null>(document: T, options?: Omit<UseHistoryOptions<T>, 'isEqual'>): UseHistoryReturn<T>;

// @public (undocumented)
export function useDragAutoScroll(input: DragAutoScrollOptions): {
    updateMousePosition: (clientX: number, clientY: number) => void;
    stopAutoScroll: () => void;
};

// @public
export function useFindReplace(hookOptions?: FindReplaceOptions): UseFindReplaceReturn;

// @public
export interface UseFindReplaceReturn {
    close: () => void;
    getCurrentMatch: () => FindMatch | null;
    goToMatch: (index: number) => void;
    goToNextMatch: () => number;
    goToPreviousMatch: () => number;
    hasMatches: () => boolean;
    openFind: (selectedText?: string) => void;
    openReplace: (selectedText?: string) => void;
    setMatches: (matches: FindMatch[], currentIndex?: number) => void;
    setOptions: (options: Partial<FindOptions>) => void;
    setReplaceText: (text: string) => void;
    setSearchText: (text: string) => void;
    state: FindReplaceState;
    toggle: () => void;
}

// @public (undocumented)
export function useFixedDropdown(input: UseFixedDropdownOptions): UseFixedDropdownReturn;

// @public
export interface UseFixedDropdownOptions {
    align?: 'left' | 'right';
    // (undocumented)
    isOpen: boolean;
    // (undocumented)
    onClose: () => void;
}

// @public (undocumented)
export interface UseFixedDropdownReturn {
    // (undocumented)
    containerRef: RefObject<HTMLDivElement | null>;
    // (undocumented)
    dropdownRef: RefObject<HTMLDivElement | null>;
    // (undocumented)
    dropdownStyle: CSSProperties;
    // (undocumented)
    handleMouseDown: (e: React.MouseEvent) => void;
}

// @public
export function useHistory<T>(initialState: T, options?: UseHistoryOptions<T>): UseHistoryReturn<T>;

// @public
export interface UseHistoryOptions<T> {
    containerRef?: React.RefObject<HTMLElement>;
    enableKeyboardShortcuts?: boolean;
    groupingInterval?: number;
    isEqual?: (a: T, b: T) => boolean;
    maxEntries?: number;
    onRedo?: (state: T) => void;
    onUndo?: (state: T) => void;
}

// @public
export interface UseHistoryReturn<T> {
    canRedo: boolean;
    canUndo: boolean;
    clear: () => void;
    getRedoStack: () => HistoryEntry<T>[];
    getUndoStack: () => HistoryEntry<T>[];
    push: (newState: T, description?: string) => void;
    redo: () => T | undefined;
    redoCount: number;
    reset: (newInitialState?: T) => void;
    state: T;
    transformAll: (fn: (state: T) => T) => void;
    undo: () => T | undefined;
    undoCount: number;
}

// @public
export function useSelectionHighlight(options: UseSelectionHighlightOptions): UseSelectionHighlightReturn;

// @public
export interface UseSelectionHighlightOptions {
    config?: SelectionHighlightConfig;
    containerRef: React__default.RefObject<HTMLElement>;
    debounceMs?: number;
    enabled?: boolean;
    onSelectionChange?: (hasSelection: boolean, text: string) => void;
    useOverlay?: boolean;
}

// @public
export interface UseSelectionHighlightReturn {
    getOverlayStyle: (rect: HighlightRect) => CSSProperties;
    hasSelection: boolean;
    highlightRects: HighlightRect[];
    isSelectionInContainer: boolean;
    refresh: () => void;
    selectedText: string;
}

// @public (undocumented)
export function useTableSelection(input: UseTableSelectionOptions): UseTableSelectionReturn;

// @public (undocumented)
export interface UseTableSelectionOptions {
    // (undocumented)
    document: Document_2 | null;
    // (undocumented)
    onChange?: (document: Document_2) => void;
    // (undocumented)
    onSelectionChange?: (context: TableContext | null) => void;
}

// @public (undocumented)
export interface UseTableSelectionReturn {
    // (undocumented)
    applySplitCell: (rows: number, cols: number) => void;
    // (undocumented)
    clearSelection: () => void;
    // (undocumented)
    getSplitCellConfig: () => TableSplitConfig | null;
    // (undocumented)
    handleAction: (action: TableAction) => void;
    // (undocumented)
    handleCellClick: (tableIndex: number, rowIndex: number, columnIndex: number) => void;
    // (undocumented)
    isCellSelected: (tableIndex: number, rowIndex: number, columnIndex: number) => boolean;
    // (undocumented)
    state: TableSelectionState;
    // (undocumented)
    tableContext: TableContext | null;
}

// @public
export function useTrackedChanges(state: EditorState | null): TrackedChangesResult;

// @public (undocumented)
export function useVisualLineNavigation(input: VisualLineNavigationOptions): {
    stickyXRef: React$1.RefObject<number | null>;
    lastVisualLineIndexRef: React$1.RefObject<number>;
    getCaretClientX: (pmPos: number) => number | null;
    findLineElementAtPosition: (pmPos: number) => HTMLElement | null;
    findPositionOnLineAtClientX: (lineEl: HTMLElement, clientX: number) => number | null;
    handlePMKeyDown: (view: EditorView, event: KeyboardEvent) => boolean;
};

// @public
export function useWheelZoom(options?: UseWheelZoomOptions): UseWheelZoomReturn;

// @public
export interface UseWheelZoomOptions {
    containerRef?: React.RefObject<HTMLElement>;
    enabled?: boolean;
    enableKeyboardShortcuts?: boolean;
    initialZoom?: number;
    maxZoom?: number;
    minZoom?: number;
    onZoomChange?: (zoom: number) => void;
    preventDefault?: boolean;
    zoomStep?: number;
}

// @public
export interface UseWheelZoomReturn {
    handleKeyDown: (event: KeyboardEvent) => void;
    handleWheel: (event: WheelEvent) => void;
    isMaxZoom: boolean;
    isMinZoom: boolean;
    resetZoom: () => void;
    setZoom: (zoom: number) => void;
    zoom: number;
    zoomIn: () => void;
    zoomOut: () => void;
    zoomPercent: number;
    zoomTo100: () => void;
    zoomToFit: (containerWidth: number, contentWidth: number) => void;
}

// @public (undocumented)
export interface VisualLineNavigationOptions {
    // (undocumented)
    pagesContainerRef: React.RefObject<HTMLDivElement | null>;
}

// @public
export const ZOOM_PRESETS: number[];

```
