export declare function moveCursorToEnd(editableDiv: HTMLDivElement): void; export declare function getCursorPosition(editableDiv: HTMLDivElement): number; export declare function getSelectionOffsets(editableDiv: HTMLDivElement): { start: number; end: number; }; /** * Cmd/Ctrl+Z / Shift+Cmd+Z / Ctrl+Y redo — `onChange` must not run * `handleFormulaInput` or history append for these (Mac uses metaKey, not ctrlKey). */ export declare function isEditorUndoRedoKeyEvent(e: KeyboardEvent): boolean; /** * Use the same rule for cell input and fx bar: custom stack when the line is a * formula (=…) or the stack already has snapshots (plain/rich text edits). */ export declare function shouldUseCustomEditorHistory(editorInnerTextTrimmed: string, historyActive: boolean): boolean; export declare function setCursorPosition(editableDiv: HTMLDivElement, targetOffset: number): void; export declare function setSelectionOffsets(editableDiv: HTMLDivElement, startOffset: number, endOffset: number): void; export declare function buildFormulaSuggestionText(editableDiv: HTMLDivElement, formulaName: string): { text: string; caretOffset: number; }; export declare function isLetterNumberPattern(str: string): boolean; export declare function isStrictFormulaEditorText(editor: HTMLDivElement | null): boolean; /** Same rule as InputBox/Fx onChange: show function list while typing a name after `=`. */ export declare function shouldShowFormulaFunctionList(editor: HTMLDivElement | null): boolean; /** * True when the formula looks complete at the caret: * - strict first character '=' * - caret at end of editor text * - parentheses are balanced (no negative depth; final depth 0) */ export declare function isFormulaCompleteAtCaret(editor: HTMLDivElement | null): boolean; /** * When the caret sits on a function name span or its opening-paren span, return * that function's name (uppercase). Used so nested formulas like `SUM(MIN(` * show the inner function's hint when the caret is inside `MIN` / `MIN(`. * * Rules (match generated formula HTML): * - Caret inside/outside a `luckysheet-formula-text-func` span whose immediate * next element sibling is `luckysheet-formula-text-lpar` → that function. * - Caret inside a `luckysheet-formula-text-lpar` span whose immediate previous * element sibling is `luckysheet-formula-text-func` → that function. */ export declare function getFunctionNameFromFormulaCaretSpans(editor: HTMLDivElement | null): string | null; export declare function removeLastSpan(htmlString: string): string; export declare function numberToColumn(colNumber: number): string; export declare function incrementColumn(cell: string): string; export declare function decrementColumn(cell: string): string; export declare function incrementRow(cell: string): string; export declare function decrementRow(cell: string): string; export declare function countCommasBeforeCursor(editableDiv: HTMLDivElement): number;