From d8914103a3da87668ef6a1b6a2350b3ac2a20b9c Mon Sep 17 00:00:00 2001 From: Joge Date: Tue, 7 Nov 2017 13:46:50 +0100 Subject: [PATCH 1/2] fix(SchemaDefinition): add missing Schema and SchemaType declarations --- types/mongoose/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 261b8ade84..16432687fa 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -473,7 +473,7 @@ declare module "mongoose" { /** defaults to 1 */ parallel?: number; } - + /* * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js @@ -764,7 +764,7 @@ declare module "mongoose" { * Intellisense for Schema definitions */ interface SchemaDefinition { - [path: string]: SchemaTypeOpts; + [path: string]: SchemaTypeOpts | Schema | SchemaType; } /* @@ -2680,7 +2680,7 @@ declare module "mongoose" { passRawResult?: boolean; /** overwrites the schema's strict mode option for this update */ strict?: boolean; - /** + /** * if true, run all setters defined on the associated model's schema for all fields * defined in the query and the update. */ From 18ad4aba5ae7f0967144f75c06c34a8cbe3394f4 Mon Sep 17 00:00:00 2001 From: Joge Date: Tue, 7 Nov 2017 15:04:43 +0100 Subject: [PATCH 2/2] fix(Tests): fix implicit any error --- types/mongoose/mongoose-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 7216ed73fb..d6f262ebf6 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -368,8 +368,8 @@ new mongoose.Schema({d: {type: Date, min: [ new mongoose.Schema({ integerOnly: { type: Number, - get: v => Math.round(v), - set: v => Math.round(v) + get: (v: number) => Math.round(v), + set: (v: number) => Math.round(v) } }); new mongoose.Schema({ name: { type: String, validate: [