diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index e6dc35c1ea..c8c3f2dda4 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -46,6 +46,7 @@ export interface Schema { default(value?: any): this; nullable(isNullable: boolean): this; required(message?: string): this; + notRequired(): this; typeError(message?: string): this; oneOf(arrayOfValues: any[], message?: string): this; notOneOf(arrayOfValues: any[], message?: string): this; diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 9dd02ced73..0c0aa04c47 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -100,6 +100,7 @@ mixed.default(() => ({ number: 5})); mixed.default(); mixed.nullable(true); mixed.required(); +mixed.notRequired(); // $ExpectType MixedSchema mixed.typeError('type error'); mixed.oneOf(['hello', 'world'], 'message'); mixed.notOneOf(['hello', 'world'], 'message');