I use the ts-lit-plugin for type checking of web components. Although phosphor-icons come with types, I still get a warning from the plugin that properties such as weight or size are unknown.
One possible solution would be to use the actual component class in the HTMLElementTagNameMap declaration instead of the IconAttrs type: (scripts/assemble.ts)
declare global {
interface HTMLElementTagNameMap {
- "ph-${key}": IconAttrs;
+ "ph-${key}": Ph${name};
}
}
Another solution would be to change IconAttrs from a type to a declare class: (src/types.ts)
- export type IconAttrs = {
+ export declare class IconAttrs {
I'm not sure what the best solution is, but it would be great if this could be fixed. Then this icon library would really be more than perfect ;)
I use the
ts-lit-pluginfor type checking of web components. Although phosphor-icons come with types, I still get a warning from the plugin that properties such asweightorsizeare unknown.One possible solution would be to use the actual component class in the
HTMLElementTagNameMapdeclaration instead of theIconAttrstype: (scripts/assemble.ts)declare global { interface HTMLElementTagNameMap { - "ph-${key}": IconAttrs; + "ph-${key}": Ph${name}; } }Another solution would be to change
IconAttrsfrom atypeto adeclare class: (src/types.ts)I'm not sure what the best solution is, but it would be great if this could be fixed. Then this icon library would really be more than perfect ;)