import { ComponentProps, Ref } from "react"; import { TextInputValidationRefProps } from "../../utils/types"; import { TextInputBase } from "./TextInputBase"; export type ValidationWithOptions = { isValid: boolean; errorMessage: string; }; type TextInputValidationProps = Omit, "rightElement" | "status" | "bottomMessageColor" | "isPassword" | "ref"> & { ref?: Ref; /** * If true, the character counter will only be displayed/announced when the counter limit is reached. * If false or undefined, the character counter will be displayed/announced whenever the counter is enabled, * including before the user starts typing (for example, `0 / limit`). */ showCounterOnlyWhenLimitReached?: boolean; /** * This function can return either a `boolean` or a `ValidationWithOptions` object. * If a `boolean` is returned and the field is not valid, the value of the errorMessage prop will be displayed/announced. * If a `ValidationWithOptions` object is returned and the field is not valid, the value displayed/announced will be the one contained within this object. */ onValidate: (value: string) => boolean | ValidationWithOptions; /** * In case of a dynamic `errorMessage`, use the `onValidate` function with a `ValidationWithOptions` object as the return value to ensure that screen readers announce the correct value. */ errorMessage: string; /** * Determines the validation mode. If "onBlur", validation occurs on blur. If "onContinue", validation occurs when an external button is pressed. */ validationMode?: "onBlur" | "onContinue"; /** * A string that will be read by screen readers when the field is not valid. */ accessibilityErrorLabel?: string; }; export declare const TextInputValidation: ({ onValidate, errorMessage, value, bottomMessage, onBlur, onFocus, validationMode, accessibilityErrorLabel, ref, ...props }: TextInputValidationProps) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=TextInputValidation.d.ts.map