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; } interface ValidateFn { (value: T, props?: ValidatorProps & Record): boolean; } interface LegacyAsyncValidateFn { (value: T, done: (result: boolean) => void): void; } interface AsyncValidateFn { (value: T, props?: ValidatorProps & Record): Promise; } interface ValidateOpts { msg?: string; message?: string | ValidatorMessageFn; type?: string; validator: ValidateFn | LegacyAsyncValidateFn | AsyncValidateFn; propsParameter?: boolean; } }