@microsoft/fast-element/declarative.js

Classes

Class

Description

AttributeDefinition

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

ElementStyles

Represents styles that can be applied to a custom element.

FASTElementDefinition

Defines metadata for a FASTElement.

HTMLView

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

Schema

A constructed JSON schema from a template

TemplateParser

Converts declarative HTML template markup into the strings and values arrays that ViewTemplate.create() consumes.

This class is intentionally stateless across invocations — all mutable parsing state lives on the call stack or in the TemplateResolutionContext.

The parsing pipeline is fully synchronous — no promises are allocated during template resolution.

ViewTemplate

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

Functions

Function

Description

declarativeTemplate()

Returns a declarative template resolver that waits for the matching <f-template> element and resolves it into a concrete ViewTemplate.

Interfaces

Interface

Description

AccessCachedPath

A path discovered from an access expression.

Accessor

Represents a getter/setter property accessor on an object.

CachedPathCommon

Common metadata for paths cached while parsing a template.

CaptureType

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

ChildrenMap

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

DefaultCachedPath

A path discovered from a default binding.

DOMPolicy

A policy that controls whether values can be written to DOM sinks.

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.

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.

PartialFASTElementDefinition

Represents metadata configuration for a custom element.

RegisterPathConfig

Configuration for registering a path with a schema.

RepeatCachedPath

A path discovered from a repeat directive.

ResolvedStringsAndValues

The return type for TemplateParser.parse().

ShadowRootOptions

Shadow root initialization options.

StyleStrategy

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

StyleTarget

A node that can be targeted by styles.

SyntheticViewTemplate

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

ValueConverter

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

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.

Variables

Variable

Description

AttributeConfiguration

Metadata used to configure a custom attribute's behavior.

DOMAspect

The type of HTML aspect to target.

DOMPolicy

A helper for creating DOM policies.

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.

Type Aliases

Type Alias

Description

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.

ComposableStyles

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

Constructable

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

ConstructibleStyleStrategy

A type that instantiates a StyleStrategy.

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.

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.

TemplateValue

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

TrustedTypesPolicy

A policy for use with the standard trustedTypes platform API.