Comment Comment by gnud You can approximate something by defining the valid TokenTable keys as an enum, and using a mapped type for the actual TokenTable type.There's some boilerplate in the definition, but it's fairly clean and non-repetitive. And easy to use in the "client code".https://www.typescriptlang.org/play?#code/KYOwrgtgBAKg9ga1AS... parent gnud 4 years ago
There's some boilerplate in the definition, but it's fairly clean and non-repetitive. And easy to use in the "client code".
https://www.typescriptlang.org/play?#code/KYOwrgtgBAKg9ga1AS...