Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Type Declaration Files for TypeScript #69

Open
foochris opened this issue Mar 25, 2022 · 3 comments
Open

[feature request] Type Declaration Files for TypeScript #69

foochris opened this issue Mar 25, 2022 · 3 comments
Labels
compatibility enhancement New feature or request feature request help wanted Extra attention is needed

Comments

@foochris
Copy link

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 foochris added bug Something isn't working investigating Not quite sure if it's valid, yet labels Mar 25, 2022
@simeydotme simeydotme added enhancement New feature or request help wanted Extra attention is needed compatibility feature request and removed bug Something isn't working investigating Not quite sure if it's valid, yet labels Mar 26, 2022
@simeydotme
Copy link
Owner

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 simeydotme changed the title [bug] Upon running svelte-check, a hint is displayed stating that a type declaration for svelte-range-slider-pips could not be found [feature request] Type Declaration Files for TypeScript Mar 26, 2022
@orefalo
Copy link

orefalo commented Aug 1, 2022

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.

@markjaquith
Copy link

🎊 Someone submitted typing for this project to DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#62994

💡 You can now do npm i -D @types/svelte-range-slider-pips

@simeydotme simeydotme added this to the Svelte 4+ , Typescript milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility enhancement New feature or request feature request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants