u/ElPirer97in r/typescript • Recommends
On “Using "new" keyword from .d.ts file causes "Error: Can't walk dependency graph: Cannot find module"”
You should not put runtime code in .d.ts files, they should only define types/interfaces and be paired with a corresponding .js files. If you need to import types from a file into another just use a regular .ts file, if it only contains types/interfaces it will get completely erased when transpiling. This video by Matt Pocock explains it beautifully.