Spector.js icon indicating copy to clipboard operation
Spector.js copied to clipboard

Add TypeScript types to release

Open Juice10 opened this issue 3 years ago • 5 comments

Adds typescript types to the release to make it much easier for people to use Spector.js with typescript

Docs on the subject: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

Juice10 avatar Jan 04 '22 13:01 Juice10

Looks like we need to do one more step to get this working correctly.

Currently I'm getting the following error when importing this project into a typescript file: File '.../node_modules/spectorjs/dist/spector.d.ts' is not a module

Juice10 avatar Jan 04 '22 13:01 Juice10

That's because the declaration file is namespace-based and not module-based. It needs to be changed (regenerated) to support modules

RaananW avatar Jan 05 '22 11:01 RaananW

FYI, you can use tsup to generate type declarations for a bundle.

wdanilo avatar Jan 23 '23 11:01 wdanilo

Any updates?

nerdError avatar Oct 05 '23 00:10 nerdError

last I tried tsup was not generating the bundled typings correctly :-( Would really appreciate a contrib on this subject

sebavan avatar Oct 05 '23 16:10 sebavan