import { FormField } from "./typeguards"; export type SerializedFormData = UnTypedSerializedFormData | TypedSerializedFormData; export type UnTypedSerializedFormData = Record; export type TypedSerializedFormData = Record; export type TypedFormDataEntryValue = FormDataEntryValue | FormDataEntryValue[] | boolean | number | Date | [Date, Date]; /** * Returns the (JSX friendly) value for `field`. * @param fields * @param values * @param field */ export declare const getValueFromFormData: (fields: FormField[], values: T, field: FormField) => string | number | T[keyof T] | undefined; /** * Converts `data` to JSX friendly value. * @param data */ export declare function data2Value(data: unknown): number | string | undefined; /** * Parses a field name that may include Formik array syntax (e.g., "field[0]") into a tuple. * * - If `name` includes array syntax, returns `[baseFieldName, index]`. * - Otherwise, returns `[name, undefined]`. * * @template T - The object type whose keys may appear as the (base) field name. * @param name - A string representing the field name. It may follow Formik array notation but doesn't have to. * @returns A tuple where: * - The first element is the base field name as a key of `T`. * - The second element is the array index if present, otherwise `undefined`. * * @example * parseFieldName("emails[2]") // => ["emails", 2] * parseFieldName("username") // => ["username", undefined] * parseFieldName("customName") // => ["customName", undefined] */ export declare const parseFieldName: >(name: string) => [keyof T, number | undefined];