Skip to main content

@microsoft/fast-element > FASTElementDefinition

FASTElementDefinition class

Defines metadata for a FASTElement.

Signature:
export declare class FASTElementDefinition<TType extends Function = Function> 

Constructors

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

Properties

PropertyModifiersTypeDescription
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.

Methods

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