Closed Trombach closed 1 year ago
Hey @Trombach thanks for the PR, I'll take a look today :)
All done @Trombach , version 3.0.2 is on npm now :) Thanks for your help again :)
Awesome! Thanks so much. Types are properly derived in my html templates again :)
Hey @Trombach are you sure that the types are working correctly now? I specifically mean the handlers -> on:enter
etc
Hi @maciekgrzybek, it seems to be working for me. In this little test component
<script lang="ts">
import { inview } from 'svelte-inview';
</script>
<div use:inview on:enter={(event) => console.log(event)} />
the type of event
is correctly inferred as CustomEvent<ObserverEventDetails>
in VSCode, which is what is declared in the DTS file.
Is there anything in particular that makes you think it's not working? :thinking: Happy to help if I can :)
It's all good :) I just switched to Webstorm and it turns out it doesn't work really well with Svelte :)
Hi there,
I've been using
svelte-inview
in my own project and noticed that type checking with svelte-check in HTML templates did not work anymore since I updated to svelte-check 3. The VS Code extension is also affected since it's been using svelte-check 3 from version 106 onwards. It turns out that a few adjustments have to be made to get it working again as svelte-check has changed its interface to get typings.I have also changed the interface name from
HTMLProps<T>
toHTMLAttributes<T>
as shown in the link above. In my test svelte-check did not infer the correct type when using HTMLProps, but it works with HTMLAttributes.Let me know if you have any questions and thanks for creating this package!