1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00
budibase/packages/types/src/documents/app/view.ts
2022-05-20 12:29:31 +01:00

44 lines
662 B
TypeScript

export interface View {
name: string
tableId: string
field?: string
filters: ViewFilter[]
schema: ViewSchema
calculation?: ViewCalculation
}
export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema
export interface ViewCountOrSumSchema {
field: string
value: string
}
/**
e.g:
"min": {
"type": "number"
},
"max": {
"type": "number"
}
*/
export interface ViewStatisticsSchema {
[key: string]: {
type: string
}
}
export interface ViewFilter {
value: any
condition: string
key: string
conjunction?: string
}
export enum ViewCalculation {
SUM = "sum",
COUNT = "count",
STATISTICS = "stats",
}