js-dos
js-dos copied to clipboard
`types` field not added to `package.json`
Apologies if this is intended behaviour or is a known change
With version 8.3.14, there is no types field in package.json. This means vscode and webpack are unable to link the types correctly (e.g. for DosPlayer).
This is changed from 7.x.x: (link)
Hi! Yes, that’s correct. Instead of using a package, you can simply copy the type definitions directly into your project — I found that more convenient. Here's the file with the types:
https://github.com/caiiiycuk/js-dos/blob/8.xx/src/public/types.ts
I chose this approach because js-dos is an old-school library — you include it via a
Add this file, and then do:
declare const Dos: DosFn;
Thanks @caiiiycuk that makes sense! Will use v7 types for now, and pull down these types above when have time 🙏 ^
For typescript projects, it's a little bit tricky to get at these types out of the box, would you consider allowing packaging the types again, or bundling types into an @types/js-dos package? Happy to raise PR
If not, feel free to close with won't do
Thanks!
@Robbie-Cook I am totally fine, please make PR. Thank you!