import { UseControllerProps, FieldPath, FieldValues, PathValue, FieldPathValue, Control } from 'react-hook-form'; import { UseComposeClassNameProps, UseComposeHelperTextProps, UseComposeModifierStateProps, UseComposeRulesProps, UseComposeStyleProps } from './internals'; import * as React from 'react'; declare const UNDEFINED_VOID_ONLY: unique symbol; declare module 'react' { type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never; }; } /** * Type for the props of the controller adapter hook. */ export interface UseControllerAdapterProps = FieldPath> extends UseComposeRulesProps, Omit, Omit, Omit, Omit, 'fieldError' | 'name'> { /** * '`control` object from `useForm` hook.' */ control?: Control; /** * The default value for the field. */ defaultValue?: FieldPathValue; /** * If true, the field will be disabled */ disabled?: boolean; /** * Name of the field. */ name: TName; /** * Function called when the field loses focus. * * @param args - Arguments to be passed to the onBlur function. */ onBlur?: (...args: any[]) => void; /** * Function called when the field's value changes. * * @param args - Arguments to be passed to the onChange function. */ onChange?: (...args: any[]) => void; /** * Validation rules object. Refer react-hook-form documentation [here](https://www.react-hook-form.com/api/usecontroller/controller/). */ rules?: UseControllerProps['rules']; /** * Enable and disable field unregister after unmount. */ shouldUnregister?: boolean; /** * Transformation functions for the field's input and output values. */ transform?: { /** * Function to transform the input value. */ input?: (value: PathValue) => TTransformedValue; /** * Function to transform the output value. */ output?: (...args: any[]) => PathValue; }; } /** * Hook for creating a controller adapter. * * @param props - The props for the controller adapter. * @param [ref] - (Optional) ref for the controller adapter. * @returns The adapter object with the transformed and composed properties. */ export declare function useControllerAdapter = FieldPath, RefType = unknown>(props: UseControllerAdapterProps, ref?: React.Ref): { className: string | undefined; disabled: boolean; error: boolean; helperText: React.ReactNode; name: TName; onBlur: (...args: unknown[]) => void; onChange: (...args: unknown[]) => void; ref: ((instance: any) => void | (() => React.VoidOrUndefinedOnly) | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null; required: boolean | undefined; style: React.CSSProperties | undefined; title: string | undefined; value: TTransformedValue; }; export {};