This is a prerelease version of FAST (3.0.0-rc.1).

@microsoft/fast-element

Classes

Class

Description

AttributeDefinition

An implementation of Accessor that supports reactivity, change callbacks, attribute reflection, and type conversion for custom elements.

ChildrenDirective

The runtime behavior for child node observation.

DefaultExecutionContext

The default execution context for template views.

ElementController

Controls the lifecycle and rendering of a FASTElement.

ElementStyles

Represents styles that can be applied to a custom element.

FASTElementDefinition

Defines metadata for a FASTElement.

HTMLBindingDirective

The central binding directive that bridges data expressions and DOM updates.

HTMLBindingDirective fulfills three roles simultaneously: - **HTMLDirective**: Produces placeholder HTML via createHTML() during template authoring. - **ViewBehaviorFactory**: Creates behaviors (returns itself) during view creation. - **ViewBehavior / EventListener**: Attaches to a DOM node during bind, manages expression observers for reactive updates, and handles DOM events directly.

The aspectType (set by HTMLDirective.assignAspect during template processing) determines which DOM "sink" function is used to apply values — e.g., setAttribute for attributes, addEventListener for events, textContent for content.

HTMLView

The standard View implementation, which also implements ElementView and SyntheticView.

InlineTemplateDirective

Inlines a template into another template.

PropertyChangeNotifier

An implementation of Notifier that allows subscribers to be notified of individual property changes on an object.

RefDirective

The runtime behavior for template references.

RenderBehavior

A Behavior that enables advanced rendering.

RenderDirective

A Directive that enables use of the RenderBehavior.

RepeatBehavior

A behavior that renders a template for each item in an array.

RepeatDirective

A directive that configures list rendering.

Schema

A constructed JSON schema from a template

SlottedDirective

The runtime behavior for slotted node observation.

Sort

A sort array indicates new index positions of array items.

Splice

A splice map is a representation of how a previous array of items was transformed into a new array of items. Conceptually it is a list of tuples of

(index, removed, addedCount)

which are kept in ascending index order of. The tuple represents that at the |index|, |removed| sequence of items were removed, and counting forward from |index|, |addedCount| items were added.

SubscriberSet

An implementation of Notifier that efficiently keeps track of subscribers interested in a specific change notification on an observable subject.

ViewTemplate

A template capable of creating HTMLView instances or rendering directly to DOM.

Abstract Classes

Abstract Class

Description

Binding

Captures a binding expression along with related information and capabilities.

NodeObservationDirective

A base class for node observation.

StatelessAttachedAttributeDirective

A base class used for attribute directives that don't need internal state.

Enumerations

Enumeration

Description

Stages

The various lifecycle stages of an ElementController.

Functions

Function

Description

attr(config)

Decorator: Specifies an HTML attribute.

attr(target, prop)

Decorator: Specifies an HTML attribute.

children(propertyOrOptions)

A directive that observes the childNodes of an element and updates a property whenever they change.

composedContains(reference, test)

Determines if the reference element contains the test element in a "composed" DOM tree that ignores shadow DOM boundaries.

Returns true of the test element is a descendent of the reference, or exists in a shadow DOM that is a logical descendent of the reference. Otherwise returns false.

composedParent(element)

Retrieves the "composed parent" element of a node, ignoring DOM tree boundaries. When the parent of a node is a shadow-root, it will return the host element of the shadow root. Otherwise it will return the parent node or null if no parent node exists.

computedState(initialize, name)

(BETA) Creates a ComputedState.

cssDirective()

Decorator: Defines a CSSDirective.

customElement(nameOrDef)

Decorator: Defines a platform custom element based on FASTElement.

elements(selector)

Creates a function that can be used to filter a Node array, selecting only elements.

enableDebug()

Enables human-readable FAST debug messages.

htmlDirective(options)

Decorator: Defines an HTMLDirective.

lengthOf(array)

Enables observing the length of an array.

listener(expression, options)

Creates an event listener binding.

normalizeBinding(value)

Normalizes the input value into a binding.

observable(target, nameOrAccessor)

Decorator: Defines an observable property on the target.

oneTime(expression, policy)

Creates a one time binding

oneWay(expression, policy, isVolatile)

Creates an standard binding.

ownedState(value, options)

(BETA) Creates a reactive state that has its value associated with a specific owner.

reactive(object, deep)

(BETA) Converts a plain object to a reactive, observable object.

ref(propertyName)

A directive that observes the updates a property with a reference to the element.

render(value, template)

Creates a RenderDirective for use in advanced rendering scenarios.

repeat(items, template, options)

A directive that enables list rendering.

signal(expression, options, policy)

Creates a signal binding configuration with the supplied options.

slotted(propertyOrOptions)

