Check each column's Cell and options, and keep the cell args of declared lists - #203
Merged
NullVoxPopuli merged 1 commit intoSep 23, 2026
Conversation
…red lists - A column list with a declared type keeps its cell args, like it keeps its column meta. A shared component that takes `ColumnConfig<Row, unknown, unknown, CellArgs>[]` from its caller can build the table (johanrd#6). - Each column written in place is checked on its own: its Cell takes the row type, the column's meta and the table meta, and when the Cell asks for `@options`, the column's `options` returns them. - A table `meta` together with a callback that has parameters no longer loses the inferred cell args and column meta. The Cell check read the column list while TypeScript was still inferring it. - `CellOptions` and `CellOptionsOf` are exported (johanrd#5). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 23, 2026
NullVoxPopuli
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #202, for the problems johanrd raised there: johanrd#5, johanrd#6, and the
optionsgap. Nothing new needs a type argument. A declared type still replaces the inferred one.Changes
ColumnConfig<Row, unknown, unknown, CellArgs>[]from its caller can build the table. The args come from a type-only[cellArgsType]property, as in Keep the cell args a declared column list states johanrd/table#6. It is read only when the elements have that property. Object literals do not have it, so a list written in place still reads its Cells.meta, and the table meta. When the Cell asks for@options, the column'soptionsmust return them. Infer the types of column meta and table meta #202 listed that as a limit.metawith a callback that has parameters lost the inference. Onmain, a table with ameta, a Cell with args, and for exampleoptions: ({ row }) => ...lost its cell args and column meta. The Cell was then rejected. The cause is ininstantiateContextualType: once any type parameter has a candidate (hereMeta, frommeta), contextual signatures are instantiated with the inferences made so far, and the Cell check read the column list before it had any. The check now runs per column, through the numeric keys of the inferred list.CellOptionsandCellOptionsOf.optionscheck and shared table components.Tests
declared-cell-args.test.ts: the generic wrapper from Keep the cell args a declared column list states johanrd/table#6, a declared list whose Cells ask for none of its args, and a list written in place.options-check.test.ts:optionsagainst the Cell's@options: wrong type, missing, and on another column. Also the exported types, and the case that failed onmain.cell-args.test.ts: a tablemetaplus a callback keeps the cell args and the column meta.Checked:
tabletype tests pass with TS 5.6, 6.0, and the TS 7 nightly.test-apptype-checks with TS 5.6, 6.0, and the TS 7 nightly.pnpm lint: pass.test-apptests: 189 of 189 pass.nollm --diff origin/main: no problems.🤖 Generated with Claude Code