svelte-range-slider-pips
svelte-range-slider-pips copied to clipboard
[feature request] Type Declaration Files for TypeScript
Describe the bug
Upon running yarn run check
, a hint is outputted stating the a declaration file for the module could not be found
Steps to reproduce the behavior:
- Create a Svelte component and add the following line:
import RangeSlider from 'svelte-range-slider-pips'
- Run the command:
yarn run check
(svelte-check --tsconfig ./tsconfig.json
)
Expected behavior
- No hint should be displayed
- A type package,
@types/svelte-range-slider-pips
, should be made available
Screenshots
Hint: Could not find a declaration file for module 'svelte-range-slider-pips'. '/node_modules/svelte-range-slider-pips/dist/svelte-range-slider-pips.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/svelte-range-slider-pips` if it exists or add a new declaration (.d.ts) file containing `declare module 'svelte-range-slider-pips';` (ts)
import Fa from 'svelte-fa'
import RangeSlider from 'svelte-range-slider-pips'
Device/Environtment
Additional context
- N/A
hi @foochris am I right in assuming you're filing a issue because you're trying to build a TypeScript project and include this JavaScript module, and then when your TypeScript project runs a status check, it warns you that there's no TypeScript declaration for this JavaScript module?
If you know how, and want to add a type declaration file to this project, I'd be happy to entertain a Merge Request (pull request), so long as you put a type declaration test in the /test/
folder, as well. I will not be adding TypeScript code myself to this project, though.
Thanks
Found this issue as the problem showed up on https://github.com/orefalo/svelte-splitpanes
An easy way to get this project typed, it to convert the code to typescript. It's relatively trivial for an existing (well written) JS project.
🎊 Someone submitted typing for this project to DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62994
💡 You can now do npm i -D @types/svelte-range-slider-pips