Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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;
}
>
& ({
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]
§
TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
[src]

§Type

§
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;
}
>
& ({
pattern?: ValidationRule<RegExp>;
valueAsNumber?: false;
valueAsDate?: false;
}
| {
pattern?: undefined;
valueAsNumber?: false;
valueAsDate?: true;
}
| {
pattern?: undefined;
valueAsNumber?: true;
valueAsDate?: false;
}
)
[src]