File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1217,4 +1217,11 @@ function gh13800() {
1217
1217
expectType < string > ( this . lastName ) ;
1218
1218
expectError < string > ( this . someOtherField ) ;
1219
1219
} ) ;
1220
- }
1220
+ }
1221
+
1222
+ async function gh13797 ( ) {
1223
+ interface IUser {
1224
+ name : string ;
1225
+ }
1226
+ const schema2 = new Schema < IUser > ( { name : { type : String , required : function ( ) { expectType < IUser > ( this ) ; return true } } } ) ;
1227
+ }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ declare module 'mongoose' {
39
39
40
40
type DefaultType < T > = T extends Schema . Types . Mixed ? any : Partial < ExtractMongooseArray < T > > ;
41
41
42
- class SchemaTypeOptions < T , EnforcedDocType = { } > {
42
+ class SchemaTypeOptions < T , EnforcedDocType = any > {
43
43
type ?:
44
44
T extends string ? StringSchemaDefinition :
45
45
T extends number ? NumberSchemaDefinition :
You can’t perform that action at this time.
0 commit comments