You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lit-extended sets properties instead of attributes by default, and adds the name$= syntax for opting-into attributes.
If would be great to understand the set of valid properties and their types from HTMLElementTagNameMap. Integration with custom elements would be relatively easy then:
import{html,render}from'lit-html/lib/lit-extended';classMyElementextendsHTMLElement{someProp: number;}customElements.define('my-element',HTMLElement);declare global {interfaceHTMLElementTagNameMap{'my-element': MyElement;}}// this should have a warning under "${'abc'}" for not being a numberhtml`<my-elementsomeProp=${'abc'}></my-element>`;// this should have a warning under somProp for not being property of MyElementhtml`<my-elementsomProp=${10}></my-element>`;// this should have a warning under<my-elemet> for not being a known elementhtml`<my-elemet></my-elemet>`;
Basically, we want the same features as JSX type-checking. Additionally, it'd be great to have some way to tell tsc the valid attributes for an element.
The text was updated successfully, but these errors were encountered:
lit-extended sets properties instead of attributes by default, and adds the
name$=
syntax for opting-into attributes.If would be great to understand the set of valid properties and their types from
HTMLElementTagNameMap
. Integration with custom elements would be relatively easy then:Basically, we want the same features as JSX type-checking. Additionally, it'd be great to have some way to tell tsc the valid attributes for an element.
The text was updated successfully, but these errors were encountered: