diff --git a/packages/web-components/fast-element/docs/api-report.md b/packages/web-components/fast-element/docs/api-report.md index dc7517b684d..cd6d8f50f0a 100644 --- a/packages/web-components/fast-element/docs/api-report.md +++ b/packages/web-components/fast-element/docs/api-report.md @@ -221,6 +221,9 @@ export const DOM: Readonly<{ setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void; }>; +// @public +export function elements(tagName?: string): (value: Node, index: number, array: Node[]) => boolean; + // @public export abstract class ElementStyles { // @internal (undocumented) diff --git a/packages/web-components/fast-element/src/directives/node-observation.ts b/packages/web-components/fast-element/src/directives/node-observation.ts index 6f5bc4f5cc6..356df897f14 100644 --- a/packages/web-components/fast-element/src/directives/node-observation.ts +++ b/packages/web-components/fast-element/src/directives/node-observation.ts @@ -23,8 +23,9 @@ export interface NodeBehaviorBehaviorOptions { } /** - * Filters an array of nodes to only elements. + * Creates a function that can be used to filter a Node array, selecting only elements. * @param tagName - An optional tag name to restrict the filter to. + * @public */ export function elements(tagName?: string) { if (tagName) { diff --git a/packages/web-components/fast-element/src/index.ts b/packages/web-components/fast-element/src/index.ts index 707cf4848db..f358b86918f 100644 --- a/packages/web-components/fast-element/src/index.ts +++ b/packages/web-components/fast-element/src/index.ts @@ -18,3 +18,4 @@ export * from "./directives/when"; export * from "./directives/repeat"; export * from "./directives/slotted"; export * from "./directives/children"; +export { elements } from "./directives/node-observation";