@@ -22,7 +22,7 @@ declare module 'mongoose' {
22
22
23
23
/**
24
24
* @summary Obtains schema Path type.
25
- * @description Obtains Path type by separating path type from other options and calling {@link ResolvePathType }
25
+ * @description Obtains Path type by separating path type from other options and calling {@link ResolveRawPathType }
26
26
* @param {PathValueType } PathValueType Document definition path type.
27
27
* @param {TypeKey } TypeKey A generic refers to document definition.
28
28
*/
@@ -61,14 +61,14 @@ declare module 'mongoose' {
61
61
// so we can directly obtain its path type.
62
62
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
63
63
// If the type key isn't callable, then this is an array of objects, in which case
64
- // we need to call ObtainDocumentType to correctly infer its type.
65
- Array < ObtainDocumentType < Item , any , { typeKey : TypeKey } > > :
64
+ // we need to call InferRawDocType to correctly infer its type.
65
+ Array < InferRawDocType < Item > > :
66
66
IsSchemaTypeFromBuiltinClass < Item > extends true ?
67
67
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
68
68
IsItRecordAndNotAny < Item > extends true ?
69
69
Item extends Record < string , never > ?
70
70
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
71
- Array < ObtainDocumentType < Item , any , { typeKey : TypeKey } > > :
71
+ Array < InferRawDocType < Item > > :
72
72
ObtainRawDocumentPathType < Item , TypeKey > [ ]
73
73
> :
74
74
PathValueType extends ReadonlyArray < infer Item > ?
@@ -77,13 +77,13 @@ declare module 'mongoose' {
77
77
Item extends Record < TypeKey , any > ?
78
78
Item [ TypeKey ] extends Function | String ?
79
79
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
80
- ObtainDocumentType < Item , any , { typeKey : TypeKey } > [ ] :
80
+ InferRawDocType < Item > [ ] :
81
81
IsSchemaTypeFromBuiltinClass < Item > extends true ?
82
82
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
83
83
IsItRecordAndNotAny < Item > extends true ?
84
84
Item extends Record < string , never > ?
85
85
ObtainRawDocumentPathType < Item , TypeKey > [ ] :
86
- Array < ObtainDocumentType < Item , any , { typeKey : TypeKey } > > :
86
+ Array < InferRawDocType < Item > > > :
87
87
ObtainRawDocumentPathType < Item , TypeKey > [ ]
88
88
> :
89
89
PathValueType extends StringSchemaDefinition ? PathEnumOrString < Options [ 'enum' ] > :
@@ -114,6 +114,6 @@ declare module 'mongoose' {
114
114
IfEquals < PathValueType , ObjectConstructor > extends true ? any :
115
115
IfEquals < PathValueType , { } > extends true ? any :
116
116
PathValueType extends typeof SchemaType ? PathValueType [ 'prototype' ] :
117
- PathValueType extends Record < string , any > ? ObtainDocumentType < PathValueType , any , { typeKey : TypeKey } > :
117
+ PathValueType extends Record < string , any > ? InferRawDocType < PathValueType > :
118
118
unknown ;
119
119
}
0 commit comments