5 ms·
> To make a JS package consumable by a reasonably strict TS project... I’m not sure what you mean by “strict” here... Certainly one can use JavaScript from Typ
by jt2190 6y ago
> To make a JS package consumable by a reasonably strict TS project...
I’m not sure what you mean by “strict” here... Certainly one can use JavaScript from TypeScript, and even provide type information for the JS with declaration files. [1] Does a “strict” project require something beyond this?
[1] “Declaration Files”, TypeScript Handbook https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html https://www.typescriptlang.org/docs/handbook/declaration-fil...
- Kinrany 6y agoType information is easy to half-ass: list all the exports, mark them as 'string', 'Object', 'Function', done. Adding the actually correct and reliable types is the hard part. (But easier than writing the code in the first place.)