Yes, but your TypeScript code has to be checked against the libraries in node_modules, and it is significantly costlier to check against implementation files (the .ts/.mts files) than the produced declaration files (the .d.ts files).
Sure, that's all correct, of course a performance hit would be noticeable if thousands of dependencies would need to be checked additionally.
OP is talking about type stripping nonetheless, and I'd put type stripping into the same ballpark as reading ambient declarations, performance wise.
Sure, that's all correct, of course a performance hit would be noticeable if thousands of dependencies would need to be checked additionally.
OP is talking about type stripping nonetheless, and I'd put type stripping into the same ballpark as reading ambient declarations, performance wise.