/** * String surgery shared by the mask engine and the masks Spar ships. * * Internal. Pure and dependency-free: no DOM, no React, no caret positions. * `createDateMask` and `createTimeMask` reach for these the same way `maskShape` * does — a preset gets no privileged helper the engine keeps to itself. */ import type { MaskCommonOptions } from '@/types'; /** * Resolves one delimiter per gap between blocks. `delimiters` wins over * `delimiter`; a short `delimiters` array repeats its last entry, matching * cleave. */ export declare const getGapDelimiters: (options: MaskCommonOptions, gapCount: number) => string[]; /** * Removes every delimiter occurrence, so masking an already-masked value is * idempotent — then any delimiter character left standing on its own. * * The second pass is what makes a multi-character delimiter survive a partial * delete. Backspace inside `') '` leaves a stray `)`, which the whole-occurrence * pass no longer recognises; laid out as content it comes back doubled, turning * `'532) 123-4567'` into `'532) )12-3456'`. A delimiter character is structural * wherever it appears, so it never counts as content. */ export declare const stripDelimiters: (value: string, delimiters: readonly string[]) => string; /** `uppercase` wins when both flags are set. */ export declare const applyCase: (value: string, options: { uppercase?: boolean; lowercase?: boolean; }) => string; export declare const applyCharFilter: (value: string, options: { numericOnly?: boolean; letterOnly?: boolean; }) => string; /** * Lays significant characters into blocks, inserting a gap delimiter only once * the preceding block is full **and** characters remain — so `'12'` with blocks * `[2, 2]` stays `'12'` while `'123'` becomes `'12/3'`. */ export declare const distribute: (chars: string, blocks: readonly number[], delimiters: readonly string[]) => string; export declare const capacityOf: (blocks: readonly number[]) => number; export declare const pad2: (value: number) => string; export declare const pad4: (value: number) => string; /** Splits a digit string into per-block parts using block sizes. */ export declare const splitIntoParts: (digits: string, blocks: readonly number[]) => string[]; /** * Digits only, capped at the pattern's capacity — the entry step every * digit-shaped mask starts from. */ export declare const toDigits: (input: string, delimiters: readonly string[], capacity: number) => string;