Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

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

• Collection extends AllCollections<Schema>

• Options extends AggregationOptions<Schema, Collection>

Defined in ​

types/aggregate.ts:79