Interface Component

An interface describing the shape of a Component. Mostly adheres to the Web Components specification while providing rendering and change detection capabilities.

interface Component {
    adoptedCallback?(): void;
    attributeChangedCallback?(name, prev?, next?): void;
    connectedCallback?(): void;
    constructor: any;
    disconnectedCallback?(): void;
    fluctuationChangedCallback?(propertyKey, prev, next): void;
    observedAttributes?: string[];
    observedFluctuations?: Record<PropertyKey, Subscription>;
    observedReferences?: Record<Key, (keyof HTMLElementEventMap)[]>;
    referenceChangedCallback?(key, node, event): void;
    renderComponent?(): void;
    styles?: string[];
    template?: Element;
}

Hierarchy

Constructors

constructor

Properties

observedAttributes?: string[]

Array of Attribute names, which should be observed for changes, which will trigger the attributeChangedCallback.

observedFluctuations?: Record<PropertyKey, Subscription>

A Record of Subscriptions opened by the Fluctuate decorator which trigger the fluctuationChangedCallback upon each emission, while subscribed to.

observedReferences?: Record<Key, (keyof HTMLElementEventMap)[]>

A Record of References and observed events, which, when emitted by the reference, trigger the referenceChangedCallback.

styles?: string[]

Array of CSS styles in string form, which should be included within the ShadowRoot of the Component.

template?: Element

JSX representation of the Component template. If no template is supplied, an HTMLSlotElement will be rendered instead.

Methods

  • Called when one of the Component's observed Attributes is added, removed or changed. Which Component attributes are observed depends on the contents of the observedAttributes array.

    Parameters

    • name: string

      The name of the changed attribute.

    • Optional prev: string

      The previous value of the changed attribute.

    • Optional next: string

      The next value of the changed attribute.

    Returns void

Generated using TypeDoc