Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
matt_kantor
on July 8, 2023
|
parent
|
context
|
favorite
| on:
TypeScript please give us reflection/runtime types
This already exists. One example posted elsewhere in these comments is tst-reflect[1], with which you can write this:
const fooType = getType<Foo>();
Which is exactly what you wanted, just as a plugin to TypeScript rather than built into the official compiler.
[1]:
https://www.npmjs.com/package/tst-reflect
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
[1]: https://www.npmjs.com/package/tst-reflect