import { type FiscalCodeReason } from './is-valid-codice-fiscale'; import { type CodiceFiscaleInput } from './calculate-codice-fiscale'; /** Agent-readiness curated handle for FiscalCodeInput. */ export interface FiscalCodeInputHandle { getValue: () => string; setValue: (value: string) => void; clear: () => void; focus: () => void; isValid: () => boolean; } /** Structured payload emitted on every keystroke alongside the raw value. */ export interface FiscalCodeChangeMeta { /** Structurally sound AND control character matches (always 16 chars). */ isValid: boolean; /** Whether all 16 characters are present (regardless of validity). */ isComplete: boolean; /** Why the value is (in)valid — drives consumer messaging. */ reason: FiscalCodeReason; /** * Omocodia: omocodia letters replace digits. A valid code counts whatever the * order. With a wrong control character the letters must run leftwards from the * last digit, so a stray letter reads as a typo; that case is still true, so a * host can say "looks like omocodia" too. */ isOmocodic: boolean; } export interface FiscalCodeInputProps { /** Controlled value (raw, uppercased, no spaces). Pair with onChange. */ value?: string; /** Uncontrolled initial value. Normalised on mount. */ defaultValue?: string; /** Fires on every keystroke with the normalised raw string + meta. */ onChange?: (raw: string, meta: FiscalCodeChangeMeta) => void; size?: 'sm' | 'md' | 'lg'; tone?: 'default' | 'error'; /** When the invalid tone + error string surface. Never marks partial input invalid. */ validateOn?: 'change' | 'blur' | 'submit'; /** Controlled escape hatch to force the invalid state (e.g. server rejection). */ showError?: boolean; /** Overrides the kit's default i18n error string. */ errorMessage?: string; disabled?: boolean; readOnly?: boolean; required?: boolean; placeholder?: string; /** Render the "16 characters" caption when NOT inside a FormField. */ showFormatHint?: boolean; /** * OPT-IN. When the consuming form already holds the person's identity * data, supply it here to render an inline "calculate" affordance: a * small icon button that derives the codice fiscale and fills the field. * The caller supplies the 4-char `belfioreCode` of the birthplace — the * kit does not bundle the municipality lookup table. Omit to render * nothing extra (no behavioural change). Ignored when readOnly/disabled. */ calculateFrom?: CodiceFiscaleInput; id?: string; name?: string; className?: string; 'aria-label'?: string; } declare const wrapperVariants: (props?: ({ size?: "sm" | "md" | "lg" | null | undefined; tone?: "default" | "error" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; export declare const FiscalCodeInput: import("react").ForwardRefExoticComponent>; export { wrapperVariants as fiscalCodeWrapperVariants }; //# sourceMappingURL=fiscal-code-input.d.ts.map