Hacker News new | ask | show | jobs
by rideg 1373 days ago
You can use type guards for something similar: https://www.typescriptlang.org/docs/handbook/advanced-types....
2 comments

What they were getting at is that you can't observe T itself, only values passed in as type T
Keyword similar. I use type guards for other things (like typing JSON responses), but they can't solve this particular problem.