import { ComputedRef, MaybeRefOrGetter, Ref } from '../../node_modules/vue'; /** * Strips every non-digit character from a single cell value. * * @param value - The raw cell value. * @returns The value with all non-digit characters removed. */ export declare function keepDigitsOnly(value: string): string; /** * Normalizes a list of digit cells and spreads any multi-digit cell across the * following cells, then truncates the result to `length`. A cell holding more * than one digit (a value greater than 9) overflows into its neighbours so each * cell ends up holding a single digit. * * This is the pure transform behind the digits input; it has no reactive or DOM * side effects. * * @param values - The current cell values. * @param length - The maximum number of cells to keep. * @returns The normalized, spread and truncated cell values. */ export declare function spreadDigits(values: string[], length: number): string[]; /** * Reactive inputs driving the digits model. */ export interface UseDigitsModelOptions { /** * The value backing the input, used to seed the cells. */ modelValue: MaybeRefOrGetter; /** * Number of digit cells. */ length: MaybeRefOrGetter; } /** * Reactive API returned by {@link useDigitsModel}. */ export interface UseDigitsModel { /** * The per-cell values, kept normalized (single digit per cell, spread on * overflow) by an internal watcher. */ values: Ref; /** * The cells joined into a single string, ignoring any non-numeric cell. */ joinedValues: ComputedRef; } /** * Owns the per-cell state of the digits input: the `values` cells seeded from * the bound value, the `joinedValues` projection, and the normalization watcher * that spreads multi-digit entries across the following cells. The watcher only * rewrites `values` when the normalized result differs, avoiding an infinite * update cycle. Focus management and event emission stay in the component since * they are DOM and contract concerns. * * This composable is internal to the library and not exported from the public * entry point; consume it from a relative path. * * @param options - Reactive digit inputs (see {@link UseDigitsModelOptions}). * @param onNormalized - Optional callback fired after each normalization pass, * used by the component to move focus to the next cell. * @returns The {@link UseDigitsModel} API. * @example * import { useDigitsModel } from '@/composables/useDigitsModel' * * const { values, joinedValues } = useDigitsModel( * { modelValue: () => props.modelValue, length: () => props.length }, * focusToNextInput * ) */ export declare function useDigitsModel(options: UseDigitsModelOptions, onNormalized?: () => void): UseDigitsModel; export default useDigitsModel;