import type { FormDescriptor, FormField, FormFieldIssue, FormValues, JsonValue } from '@funkit/connect-core'; export type KycFieldIssue = FormFieldIssue | 'DATE_UNDERAGE'; /** * The first refusal a field carries, or nothing. * * A field can hold the same issue under two validation causes at once (mount * and change both mark a blank required field); the row draws one colour, so * one is all it needs. */ export declare function firstIssue(errors: readonly unknown[] | undefined): KycFieldIssue | undefined; /** Every control on this screen answers with text; anything else reads blank. */ export declare const stringValue: (value: JsonValue | undefined) => string; /** * What the screen's form holds: one string per field. * * Flat on purpose. `JsonValue` is recursive, and TanStack derives its field * paths from the data type, so the recursion has no floor for the compiler to * stand on. Nothing here answers with anything but text anyway. */ export type KycFormValues = Record; /** The flow's values as the form takes them; anything not text reads blank. */ export declare function typedValues(values: FormValues): KycFormValues; /** * The COUNTRY fields the buyer's region can answer for them: the blank ones. * A value they typed is theirs, whatever the lookup says. */ export declare function blankCountryFields(fields: readonly FormField[], values: FormValues): FormField[]; /** * The fields an earlier round in this session already answered: blank here, * non-blank there. * * Rails key their own records differently from ours — Stripe puts the name and * phone from `registerLinkUser` on the Link consumer account, not on the crypto * customer, so the identity round genuinely has to send the name again. That is * a reason to re-send it, not a reason to make the buyer retype it. */ export declare function carriedBlankFields(fields: readonly FormField[], values: FormValues, carried: FormValues): FormField[]; /** Every rail this form feeds requires an adult (design 2114:8361). */ export declare const MINIMUM_AGE_YEARS = 18; /** * Whether a date of birth makes the buyer too young to continue. * * Only a well-formed past date is judged: a malformed one is connect-core's * `DATE_FORMAT`, and a future one its `DATE_FUTURE`, both worded more * precisely than "too young". Compared as UTC days so a clock behind UTC * cannot fail someone on their birthday. */ export declare function underageIssue(value: string, today?: Date): 'DATE_UNDERAGE' | undefined; /** Keep every rule alive when its field's page is unmounted. */ export declare function validateKycForm(form: FormDescriptor, values: FormValues): Record; //# sourceMappingURL=kycFormState.d.ts.map