Conversation
|
@ryoppippi does this mean that modifying the global types for |
|
does this work for versions >=4.0 && < 4.2, based on the title I assume no but the README just says Svelte 4 so it might not work for some. Also since most people simply copy paste it and move on I wonder if it is worth keeping it as is just to save the mental overhead of "wait do I need to copy this or that?" and "wait, I am going to upgrade to 4.2 later, will I need to change this?" |
|
So the reason would be that if the signature of the events from this library changes, or a new event is added in the future, users won't have to manually update their vendored type definitions to keep them in sync. |
|
Ok, we need to add like |
|
If the HTMLAttribute type could be defined in the library and automatically loaded at import, it would eliminate the need for the user to copy and paste the type. |
Scince 4.2, we can declare 'svelte/elements' for custom attributes.
I use this and this is so good!
https://svelte.jp/docs/typescript#enhancing-built-in-dom-types