Summary of my own interpretation of it: .d.ts is for typescript types with an associated .js "real file". They often get excluded from type checking due to skipLibCheck: true, which can be not good. The recommended solution appears to be: just use normal .ts files. TypeScript will remove all the type code (since that's what tsc does after all 😉) and the import will be dropped entirely since it was all just types. Thus, the same end result.
https://www.youtube.com/watch?v=zu-EgnbmcLY Basically this 👆 by Matt Pocock https://www.mattpocock.com/
Summary of my own interpretation of it: .d.ts is for typescript types with an associated .js "real file". They often get excluded from type checking due to
skipLibCheck: true
, which can be not good. The recommended solution appears to be: just use normal .ts files. TypeScript will remove all the type code (since that's whattsc
does after all 😉) and the import will be dropped entirely since it was all just types. Thus, the same end result.