A directive that observes the assignedNodes() of a slot and updates a property whenever they change.

sortedCount(array)

Enables observing the sorted property of an array.

state(value, options)

(BETA) Creates a reactive state value.

twoWay(expression, optionsOrChangeEvent, policy, isBindingVolatile)

Creates a default binding.

volatile(target, name, descriptor)

Decorator: Marks a property getter as having volatile observable dependencies.

watch(object, subscriber)

(BETA) Deeply subscribes to changes in existing observable objects.

when(condition, templateOrTemplateBinding, elseTemplateOrTemplateBinding)

A directive that enables basic conditional rendering in a template.

Interfaces

Interface

Description

AccessCachedPath

A path discovered from an access expression.

Accessor

Represents a getter/setter property accessor on an object.

ArrayObserver

An observer for arrays.

Aspected

Represents something that applies to a specific aspect of the DOM.

BindingDirective

The directive from which a binding originates.

CachedPathCommon

Common metadata for paths cached while parsing a template.

CaptureType

A marker interface used to capture types when interpolating Directive helpers into templates.

ChildListDirectiveOptions

The options used to configure child list observation.

ChildrenMap

Describes a child custom element binding referenced by a schema path.

ContentTemplate

A simple template that can create ContentView instances.

ContentView

A simple View that can be interpolated into HTML content.

CSSDirective

Directive for use in CSS templates.

CSSDirectiveDefinition

Defines metadata for a CSSDirective.

DefaultCachedPath

A path discovered from a default binding.

Disposable

Provides a mechanism for releasing resources.

ElementControllerStrategy

A type that instantiates an ElementController

ElementView

A View representing DOM nodes specifically for rendering the view of a custom element.

ElementViewTemplate

A template capable of creating views specifically for rendering custom elements.

EventCachedPath

A path discovered from an event binding.

ExecutionContext

Provides additional contextual information available to behaviors and expressions.

ExpressionController

Controls the lifecycle of an expression and provides relevant context.

ExpressionNotifier

Enables evaluation of and subscription to a binding.

ExpressionObserver

Observes an expression for changes.

FASTElement

Represents a custom element based on the FASTElement infrastructure.

HostBehavior

Represents an object that can contribute behavior to a host.

HostController

Controls the lifecycle and context of behaviors and styles associated with a component host.

HTMLDirective

Instructs the template engine to apply behavior to a node.

HTMLDirectiveDefinition

Defines metadata for an HTMLDirective.

HTMLTemplateCompilationResult

The result of a template compilation operation.

JSONSchema

A JSON schema describing a root property.

JSONSchemaCommon

Common properties shared by schema nodes.

JSONSchemaDefinition

A reusable JSON schema definition.

LengthObserver

Observes array lengths.

NodeBehaviorOptions

Options for configuring node observation behavior.

Notifier

Provides change notifications for an observed subject.

ObservationRecord

A record of observable property access.

PartialFASTElementDefinition

Represents metadata configuration for a custom element.

PartialHTMLDirectiveDefinition

Represents metadata configuration for an HTMLDirective.

RegisterPathConfig

Configuration for registering a path with a schema.

RepeatCachedPath

A path discovered from a repeat directive.

RepeatOptions

Options for configuring repeat behavior.

ShadowRootOptions

Shadow root initialization options.

SlottedDirectiveOptions

The options used to configure slotted node observation.

SortObserver

Observes array sort.

SpliceStrategy

An approach to tracking changes in an array.

StyleStrategy

Implemented to provide specific behavior when adding/removing styles for elements.

StyleTarget

A node that can be targeted by styles.

Subscriber

Implemented by objects that are interested in change notifications.

SubtreeDirectiveOptions

The options used to configure subtree observation.

SyntheticView

A view representing a range of DOM nodes which can be added/removed ad hoc.

SyntheticViewTemplate

A template capable of rendering views not specifically connected to custom elements.

TemplateLifecycleCallbacks

Lifecycle callbacks for template events.

TwoWaySettings

The settings required to enable two-way binding.

UpdateQueue

A work queue used to synchronize writes to the DOM.

ValueConverter

Represents objects that can convert values to and from view or model representations.

View

Represents a collection of DOM nodes which can be bound to a data source.

ViewBehavior

Represents an object that can contribute behavior to a view.

ViewBehaviorFactory

A factory that can create a ViewBehavior associated with a particular location within a DOM fragment.

ViewBehaviorOrchestrator

Bridges between ViewBehaviors and HostBehaviors, enabling a host to control ViewBehaviors.

ViewController

Controls the lifecycle of a view and provides relevant context.

Variables

Variable

Description

ArrayObserver

An observer for arrays.

AttributeConfiguration

Metadata used to configure a custom attribute's behavior.

booleanConverter

A ValueConverter that converts to and from boolean values.

