fix(Form): improve validate path type (#1370)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Amir Reza Dalir
2024-02-18 02:15:15 -08:00
committed by GitHub
parent d4b6147fcc
commit 5266591c88

View File

@@ -10,8 +10,8 @@ export interface FormErrorWithId extends FormError {
} }
export interface Form<T> { export interface Form<T> {
validate(path?: string, opts?: { silent?: true }): Promise<T | false>; validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false>;
validate(path?: string, opts?: { silent?: false }): Promise<T>; validate(path?: string | string[], opts?: { silent?: false }): Promise<T>;
clear(path?: string): void clear(path?: string): void
errors: Ref<FormError[]> errors: Ref<FormError[]>
setErrors(errs: FormError[], path?: string): void setErrors(errs: FormError[], path?: string): void