diff --git a/packages/types/src/documents/app/view.ts b/packages/types/src/documents/app/view.ts index 2572ddba5d..24dad0bcca 100644 --- a/packages/types/src/documents/app/view.ts +++ b/packages/types/src/documents/app/view.ts @@ -37,6 +37,19 @@ export type ViewUIFieldMetadata = UIFieldMetadata & { readonly?: boolean } +export enum CalculationType { + SUM = "sum", + AVG = "avg", + COUNT = "count", + MIN = "min", + MAX = "max", +} + +export type ViewCalculationFieldMetadata = ViewUIFieldMetadata & { + calculationType: CalculationType + field: string +} + export interface ViewV2 { version: 2 id: string @@ -49,7 +62,7 @@ export interface ViewV2 { order?: SortOrder type?: SortType } - schema?: Record + schema?: Record } export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema