@@ -1222,35 +1222,40 @@ export namespace TypesaurusCore {
1222
1222
infer CustomName
1223
1223
>
1224
1224
? NestedCollection <
1225
- {
1226
- Model : NullifyModel < Model > ;
1227
- Name : CustomName extends string ? CustomName : Name ;
1228
- Id : CustomId extends Id < any > | string
1229
- ? CustomId
1230
- : Id < Utils . ComposePath < BasePath , Name > > ;
1231
- WideModel : NullifyModel < Model > ;
1232
- Flags : DocDefFlags ;
1233
- } ,
1225
+ CollectionDef < Name , Model , CustomId , CustomName , BasePath > ,
1234
1226
DB < Schema , Utils . ComposePath < BasePath , Name > >
1235
1227
>
1236
1228
: Schema [ Name ] extends PlainCollection <
1237
1229
infer Model ,
1238
1230
infer CustomId ,
1239
1231
infer CustomName
1240
1232
>
1241
- ? Collection < {
1242
- Model : NullifyModel < Model > ;
1243
- Name : CustomName extends string ? CustomName : Name ;
1244
- Id : CustomId extends Id < any > | string
1245
- ? CustomId
1246
- : Id < Utils . ComposePath < BasePath , Name > > ;
1247
- WideModel : NullifyModel < Model > ;
1248
- Flags : DocDefFlags ;
1249
- } >
1233
+ ? Collection <
1234
+ CollectionDef < Name , Model , CustomId , CustomName , BasePath >
1235
+ >
1250
1236
: never
1251
1237
: never ;
1252
1238
} ;
1253
1239
1240
+ /**
1241
+ * Resolves collection def.
1242
+ */
1243
+ export type CollectionDef <
1244
+ Name extends string ,
1245
+ Model extends ModelType ,
1246
+ CustomId ,
1247
+ CustomName ,
1248
+ BasePath extends string | false ,
1249
+ > = {
1250
+ Model : NullifyModel < Model > ;
1251
+ Name : CustomName extends string ? CustomName : Name ;
1252
+ Id : CustomId extends Id < any > | string
1253
+ ? CustomId
1254
+ : Id < Utils . ComposePath < BasePath , Name > > ;
1255
+ WideModel : NullifyModel < Model > ;
1256
+ Flags : DocDefFlags ;
1257
+ } ;
1258
+
1254
1259
/**
1255
1260
* Infers schema types. Useful to define function arguments that accept
1256
1261
* collection doc, ref, id or data.
0 commit comments