svelte-range-slider-pips icon indicating copy to clipboard operation
svelte-range-slider-pips copied to clipboard

[feature request] Type Declaration Files for TypeScript

Open foochris opened this issue 2 years ago • 3 comments

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:

  1. Create a Svelte component and add the following line:
  import RangeSlider from 'svelte-range-slider-pips'
  1. 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

foochris avatar Mar 25 '22 13:03 foochris

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

simeydotme avatar Mar 26 '22 06:03 simeydotme

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.

orefalo avatar Aug 01 '22 21:08 orefalo

🎊 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

markjaquith avatar Jan 27 '23 19:01 markjaquith