Types for new view calculation feature.
This commit is contained in:
parent
e2a355b4b1
commit
bb8ba16b30
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue