import { ReactNode } from 'react'; import { AthenaReadQueryColumn } from '../../../../athena/table-query-executor.js'; import { AthenaTableColumn } from '../core/data-table.js'; import { AthenaTableSortNulls, AthenaTableSortStrategy, AthenaTableSortStrategyName } from './table-sort-strategies.js'; import { AthenaTableFormatConfig } from './table-value-formatters.js'; import { AthenaTableChipConfig } from './table-value-utils.js'; /** * Query column + serializable presentation metadata for AthenaTable. * * Strip with {@link toReadQueryColumns} before `useAthenaQuery` / * `executeAthenaReadQuery`. Map with {@link toAthenaTableColumns} for the UI. */ export type AthenaTableViewColumn = AthenaReadQueryColumn & { allowHeaderWrap?: boolean; chip?: AthenaTableChipConfig; /** * Ordered values for `sortStrategy: "custom_order"`. * Folded into `AthenaTableColumn.sortStrategy` by the mapper. */ customSortOrder?: readonly string[]; format?: AthenaTableFormatConfig; /** Stable column id for the table; defaults to `key`. */ id?: string; isRowHeader?: boolean; isSortable?: boolean; sortNulls?: AthenaTableSortNulls; sortStrategy?: AthenaTableSortStrategyName | AthenaTableSortStrategy; }; export interface ToAthenaTableColumnsOptions = Record> { /** * Used when neither `format` nor `chip` is set on the view column. * Showcase uses this for smart preview renders. */ defaultRender?: (value: unknown, row: Row, column: AthenaTableViewColumn) => ReactNode; } /** * Drops presentation fields so the result is a portable read-query column list. */ export declare function toReadQueryColumns(columns: readonly AthenaTableViewColumn[]): AthenaReadQueryColumn[]; /** * Maps presentation-aware view columns into `AthenaTable` column configs. * * - `valueKey` ← query `key` (flat row alias after execution) * - `id` ← `id ?? key` * - folds `customSortOrder` + `sortNulls` into `sortStrategy` */ export declare function toAthenaTableColumns = Record>(columns: readonly AthenaTableViewColumn[], options?: ToAthenaTableColumnsOptions): AthenaTableColumn[];