-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the problem
Right now HTMLAttributes<HTMLButtonElement> is not the same as HTMLButtonAttributes. Which makes sense if you look at the implementation.
But it means there is no good generic way, to retrieve these specific HtmlAttributes.
It would help me if there was sth. like this:
HTMLAttributesMap["button"] to be the same as HTMLButtonAttributes.
Describe the proposed solution
Create a type like this in svelte/elements:
export interface HtmlAttributesMap {
button: HTMLButtonAttributes;
div: HTMLAttributes<HTMLDivElement>
// ...
}The same structure exists in typescript for
HtmlElements calledHTMLElementTagNameMap.
If you think this is sth. you want to add, I am happy to provide a PR for it.
Thanks a lot in any case :)
Importance
would make my life easier
Metadata
Metadata
Assignees
Labels
No labels