How can I provide a hand-authored declaration file in a ts project?

100 Views Asked by At

I have these files:

  • foo.ts
  • foo.d.ts (hand-authored)
  • bar.ts

I want to use TypeScript to generate the following output

  • foo.js
  • foo.d.ts (same as my hand-authored one)
  • bar.ts
  • bar.d.ts

TypeScript ignores my hand-authored foo.d.ts in this case and just generates a .d.ts from foo.ts. How can I get TS to pass through hand-authored .d.ts files when there is a corresponding .ts?

0

There are 0 best solutions below