import type { FormField } from './types.js'; /** * Convert a camelCase or snake_case key to a human-readable Title Case label. * Strips dot-path prefixes (e.g. `"address.street"` → `"Street"`) before conversion. * * @param key - A field key in camelCase, snake_case, or dot-notation path. * @returns A space-separated Title Case string suitable for use as a form label. * * @example inferLabel('firstName') → 'First Name' * @example inferLabel('email_address') → 'Email Address' */ export declare function inferLabel(key: string): string; /** * Join a parent path and a child key with a dot separator. * Returns `key` directly when `parent` is undefined or empty. * * @param parent - The parent path (e.g. `"address"`) or undefined for top-level fields. * @param key - The child field key to append (e.g. `"street"`). * @returns The joined path (e.g. `"address.street"`) or `key` when parent is absent. * * @example joinPath('address', 'street') → 'address.street' * @example joinPath(undefined, 'name') → 'name' * * @category Utils */ export declare function joinPath(parent: string | undefined, key: string): string; /** * Translate a simple structural regex pattern into an input mask string. * * Supported tokens: * - `\d{N}` or `\d` → N digit placeholders (`9`) * - `[0-9]{N}` → N digit placeholders (`9`) * - `[A-Z]{N}`, `[a-z]{N}`, `[A-Za-z]{N}` → N letter placeholders (`a`) * - `[A-Za-z0-9]{N}` → N alphanumeric placeholders (`*`) * - Literal separator chars (`- / ( ) . : _ + space`) * - `^` / `$` anchors (stripped) * * Returns `null` for patterns that cannot be expressed as a fixed mask * (variable length, alternation, lookaheads, capturing groups, etc.). * * The output format is compatible with `imask`, `react-input-mask`, and * similar libraries where `9`=digit, `a`=letter, `*`=alphanumeric. * * @example regexToMask('^\\d{3}-\\d{2}-\\d{4}$') → '999-99-9999' * @example regexToMask('^[A-Z]{2}\\d{5}$') → 'aa99999' * @example regexToMask('^\\d{2}/\\d{2}/\\d{4}$') → '99/99/9999' * @example regexToMask('^[a-zA-Z0-9._%+-]+@') → null (too complex) */ export declare function regexToMask(pattern: string): string | null; /** * Returns a type-safe empty default value for a FormField based on its zodType * and structure. Used by codegen for useFieldArray append() defaults and * by runtime for initial values. * * - string → '' * - number/bigint → 0 * - boolean → false * - date → undefined * - object (Fieldset) → recursively builds from children * - array (ArrayField) → [] * - enum → first option value or '' * - union/discriminatedUnion → first variant's empty default * * @param field - The FormField to generate an empty default for. * @returns An empty default value matching the field's type structure. * * @category Utils */ export declare function getEmptyDefault(field: FormField): unknown; /** * Normalise a concrete field key to the bracket notation used in config. * Replaces `.0.`, `.${index}.`, and any `..` segments with `[].`. * * @param key - A concrete field key potentially containing numeric array indices. * @returns The normalized key with array index segments replaced by `[]`. * * @example normalizeFieldKey('items.0.name') → 'items[].name' * @example normalizeFieldKey('items.${index}.name') → 'items[].name' * @example normalizeFieldKey('tags.2') → 'tags[]' * * @category Utils */ export declare function normalizeFieldKey(key: string): string; /** * Collect section groupings from fields and a config override lookup. * Returns a Map of section name → array of field keys that belong to it. * Recursively visits nested children and array item templates. * * @param fields - The flat or nested FormField array to scan for section assignments. * @param getOverride - A function that returns the config override (if any) for a given field key. * @returns A Map from section name to the ordered list of field keys assigned to that section. * * @category Utils */ export declare function collectFieldSections(fields: FormField[], getOverride: (key: string) => { section?: string; } | undefined): Map; /** * Create a base FormField with sensible defaults. * Processors fill in the specific component and props after calling this. * * @param key - The field path (e.g. `"name"`, `"address.street"`). * @param zodType - The Zod `def.type` string (e.g. `"string"`, `"object"`). * @returns A FormField with all required properties set to their defaults. * * @category Utils */ export declare function createBaseField(key: string, zodType: string): FormField; //# sourceMappingURL=utils.d.ts.map