Compiler

Common APIs related to compilation.

css

Transforms a template literal string into styles.

CSSDirective

Instructs the css engine to provide styles during CSS template composition.

DOM

Common DOM APIs.

DOMAspect

The type of HTML aspect to target.

DOMPolicy

A helper for creating DOM policies.

emptyArray

A readonly, empty array.

ExecutionContext

Provides additional contextual information available to behaviors and expressions.

FAST

The FAST messaging API for warnings and errors.

FASTElement

A minimal base class for FASTElements that also provides static helpers for working with FASTElements.

html

Transforms a template literal string into a ViewTemplate.

HTMLDirective

Instructs the template engine to apply behavior to a node.

Markup

Common APIs related to markup generation.

nullableBooleanConverter

A ValueConverter that converts to and from boolean values. null, undefined, "", and void values are converted to null.

nullableNumberConverter

A ValueConverter that converts to and from number values.

Observable

Common Observable APIs.

Parser

Common APIs related to content parsing.

schemaRegistry

Module-level registry that maps custom element names to their schema maps. Used for cross-element $ref resolution (e.g. nested element schemas). Each Schema instance registers itself here on construction.

Signal

The gateway to signal APIs.

SourceLifetime

Describes how the source's lifetime relates to its controller's lifetime.

SpliceStrategy

Functionality related to tracking changes in arrays.

SpliceStrategySupport

Indicates what level of feature support the splice strategy provides.

TwoWaySettings

Enables configuring two-way binding settings.

Updates

The default UpdateQueue.

ViewBehaviorOrchestrator

Bridges between ViewBehaviors and HostBehaviors, enabling a host to control ViewBehaviors.

Type Aliases

Type Alias

Description

AddViewBehaviorFactory

Used to add behavior factories when constructing templates.

AttributeConfiguration

Metadata used to configure a custom attribute's behavior.

AttributeMode

The mode that specifies the runtime behavior of the attribute.

CachedPath

A path discovered while parsing a template.

CachedPathMap

A map from element names and root properties to JSON schemas.

Callable

Represents a callable type such as a function or an object with a "call" method.

ChildrenDirectiveOptions

The options used to configure child/subtree node observation.

Class

Represents a constructable class with a prototype.

CompilationStrategy

A function capable of compiling a template from the preprocessed form produced by the html template function into a result that can instantiate views.

CompiledViewBehaviorFactory

Represents a ViewBehaviorFactory after the compilation process has completed.

ComposableStyles

Represents styles that can be composed into the ShadowDOM of a custom element.

ComputedBuilder

(BETA) Provides computed state capabilities.

ComputedInitializer

(BETA) A callback that initializes the computation.

ComputedSetupCallback

(BETA) A callback that enables computation setup.

ComputedState

(BETA) State whose value is computed from other dependencies.

Constructable

Represents a type which can be constructed with the new operator.

ConstructibleStyleStrategy

A type that instantiates a StyleStrategy.

CSSTemplateTag

Transforms a template literal string into styles.

CSSValue

Represents the types of values that can be interpolated into a template.

DecoratorAttributeConfiguration

Metadata used to configure a custom attribute's behavior through a decorator.

DOMAspect

The type of HTML aspect to target.

DOMAspectGuards

Aspect-specific guards for a DOM Policy.

DOMElementGuards

Element-specific guards for a DOM Policy.

DOMGuards

Guard configuration for a DOM Policy.

DOMPolicyOptions

Options for creating a DOM Policy.

DOMSink

A function used to send values to a DOM sink.

DOMSinkGuards

A specific DOM sink guard for a node aspect.

ElementsFilter

Elements filter function type.

Expression

The signature of an arrow function capable of being evaluated against source data and within an execution context.

FASTElementExtension

A callback that receives a FASTElementDefinition during element registration. Extensions are invoked before the element is registered with the platform, allowing plugins to inspect or act on the resolved definition.

FASTElementTemplateResolver

Resolves an element template from a composed definition.

HTMLTemplateTag

Transforms a template literal string into a ViewTemplate.

OwnedState

(BETA) A read/write stateful value associated with an owner.

ReadonlyOwnedState

(BETA) A readonly stateful value associated with an object owner.

ReadonlyState

(BETA) A readonly stateful value.

SourceLifetime

Describes how the source's lifetime relates to its controller's lifetime.

SpliceStrategySupport

The available values for SpliceStrategySupport.

State

(BETA) A read/write stateful value.

StateOptions

(BETA) Options for creating state.

TemplateValue

Represents the types of values that can be interpolated into a template.

TrustedTypesPolicy

A policy for use with the standard trustedTypes platform API.

TwoWayBindingOptions

The twoWay binding options.

ViewBehaviorTargets

The target nodes available to a behavior.