/** * Utilities for detecting changes in input values. * Used to distinguish between different editing operations (Delete vs Backspace, etc.) */ import type { ChangeRange } from './constants'; /** * Determines what changed based on caret positions before and after the change. * This is used to distinguish Delete (cursor stays) vs Backspace (cursor moves left). * * @param caretBefore - The caret position info before the change * @param inputValueBefore - The input value before the change * @param inputValueAfter - The input value after the change * @returns Change range information, or undefined if unable to determine * * @example * // Delete key: cursor at 2, endOffset: 1 * findChangedRangeFromCaretPositions( * { selectionStart: 2, selectionEnd: 2, endOffset: 1 }, * "1,234", * "1,34" * ) // Returns: { start: 2, end: 3, deletedLength: 1, isDelete: true } */ export declare function findChangedRangeFromCaretPositions(caretBefore: { selectionStart: number; selectionEnd: number; endOffset?: number; }, inputValueBefore: string, inputValueAfter: string): ChangeRange | undefined; /** * Finds the change range by comparing old and new values. * This is a fallback when caret position info is not available. * * @param oldValue - The value before the change * @param newValue - The value after the change * @returns Change range information, or undefined if unable to determine * * @example * findChangeRange("1,234", "1,34") * // Returns: { start: 2, end: 3, deletedLength: 1, isDelete: true } */ export declare function findChangeRange(oldValue: string, newValue: string): ChangeRange | undefined;