/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Conformance } from "../aspects/Conformance.js"; import { ClusterModel, ConditionModel, DeviceTypeModel, FieldModel, Model, RequirementModel } from "../models/index.js"; /** * Resolves the names a device type requirement's conformance references. * * A device type declares conditions its requirements may then name, and a requirement inside a cluster requirement may * also name a feature of that cluster. Every name resolves in the {@link EndpointScope} of the requirement, the scope * of the endpoint the requirement describes. * * A condition name in conformance resolves regardless of case. That is what lets a caller find the declared spelling * of a name the specification's conformance tables spell in another case; whether a name is spelled as declared is a * separate question, which model validation answers. A feature code in conformance must match exactly, so below a * cluster requirement whose cluster defines the feature `NODE`, the name `NODE` resolves to the feature while `Node` * resolves to the Base condition `Node`. {@link featureOf}, which answers what a feature requirement itself names, * matches the code exactly as well. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ export declare namespace RequirementResolver { /** * The scope of the endpoint a requirement describes, in which the names of its conformance resolve. */ interface EndpointScope { /** * The device type of the endpoint: the component device type for a requirement nested in a component * requirement, otherwise the device type that owns the requirement. Undefined when the requirement belongs to * no device type, or when the model does not define the component device type. */ deviceType?: DeviceTypeModel; /** * The cluster whose features the conformance may name: the cluster of the cluster requirement a requirement * is nested in. Undefined for a cluster requirement's own conformance, because the cluster's features cannot * decide whether the cluster is required, and when the model does not define the cluster. */ cluster?: ClusterModel; } /** * The {@link EndpointScope} of a requirement. * * A requirement's own conformance decides whether the requirement applies to its enclosing endpoint, so the scope * derives from the requirement's ancestors only. */ function endpointScopeOf(requirement: RequirementModel): EndpointScope; /** * Every condition the requirements of {@link deviceType} may name, keyed by lowercased name. * * The model spells a condition as the specification declares it but references it as the specification's * conformance tables spell it, which is not always the same case, so names are keyed case-insensitively. * * A condition is keyed unqualified when the device type or one of its bases declares it, or when it is universal * (declared by the base device type). The device type's own conditions win over its bases', and those win over * universal ones. Every condition is keyed as `declarer.name` as well, because a requirement asserting a foreign * device type's condition names it that way. */ function conditionsOf(deviceType: DeviceTypeModel): Map; /** * Resolve one name a requirement's conformance references, in the requirement's {@link EndpointScope}. A * qualified name arrives as its segments. */ function resolve(requirement: RequirementModel, name: string | string[]): Model | undefined; /** * A requirement's conformance with every condition it names spelled as the condition is declared, or undefined if * every name already is. * * Each name is decided by {@link resolve}: a feature of the cluster in context stays as written, and so does a name * that resolves to nothing. A qualified name (`Declarer.Condition`) takes the spelling of both the declaring device * type and the condition. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function declaredConformanceOf(requirement: RequirementModel): Conformance.Ast | undefined; /** * The cluster a requirement belongs to: the one a cluster requirement names, or the one enclosing a requirement * nested in a cluster requirement. Undefined for any other requirement or a cluster the model does not define. */ function clusterOf(requirement: RequirementModel): ClusterModel | undefined; /** * The device type a component requirement names, by its ID and otherwise by its name. Undefined for a requirement * that is not a component requirement or a device type the model does not define. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function deviceTypeOf(requirement: RequirementModel): DeviceTypeModel | undefined; /** * The feature of its cluster that a feature requirement names, or undefined if it names none or is not a feature * requirement. * * A requirement names a feature by its code, which matches exactly. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function featureOf(requirement: RequirementModel): FieldModel | undefined; /** * The feature of its cluster that a feature requirement names by its code or by its title, ignoring case and * whitespace, or undefined if it names none or is not a feature requirement. * * The specification's element requirement tables name a feature by its title ("LongIdleTimeSupport" for `LITS`), * so this is the lookup for a requirement as scraped. {@link featureOf} is the lookup for a finished model. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function featureMatching(requirement: RequirementModel): FieldModel | undefined; /** * The attribute, command or event of its cluster that an element requirement names, or undefined if it names none * or is not an attribute, command or event requirement. * * The name matches exactly and only an element of the kind the requirement states. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function elementOf(requirement: RequirementModel): Model | undefined; /** * The field of a command of its cluster that a command field requirement names, or undefined if it names none or * is not a command field requirement. * * The specification's tables name a command field by the command's name followed by the field's, with nothing * between them, and state it directly in the cluster requirement. Both names match exactly. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function commandFieldOf(requirement: RequirementModel): Model | undefined; /** * The condition a condition requirement asserts, named by its type and otherwise by its name, or undefined if it * names none or is not a condition requirement. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function conditionOf(requirement: RequirementModel): ConditionModel | undefined; /** * The canonical name a condition requirement asserts, or undefined for a requirement that is not a condition * requirement. * * The name of the condition it resolves to, so conformance referencing the condition in another case still matches. * A requirement that resolves to no condition answers its own name, which lets validation report the name the * requirement states. */ function conditionNameOf(requirement: RequirementModel): string | undefined; } //# sourceMappingURL=RequirementResolver.d.ts.map