1
0
Fork 0
mirror of synced 2024-09-20 03:08:18 +12:00

Types for new view calculation feature.

This commit is contained in:
Sam Rose 2024-09-02 15:28:20 +01:00
parent e2a355b4b1
commit bb8ba16b30
No known key found for this signature in database

View file

@ -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<string, ViewUIFieldMetadata>
schema?: Record<string, ViewUIFieldMetadata | ViewCalculationFieldMetadata>
}
export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema