RegisterOptions
type RegisterOptions<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Partial<{
required: Message | ValidationRule<boolean>;
min: ValidationRule<number | string>;
max: ValidationRule<number | string>;
maxLength: ValidationRule<number>;
minLength: ValidationRule<number>;
validate: Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
value: FieldPathValue<TFieldValues, TFieldName>;
setValueAs: (value: any) => any;
shouldUnregister?: boolean;
onChange?: (event: any) => void;
onBlur?: (event: any) => void;
disabled: boolean;
deps: InternalFieldName | InternalFieldName[];
}> & ({pattern?: ValidationRule<RegExp>;
valueAsNumber?: false;
valueAsDate?: false;
} | {pattern?: undefined;
valueAsNumber?: false;
valueAsDate?: true;
} | {pattern?: undefined;
valueAsNumber?: true;
valueAsDate?: false;
});§Type Parameters
§
TFieldValues extends FieldValues = FieldValues
[src]§Type
§
Partial<{
[src]required: Message | ValidationRule<boolean>;
min: ValidationRule<number | string>;
max: ValidationRule<number | string>;
maxLength: ValidationRule<number>;
minLength: ValidationRule<number>;
validate: Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
value: FieldPathValue<TFieldValues, TFieldName>;
setValueAs: (value: any) => any;
shouldUnregister?: boolean;
onChange?: (event: any) => void;
onBlur?: (event: any) => void;
disabled: boolean;
deps: InternalFieldName | InternalFieldName[];
}> & ({pattern?: ValidationRule<RegExp>;
valueAsNumber?: false;
valueAsDate?: false;
} | {pattern?: undefined;
valueAsNumber?: false;
valueAsDate?: true;
} | {pattern?: undefined;
valueAsNumber?: true;
valueAsDate?: false;
})