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<Options["groupBy"]> as TranslateFunctionField<FieldMap, Field>]: TranslateFunctionField<NamesMap, Field> extends keyof Item ? Item[TranslateFunctionField<NamesMap, Field>] : never } : 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]: AggregationTypes[Func]["output"] }[Field] } : Options["aggregate"][Func] extends string ? Options["aggregate"][Func] extends "*" ? AggregationTypes[Func]["output"] : { [SubField in Options["aggregate"][Func]]: AggregationTypes[Func]["output"] }[Options["aggregate"][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