Directus / @directus/sdk / types / AggregationOutput
Type Alias: AggregationOutput<Schema, Collection, Options> ​
AggregationOutput<
Schema
,Collection
,Options
>:Options
["groupBy"
] extendsstring
[] ?UnpackList
<GetCollection
<Schema
,Collection
>> extends infer Item ?Item
extendsobject
?MappedFunctionFields
<Schema
,Item
> extends infer FieldMap ?MappedFieldNames
<Schema
,Item
> extends infer NamesMap ?{ [Field in UnpackList<(...)> as TranslateFunctionField<(...), (...)>]: (...) extends (...) ? (...) : (...) }
:never
:never
:never
:never
:object
&{ [Func in keyof Options["aggregate"]]: Func extends keyof AggregationTypes ? Options["aggregate"][Func] extends string[] ? { [Field in UnpackList<Options["aggregate"][Func]>]: Field extends "*" ? AggregationTypes[Func]["output"] : { [SubField in Field]: (...)[(...)] }[Field] } : Options["aggregate"][Func] extends string ? Options["aggregate"][Func] extends "*" ? AggregationTypes[Func]["output"] : { [SubField in (...)[(...)]]: (...)[(...)] }[(...)[(...)][Func]] : never : never }
[]
Output typing for aggregation
Type Parameters ​
• Schema
• Collection extends AllCollections
<Schema
>
• Options extends AggregationOptions
<Schema
, Collection
>