Skip to main content

@microsoft/fast-element > FASTElementDefinition

FASTElementDefinition class

Defines metadata for a FASTElement.

export declare class FASTElementDefinition<TType extends Function = Function> 


(constructor)(type, nameOrConfig)Creates an instance of FASTElementDefinition.


attributeLookupRecord<string, AttributeDefinition>A map enabling lookup of property by associated attribute name.
attributesReadonlyArray<AttributeDefinition>The custom attributes of the custom element.
elementOptionsElementDefinitionOptionsOptions controlling how the custom element is defined with the platform.
forTypestatic<TType_1 extends Function>(key: TType_1) => FASTElementDefinition<Function> | undefinedGets the element definition associated with the specified type.
isDefinedbooleanIndicates if this element has been defined in at least one registry.
namestringThe name of the custom element.
propertyLookupRecord<string, AttributeDefinition>A map enabling lookup of attribute by associated property name.
shadowOptionsShadowRootInitOptions controlling the creation of the custom element's shadow DOM.
stylesElementStylesThe styles to associate with the custom element.
templateElementViewTemplateThe template to render for the custom element.
typeTTypeThe type this element definition describes.


define(registry)Defines a custom element based on this definition.