2 ms·
Agree with the code generation approach. Otherwise you need to make sure the annotations are in sync with the type / class / interface. Typescript doesn't supp
by aabbcc1241 7y ago
Agree with the code generation approach. Otherwise you need to make sure the annotations are in sync with the type / class / interface.
Typescript doesn't support macro currently, so code generation is the only way to programmatically create 'type-checked' code.
Some cli-tool and library I'm using (available on npm):
tsc-macro: https://github.com/beenotung/tsc-macro https://github.com/beenotung/tsc-macro
gen-ts-type: https://github.com/beenotung/gen-ts-type https://github.com/beenotung/gen-ts-type
ts-type-check: https://github.com/beenotung/ts-type-check https://github.com/beenotung/ts-type-check