#TypeScript gets a stroke after moving an interface

13 messages · Page 1 of 1 (latest)

vagrant trail
#

why are you writing .d.ts in a .ts project?

#

.ts.js + .d.ts
if you're writing .ts, you generally shouldn't be writing .d.ts

#

why is that an issue? if you're using type-only imports they won't be imported either

#

you could also put your types with your implementations rather than having type-only files

#

you're still writing .ts, right...?

#

anyways, files with only export {} in the build aren't typically considered issues since it's not really consequential at all and you wouldn't usually be looking at the build anyways

brazen bear
#

Your first file is a module

#

The declare module code augments (adds to) the types of the module

#

The second file is a .d.ts file without any imports or exports, so this file is global

#

Declare module in this context overwrites the definitions for that module globally

#

I'm not sure if there is a practical way to augment module from global space

brazen bear
#

I'd suggest using a .ts file not a .d.ts file, because with skipLibCheck on your .d.ts files won't be type checked. And with skip off tsc will be slow.

#

Other than that, you can add export {} at the end of a global file to make it into a module