Open rajsite opened 2 weeks ago
We override HTMLElementTagNameMap to add definitions for our custom elements like:
HTMLElementTagNameMap
declare global { interface HTMLElementTagNameMap { 'nimble-select': Select; } }
It seems possible to also override definitions in HTMLElementEventMap like:
HTMLElementEventMap
declare global { interface HTMLElementEventMap { 'filter-input': CustomEvent<SelectFilterInputEventDetail>; } }
Which would result in lines like the following having strong typing without any casts:
selectElement.addEventListener('filter-input', evt => evt.detail.filterText);
We should evaluate:
🧹 Tech Debt
We override
HTMLElementTagNameMap
to add definitions for our custom elements like:It seems possible to also override definitions in
HTMLElementEventMap
like:Which would result in lines like the following having strong typing without any casts:
We should evaluate: