import type { AgAggregationFunction } from './agAggregationFunction'; import type { AgDataType } from './agDataType'; import type { AgExpression } from './agExpression'; import type { AgFormat } from './agFieldDefinition'; import type { AgFormatDefinition } from './agFormat'; export type AgFieldIdentifier = string & { readonly __brand: 'AgFieldIdentifier'; }; export type AgFieldType = 'column' | 'calculatedColumn' | 'measure' | 'implicitMeasure'; export interface AgFieldReference { fieldId: AgFieldIdentifier; key: string; aggregation?: AgAggregationFunction | never; } export interface AgExpressionDependencyReference { id: AgFieldIdentifier; aggregation?: AgAggregationFunction; } interface BaseField extends AgFieldReference, AgFormatDefinition { type: AgFieldType; name: string; getName(): string; description: string | undefined; format: AgFormat | undefined; notBlank: boolean; hide?: boolean; } export interface AgColumn extends BaseField { type: 'column'; aggregation?: never; } export interface AgCalculatedColumn extends BaseField { type: 'calculatedColumn'; aggregation?: never; expression: AgExpression; columns: AgExpressionDependencyReference[]; fieldsetDependencies: string[]; } export interface AgMeasure extends BaseField { type: 'measure'; aggregation?: never; expression: AgExpression; columns: AgExpressionDependencyReference[]; fieldsetDependencies: string[]; } export interface AgImplicitMeasure extends BaseField { type: 'implicitMeasure'; aggregation: AgAggregationFunction; } export type AgField = AgColumn | AgCalculatedColumn | AgMeasure; export type AgWidgetField = AgField | AgImplicitMeasure; export type AgFormatFieldValueFunc = (field: AgWidgetField, value: TValue | null | undefined) => string; export {};