Skip to content
On this page

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/sdk / types / AggregationOutput

Type alias: AggregationOutput<Schema, Collection, Options>

AggregationOutput<Schema, Collection, Options>: Options["groupBy"] extends string[] ? UnpackList<GetCollection<Schema, Collection>> extends infer Item ? Item extends object ? 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 extends object

Collection extends AllCollections<Schema>

Options extends AggregationOptions<Schema, Collection>

Source

types/aggregate.ts:79