|
|
@ -108,9 +108,9 @@ function useForm(
|
|
|
|
resetFields: (newValues?: Props) => void;
|
|
|
|
resetFields: (newValues?: Props) => void;
|
|
|
|
validate: <T = any>(names?: namesType, option?: validateOptions) => Promise<T>;
|
|
|
|
validate: <T = any>(names?: namesType, option?: validateOptions) => Promise<T>;
|
|
|
|
validateField: (
|
|
|
|
validateField: (
|
|
|
|
name?: string,
|
|
|
|
name: string,
|
|
|
|
value?: any,
|
|
|
|
value: any,
|
|
|
|
rules?: [Record<string, unknown>],
|
|
|
|
rules: Record<string, unknown>[],
|
|
|
|
option?: validateOptions,
|
|
|
|
option?: validateOptions,
|
|
|
|
) => Promise<RuleError[]>;
|
|
|
|
) => Promise<RuleError[]>;
|
|
|
|
mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo;
|
|
|
|
mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo;
|
|
|
@ -236,8 +236,8 @@ function useForm(
|
|
|
|
const validateField = (
|
|
|
|
const validateField = (
|
|
|
|
name: string,
|
|
|
|
name: string,
|
|
|
|
value: any,
|
|
|
|
value: any,
|
|
|
|
rules: any,
|
|
|
|
rules: Record<string, unknown>[],
|
|
|
|
option: validateOptions,
|
|
|
|
option: validateOptions = {},
|
|
|
|
): Promise<RuleError[]> => {
|
|
|
|
): Promise<RuleError[]> => {
|
|
|
|
const promise = validateRules(
|
|
|
|
const promise = validateRules(
|
|
|
|
[name],
|
|
|
|
[name],
|
|
|
|