///
import { FieldValues, Control, Message, ValidationRule, ValidateResult } from 'react-hook-form';
export declare type ArrayWithLength = {
[K in N]: any;
};
export interface DeepPathArray extends ReadonlyArray {
['0']: keyof TValues;
['1']?: TPath extends {
['0']: infer K0;
} ? K0 extends keyof TValues ? keyof TValues[K0] : never : never;
['2']?: TPath extends {
['0']: infer K0;
['1']: infer K1;
} ? K0 extends keyof TValues ? K1 extends keyof TValues[K0] ? keyof TValues[K0][K1] : never : never : never;
['3']?: TPath extends {
['0']: infer K0;
['1']: infer K1;
['2']: infer K2;
} ? K0 extends keyof TValues ? K1 extends keyof TValues[K0] ? K2 extends keyof TValues[K0][K1] ? keyof TValues[K0][K1][K2] : never : never : never : never;
['4']?: TPath extends {
['0']: infer K0;
['1']: infer K1;
['2']: infer K2;
['3']: infer K3;
} ? K0 extends keyof TValues ? K1 extends keyof TValues[K0] ? K2 extends keyof TValues[K0][K1] ? K3 extends keyof TValues[K0][K1][K2] ? keyof TValues[K0][K1][K2][K3] : never : never : never : never : never;
['5']?: TPath extends {
['0']: infer K0;
['1']: infer K1;
['2']: infer K2;
['3']: infer K3;
['4']: infer K4;
} ? K0 extends keyof TValues ? K1 extends keyof TValues[K0] ? K2 extends keyof TValues[K0][K1] ? K3 extends keyof TValues[K0][K1][K2] ? K4 extends keyof TValues[K0][K1][K2][K3] ? keyof TValues[K0][K1][K2][K3][K4] : never : never : never : never : never : never;
}
export declare type DeepPathArrayValue> = TPath extends ArrayWithLength<0 | 1 | 2 | 3 | 4 | 5 | 6> ? any : TPath extends ArrayWithLength<0 | 1 | 2 | 3 | 4 | 5> ? TValues[TPath[0]][TPath[1]][TPath[2]][TPath[3]][TPath[4]][TPath[5]] : TPath extends ArrayWithLength<0 | 1 | 2 | 3 | 4> ? TValues[TPath[0]][TPath[1]][TPath[2]][TPath[3]][TPath[4]] : TPath extends ArrayWithLength<0 | 1 | 2 | 3> ? TValues[TPath[0]][TPath[1]][TPath[2]][TPath[3]] : TPath extends ArrayWithLength<0 | 1 | 2> ? TValues[TPath[0]][TPath[1]][TPath[2]] : TPath extends ArrayWithLength<0 | 1> ? TValues[TPath[0]][TPath[1]] : TPath extends ArrayWithLength<0> ? TValues[TPath[0]] : never;
export declare type DeepPath = DeepPathArray | keyof TValues;
export declare type DeepPathValue> = TPath extends DeepPathArray ? DeepPathArrayValue : TPath extends keyof TValues ? TValues[TPath] : any;
export declare type Options = {
control?: TControl;
};
export declare type Validate = (data: TFieldValue) => ValidateResult | Promise;
export declare type ValidationRules = Partial<{
required: Message | ValidationRule;
min: ValidationRule;
max: ValidationRule;
maxLength: ValidationRule;
minLength: ValidationRule;
pattern: ValidationRule;
validate: Validate | Record>;
}>;
export declare type Assign = TValues & Omit;
export declare type ControllerProps, TAs extends 'input' | 'select' | 'textarea'> = Assign<{
name: TFieldName;
as?: TAs;
rules?: ValidationRules>;
onFocus?: () => void;
defaultValue?: DeepPathValue;
render?: (props: {
onChange: (...event: any[]) => void;
onBlur: () => void;
value: DeepPathValue;
}) => React.ReactElement;
}, JSX.IntrinsicElements[TAs]>;