Knowledge · frontend

Deriving Types from Values — Indexed Access and const Type Parameters

How to keep a list of allowed values in one place and compute the type from it instead of writing the list twice, plus the trap where widening silently removes that protection without a single error

Date
2026-08-23
Reading time
7 min
Confidence
Inferred

This page is a machine translation of the Korean original. Read the original

Document graph

Related documents

Documents that mention this

Related Knowledge

Tags

typescripttype-inferenceindexed-accessconst-type-parametersingle-source-of-truth