From 481f7ec1afec28deb93528aa3699b4fc91db7e7a Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Fri, 14 Jun 2024 10:08:26 -0400 Subject: [PATCH] types: avoid inferring Boolean, Buffer, ObjectId as Date in schema definitions under certain circumstances Fix #14630 --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 20177d9d37d..bbaa4f66901 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -493,7 +493,7 @@ declare module 'mongoose' { export type NumberSchemaDefinition = typeof Number | 'number' | 'Number' | typeof Schema.Types.Number; export type StringSchemaDefinition = typeof String | 'string' | 'String' | typeof Schema.Types.String; export type BooleanSchemaDefinition = typeof Boolean | 'boolean' | 'Boolean' | typeof Schema.Types.Boolean; - export type DateSchemaDefinition = typeof NativeDate | 'date' | 'Date' | typeof Schema.Types.Date; + export type DateSchemaDefinition = DateConstructor | 'date' | 'Date' | typeof Schema.Types.Date; export type ObjectIdSchemaDefinition = 'ObjectId' | 'ObjectID' | typeof Schema.Types.ObjectId; export type SchemaDefinitionWithBuiltInClass = T extends number