mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
[yup] fix return types of validate and validateSync
This commit is contained in:
Vendored
+2
-2
@@ -37,8 +37,8 @@ export interface Schema<T> {
|
||||
meta(): any;
|
||||
describe(): SchemaDescription;
|
||||
concat(schema: this): this;
|
||||
validate(value: T, options?: ValidateOptions): Promise<ValidationError | T>;
|
||||
validateSync(value: T, options?: ValidateOptions): ValidationError | T;
|
||||
validate(value: T, options?: ValidateOptions): Promise<T>;
|
||||
validateSync(value: T, options?: ValidateOptions): T;
|
||||
isValid(value: T, options?: any): Promise<boolean>;
|
||||
isValidSync(value: T, options?: any): boolean;
|
||||
cast(value: any, options?: any): T;
|
||||
|
||||
@@ -307,7 +307,7 @@ const testObject: MyInterface = {
|
||||
arrayField: ["hi"],
|
||||
};
|
||||
|
||||
typedSchema.validateSync(testObject); // $ExpectType ValidationError | MyInterface
|
||||
typedSchema.validateSync(testObject); // $ExpectType MyInterface
|
||||
|
||||
// $ExpectError
|
||||
yup.object<MyInterface>({
|
||||
|
||||
Reference in New Issue
Block a user