@gluonjs/core / src / GluonElementClass
Type Alias: GluonElementClass()<ElementType>
GluonElementClass<
ElementType> =ElementType
Type Parameters
ElementType
ElementType extends GluonElement<any> = GluonElement<any>
new GluonElementClass():
ElementType
Returns
ElementType
Properties
events?
readonlyoptionalevents?:Readonly<Record<string,EventDeclaration<any>>>
properties?
readonlyoptionalproperties?:Readonly<Record<string,PropertyDefinition<any>>>
prototype
readonlyprototype:ElementType
shadowRootRegistry?
readonlyoptionalshadowRootRegistry?:GluonElementRegistry
slots?
readonlyoptionalslots?:SlotDeclarations
styles?
readonlyoptionalstyles?:CSSStyleSheet| readonlyCSSStyleSheet[]
Example
Type and register a constructible Gluon Custom Element class through the public Core entry point:
import {
GluonElement,
defineElement,
html,
type GluonElementClass,
} from '@gluonjs/core';
class ProductCard extends GluonElement {
protected render() {
return html`<article>Product</article>`;
}
}
const ProductCardElement: GluonElementClass<ProductCard> = ProductCard;
defineElement('product-card', ProductCardElement);