This is an attempt to create one .d.ts
file for a package already published on npm
without installing the package or it's dependencies.
For example, for puppeteer@13.5.1
all of those .d.ts
es:
│ puppeteer@13.5.1
└──┬ lib/types.dts
│
├─ devtools-protocol@0.0.979918/types/protocol.d.ts
└─ devtools-protocol@0.0.979918/types/protocol-mapping.d.ts
should be bundled together and wrapped in a declare module 'puppeteer' { ... }
, all references from the "root" type should be followed, as in the example above.
More examples can be seen at tests/e2e/simple-e2e.spec.ts
Based on:
- rollup
- rollup-plugin-dts with this PR merged
- ts-resolve from tsup
- Ideas from npm-dts
Local version:
./bin.js puppeteer@13.5.1 bundle.d.ts
via npx:
npx remote-type-bundler puppeteer@13.5.1 bundle.d.ts