jacobmischka / svelte-flatpickr

Flatpickr component for Svelte.
https://www.npmjs.com/package/svelte-flatpickr
MIT License
162 stars 23 forks source link

Typescript types? #28

Closed frederikhors closed 3 years ago

frederikhors commented 3 years ago

Why this error in a Svelte Typescript project?

Could not find a declaration file for module 'svelte-flatpickr'. 'C:/project/node_modules/svelte-flatpickr/dist/index.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/svelte-flatpickr` if it exists or add a new declaration (.d.ts) file containing `declare module 'svelte-flatpickr';` (ts)
jacobmischka commented 3 years ago

That's an extremely common warning that happens with any dependency that doesn't have types. Please feel free to contribute types to the @types project as indicated in the warning if you'd like to resolve it. Or just ignore the warning like I always do for untyped deps.

frederikhors commented 3 years ago

You don't want to add them to this project?

jacobmischka commented 3 years ago

Sure, feel free to submit a .d.ts if you'd like, that's better I suppose.

jacobmischka commented 3 years ago

I started this here: https://github.com/jacobmischka/svelte-flatpickr/tree/add-types

Would appreciate anyone more familiar with external type definitions and/or svelte typings to take a look!

jacobmischka commented 3 years ago

Fixed in 200fcc7ec2b6c573de4796c9a155516f640f9fe7, published in 3.2.0. Related issues and suggestions expected and welcome!