import type { RowNode } from '../types/row.types'; import type { ColumnDef } from '../types/column.types'; import type { IconRenderer } from '../icons/icon-renderer'; export interface CellRenderContext { row: RowNode; colDef: ColumnDef; rowIndex: number; colIndex: number; iconRenderer: IconRenderer; dateFormat?: string; timeZone?: string; currencySymbol?: string; locale?: string; api: unknown; /** * Whether the grid permits editing at all (`GridOptions.editing.mode !== 'none'`). * * Only `boolean` columns consult it, and only to decide whether their * checkbox is interactive: a checkbox that looks clickable but silently * refuses to commit is worse than one that is visibly disabled. Optional and * treated as `true` when omitted, so a caller that renders a cell outside a * configured grid (tests, one-off previews) gets the permissive default. */ editingEnabled?: boolean; } export { BOOLEAN_CELL_CHECKBOX_CLASS, buildBooleanCellCheckbox, isBooleanCellEditable, syncBooleanCellCheckbox, } from './built-in/checkbox-element'; export declare class CellRenderer { renderCell(ctx: CellRenderContext): HTMLElement; /** * Fills a `.pg-cell__inner` element with a cell's content. * * Extracted from {@link renderCell} so the Virtual DOM's cell patcher can * re-render a changed cell **into its existing element** using the exact same * code path as the initial render — a custom renderer, an HTML cell and a * built-in type all behave identically whether the cell was just created or * patched in place. Existing children are discarded first, so the call is * idempotent. * * @param inner - The `.pg-cell__inner` element to fill (cleared first). * @param value - Logical value (post `valueGetter`). * @param rawValue - Underlying field value, for renderers that need both. * @param ctx - Render context (column, indices, formatting, api). */ renderCellContent(inner: HTMLElement, value: unknown, rawValue: unknown, ctx: CellRenderContext): void; /** * The string a text-producing renderer starts from. * * Routed through `formatCellValue`, so a column `valueFormatter` has already * won over the type's default formatting by the time a renderer sees it — * which is what lets `renderer: 'currency'` and a `valueFormatter` coexist * instead of one silently discarding the other. */ private formatFor; /** Adapts a {@link CellRenderContext} into the context a built-in renderer receives. */ private buildRenderContext; /** * Resolves the dynamic class contributed by `ColumnDef.cellCssClass`. * * Returns `''` when the column declares none, so callers can compare the * result against a previously applied class and swap only on change. * * @param value - Logical value (post `valueGetter`). * @param rawValue - Underlying field value. * @param ctx - Render context. * @returns The class name to apply, or `''`. */ resolveDynamicClass(value: unknown, rawValue: unknown, ctx: CellRenderContext): string; /** * `true` when a column's cells render as plain text and can therefore be * patched by writing a single string, with no element creation at all. * * Delegates to the resolved renderer's own `textOnly` declaration, so a * newly-registered renderer is classified correctly without this method * knowing it exists. * * @param colDef - Column to classify. */ isTextOnlyColumn(colDef: ColumnDef): boolean; renderCheckboxCell(row: RowNode, rowIndex: number): HTMLElement; /** * Renders a serial (row-number) gutter cell. * * When `selectable` is `true` the cell becomes an AG Grid–style selection * column entry: it carries the row's `data-node-id` and `aria-selected`, is * focusable, and gets the `pg-cell--serial-select` class so `GridRenderer` * can start a row drag-selection from it. Purely a display gutter otherwise. */ renderSerialNumberCell(row: RowNode, displayIndex: number, selectable?: boolean): HTMLElement; updateCellSelection(cell: HTMLElement, selected: boolean): void; updateCellActive(cell: HTMLElement, active: boolean): void; } //# sourceMappingURL=cell-renderer.d.ts.map