diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 3b45b3fcaa..243cb985c1 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -37,8 +37,8 @@ export interface Schema { meta(): any; describe(): SchemaDescription; concat(schema: this): this; - validate(value: T, options?: ValidateOptions): Promise; - validateSync(value: T, options?: ValidateOptions): ValidationError | T; + validate(value: T, options?: ValidateOptions): Promise; + validateSync(value: T, options?: ValidateOptions): T; isValid(value: T, options?: any): Promise; isValidSync(value: T, options?: any): boolean; cast(value: any, options?: any): T; diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 0ce88a6c66..871df0e8e0 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -307,7 +307,7 @@ const testObject: MyInterface = { arrayField: ["hi"], }; -typedSchema.validateSync(testObject); // $ExpectType ValidationError | MyInterface +typedSchema.validateSync(testObject); // $ExpectType MyInterface // $ExpectError yup.object({