Open kwangure opened 1 month ago
These patterns are bad anyway because in the end the editor will lie about all bindings, on:
directives etc.
We probably need a small wrapper to filter some stuff out. I'm going with something like this:
type SvelteAttributes<T> = {
[K in keyof T as K extends `on:${string}` | `bind:${string}` | "children" ? never : K]?: T[K];
};
export type Attributes<T extends HTMLElementTagNameMap> = SvelteAttributes<SvelteHTMLElements[T]>;
Describe the bug
The elements in
'svelte/elements'
extend the following type:The
children
property on the interface is intended to allow uses case like these:But inadvertently now prevents uses like these:
With the error being:
It would be nice if this supported both patterns of usage.
That said, it is possible to use in its current state, though not great.
Reproduction
N/A
Logs
No response
System Info
Severity
annoyance