Closed pzuraq closed 2 years ago
Hi Chris, you are right.
I have added JSX definitions of actions to let the language tools recognise a return type.
Unfortunately the language tools read the types for templates from global TS types. And regular npm package cannot expose global types (for a good reason).
I added these definitions anyway and exposed them as global from the package. The only thing needed now is to reexpose them from your project (as only the top package can really tell what is global)
Once you install svelte-gestures. 1.3.7, you can remove your addition from global.d.ts and replace it with
/// <reference types="svelte-gestures" />
just beware that this line of code must be very first in your global.d.ts file. Or straight after similar line :)
It contains types for all of the gestures. Now when I get it working I'll add it to the documentation as well
Thanks for reporting ;)
Rezi
Sounds good, thanks for the quick response!
Getting this error in a SvelteKit/TypeScript project with the following usage:
I had to add this to my
global.d.ts
to fix it:Is there a better way to do this? If not, should this be documented?