Declaration file
The layout of your declaration files should mirror
the layout of the library.
A library can consist of multiple modules.
Your declaration files should thus be
@types/myLib
+---- index.d.ts
+---- foo.d.ts
+---- bar
+---- index.d.ts
+---- baz.d.ts
Recommend you:
- Create a new file in the root of your source tree: [libname].d.ts
- Add declare module “[libname]” { }
- Add the template inside the braces of the declare module, and see where your usage breaks