Typed column definitions
Columns are declared as an array of column definition objects that are generic over the row type. The `field` key is checked against the row shape at compile time, so a typo fails the build instead of rendering an empty column. This gives TypeScript users autocompletion and refactor safety. JavaScript users get the same runtime behaviour without type checking.
Planned. This page shows the specification from issue #184. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid of 20 orders with typed columns for id, customer, total and status. A side panel shows the TypeScript source with inline type annotations.
Expected behavior
Switching the source language changes only the displayed code, not the grid output. Adding the nested-path column renders the city values. In the TypeScript tab, an annotated snippet shows the compile error produced by an invalid field name.
Planned API surface
columnsColumnDef<TRow, TValue>fieldidheaderwidthminWidthmaxWidthvalueGetterWarGrid<TRow>Acceptance criteria
- ColumnDef<TRow> restricts `field` to the keys of TRow, including dot-notation nested paths up to depth 4. (pending)
- A column without `field` or `valueGetter` renders empty cells and logs exactly one dev-mode warning per column id. (pending)
- When `id` is omitted, the column id is derived from `field` and is unique; duplicate ids produce a dev-mode warning and are suffixed deterministically. (pending)
- valueGetter receives a params object whose `row` property is typed as TRow. (pending)
- A type-level test suite (tsd or equivalent) verifies that invalid fields fail to compile. (pending)