diff --git a/types/validation.d.ts b/types/validation.d.ts index 3e6d0671a64..7d8924c5880 100644 --- a/types/validation.d.ts +++ b/types/validation.d.ts @@ -12,7 +12,7 @@ declare module 'mongoose' { } interface ValidateFn { - (value: T): boolean; + (value: T, props?: ValidatorProps & Record): boolean; } interface LegacyAsyncValidateFn { @@ -20,7 +20,7 @@ declare module 'mongoose' { } interface AsyncValidateFn { - (value: any): Promise; + (value: T, props?: ValidatorProps & Record): Promise; } interface ValidateOpts { @@ -28,5 +28,6 @@ declare module 'mongoose' { message?: string | ValidatorMessageFn; type?: string; validator: ValidateFn | LegacyAsyncValidateFn | AsyncValidateFn; + propsParameter?: boolean; } }