import type { DataType } from '../../api/agDataType'; import type { FieldKey } from '../../shared/fieldKey'; import type { ColumnExtraData, ColumnStorageType } from './agColumnData'; /** * Unified metadata interface for column information. * Provides a stable API for widgets without requiring knowledge of storage implementation. * * This interface is designed to be accessed through the ExecuteResult.metadata.columns map * rather than diving into column internals. */ export interface AgColumnMetadata { /** * The field key that uniquely identifies this column. */ fieldKey: FieldKey; /** * The data type of values in this column. */ dataType: DataType; /** * The storage format used for this column. */ storageType: ColumnStorageType; /** * Number of visible rows (after any filtering). */ length: number; /** * Number of unique values in this column, if computed. * May be undefined if not applicable or not computed. */ cardinality?: number; /** * Minimum value (for numeric columns only). */ min?: number; minBigInt?: bigint; /** * Maximum value (for numeric columns only). */ max?: number; maxBigInt?: bigint; /** * Sum of all values (for numeric columns only). */ sum?: number; sumBigInt?: bigint; /** * Number of null/undefined values in this column. */ nullCount?: number; /** * True if row indices have been applied (data is filtered/subset). */ filtered: boolean; /** * True if data is in materialized form (no row indices). */ materialized: boolean; /** * Full statistics object for advanced use cases. * Prefer using typed fields above when possible. */ stats?: ColumnExtraData; }