/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { ValueModel } from "@matter/model"; import { Conformance } from "@matter/model"; /** * Collects elements whose conformance references sibling element names rather than just features. * * Elements are sorted into two categories: * * - **conditionals**: No element name deps (e.g. comparison operators, `Desc`). Resolved immediately via fallback. * - **interdependents**: Has actual sibling element references, needs the full dependency graph resolution. * * Classification is a two-pass process: * * 1. {@link classify} recursively walks the AST to determine whether it contains any non-feature element name * references. If not, it returns a fallback directly. * * 2. {@link extractInterdependencies} pattern-matches the top-level AST against known simple forms from the Matter spec * to extract dependency names. Throws on unrecognized patterns. */ export declare class NameDependentElements { #private; /** * Elements whose conformance is runtime-conditional (e.g. comparisons, `Desc`) but doesn't reference sibling * elements. Presence is based solely on whether the element is implemented since we can't evaluate the actual * condition at behavior construction time. Also used as resolved deps by {@link interdependents}. */ conditionals: Map; /** * Elements with sibling element references — needs dependency graph resolution. */ interdependents: Map; constructor(featureContext: Conformance.FeatureContext); /** * Add an element whose conformance evaluated as {@link Conformance.Applicability.Conditional}. * * Classifies the conformance AST and sorts the element into either `conditionals` (resolved immediately) or * `interdependents` (needs graph resolution). */ add(model: ValueModel, elementType: "attribute" | "command" | "event", isImplemented: boolean): void; } export declare namespace NameDependentElements { /** * Information about an element whose conformance depends on element names (not just features). */ interface Entry { model: ValueModel; elementType: "attribute" | "command" | "event"; isImplemented: boolean; } /** * An element whose conformance is runtime-conditional but has no sibling element dependencies. Presence is * determined directly from the implementation since the actual condition can't be evaluated statically. */ interface Conditional extends Entry { presence: boolean; } /** * An element with sibling element references that requires dependency graph resolution. */ interface Interdependent extends Entry { dependencies: string[]; fallback: Fallback; } /** * The conformance to apply when no element-name dependencies are present. Maps to the otherwise clause in * conformance chains like `"Resume, O"` — here the fallback is {@link Conformance.Applicability.Optional}. */ type Fallback = Conformance.Applicability.None | Conformance.Applicability.Optional | Conformance.Applicability.Mandatory; } //# sourceMappingURL=NameDependentElements.d.ts.map