declare module 'mongoose' { type SchemaValidator = RegExp | [RegExp, string] | Function | [Function, string] | ValidateOpts | ValidateOpts[]; interface ValidatorProps { path: string; fullPath: string; value: any; reason?: Error; } interface ValidatorMessageFn { (props: ValidatorProps): string; } type ValidateFn = (this: EnforcedDocType, value: any, props?: ValidatorProps & Record) => boolean; type AsyncValidateFn = (this: EnforcedDocType, value: any, props?: ValidatorProps & Record) => Promise; interface ValidateOpts { msg?: string; message?: string | ValidatorMessageFn; type?: string; validator: ValidateFn | AsyncValidateFn; propsParameter?: boolean; } }