declare module 'mongoose' { type SchemaValidator = RegExp | [RegExp, string] | Function | [Function, string] | ValidateOpts | ValidateOpts[]; interface ValidatorProps { path: string; value: any; } interface ValidatorMessageFn { (props: ValidatorProps): string; } interface ValidateFn { (value: T): boolean; } interface LegacyAsyncValidateFn { (value: T, done: (result: boolean) => void): void; } interface AsyncValidateFn { (value: any): Promise; } interface ValidateOpts { msg?: string; message?: string | ValidatorMessageFn; type?: string; validator: ValidateFn | LegacyAsyncValidateFn | AsyncValidateFn; } }