/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { ConditionModel, DeviceTypeModel, RequirementModel } from "../../models/index.js"; import type { DeviceTypeValidationPass } from "./DeviceTypeValidationPass.js"; import { ReachingEndpoints } from "./ReachingEndpoints.js"; /** * The conditions that hold for the endpoints of a node scope. * * A condition is true for an endpoint when a condition requirement of a device type in the scope asserts it there, * when the Base device type's structural definition makes it true, when the node's configuration answers it (see * {@link NodeCondition}), or when the endpoint states it in {@link DeviceTypeFacts.statedConditionsOf}. Every other * condition is false; stating a name never makes a condition false. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 * * @internal */ export declare namespace ConditionAssertions { /** * A condition requirement with location `Descendant` that a device type of {@link endpoint} asserts. * * Its {@link RequirementModel.componentCountRange} bounds how many endpoints it must reach, which composition * validation checks against {@link matches}. */ interface DescendantAssertion { /** * The asserting endpoint. */ endpoint: E; /** * The condition requirement. */ requirement: RequirementModel; /** * The endpoints of the condition's declaring device type within the asserting endpoint's composition scope, * each of which the condition now holds for. */ matches: E[]; } /** * The result of {@link collect}. Each endpoint's conditions are derived on first request. */ interface Collection { /** * The declared names of the conditions true for {@link endpoint}; empty for an endpoint outside the node scope. */ conditionsOf(endpoint: E): Set; /** * The names among the {@link conditionsOf conditions} of {@link endpoint} that are true only because a device * type in the node scope asserts them at the `Root` location; empty for every endpoint but the node endpoint. */ rootAssertedOf(endpoint: E): ReadonlySet; /** * The asserted `Descendant` condition requirements of {@link endpoint}; empty for an endpoint outside the node * scope. */ descendantAssertionsOf(endpoint: E): DescendantAssertion[]; } /** * A name in {@link DeviceTypeFacts.statedConditionsOf} that names no condition in the endpoint's scope. */ interface UnknownName { name: string; /** * The declared spelling of a condition the name matches regardless of case. */ suggestion?: string; } /** * Collect the conditions true for the endpoints in the node scope of {@link nodeEndpoint}. * * A condition requirement asserts its condition rather than testing it, and it may assert on another endpoint: * on the asserting endpoint itself, on the node endpoint, or on endpoints of the asserting endpoint's composition * scope. So an endpoint's conditions are those its own requirements, its ancestors' and, for the node endpoint, * those of the {@link reachingOf reaching endpoints} assert on it. A requirement asserts when its * conformance is mandatory for the structural, node and stated conditions of the asserting endpoint. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function collect(nodeEndpoint: E, pass: DeviceTypeValidationPass): Collection; /** * The endpoints of the node scope of {@link nodeEndpoint} whose facts enter the judgement of endpoints beyond their * own subtree, their ancestors and their siblings: those that {@link reachesNodeScope support a network interface}, * {@link assertsOnNodeEndpoint assert a condition on the node endpoint} or state a server cluster requirement that * declares a singleton. * * A pass with a {@link DeviceTypeValidationPass.index scope index} reads them from the index, which keeps what each * one contributes across passes. */ function reachingOf(nodeEndpoint: E, pass: DeviceTypeValidationPass): ReachingEndpoints; /** * The endpoints of the node scope of {@link nodeEndpoint} that declare a singleton, in tree order. */ function singletonDeclarersOf(nodeEndpoint: E, pass: DeviceTypeValidationPass): readonly E[]; /** * The {@link reachingOf reaching endpoints} of the node scope of {@link nodeEndpoint} as a walk of the * scope finds them, and the node endpoints below it that bound the scope. */ function scanReaching(nodeEndpoint: E, pass: DeviceTypeValidationPass): { reaching: E[]; boundaries: E[]; }; /** * Whether {@link endpoint} is in the node scope of {@link nodeEndpoint}, as {@link nodeScopeOf} lists it. * * An owner lists every endpoint it owns as a part until the endpoint is destroyed, except a peer's node, which is a * node endpoint. */ function isInScope(endpoint: E, nodeEndpoint: E, pass: DeviceTypeValidationPass): boolean; /** * Whether the Base `Duplicate` condition holds for {@link endpoint}: it shares an application device type with a * sibling. * * @see {@link MatterSpecification.v161.Core} § 9.2.9 * @see {@link MatterSpecification.v161.Device} § 1.1.6.1 */ function isDuplicate(endpoint: E, pass: DeviceTypeValidationPass): boolean; /** * Whether {@link endpoint} supports a network interface through its NetworkCommissioning server, which enters the * conditions {@link collect} answers for every endpoint of the node scope. */ function reachesNodeScope(endpoint: E, pass: DeviceTypeValidationPass): boolean; /** * Whether a device type of {@link endpoint} states a condition requirement located at the node endpoint, whatever * its conformance. Such a requirement enters the conditions {@link collect} answers for the node endpoint and no * other endpoint. */ function assertsOnNodeEndpoint(endpoint: E, pass: DeviceTypeValidationPass): boolean; /** * Whether {@link endpoint} reaches its node scope: it {@link reachesNodeScope supports a network interface}, it * {@link assertsOnNodeEndpoint asserts a condition on the node endpoint}, or one of its device types states a * server cluster requirement with the singleton quality — whether or not that cluster resolves in the model. * * Reads only device types and server clusters, whose changes the owner of a {@link DeviceTypeScopeIndex} must * observe; a kept list stays correct only while that holds. */ function reaches(endpoint: E, pass: DeviceTypeValidationPass): boolean; /** * Whether a device type of {@link endpoint} states a server cluster requirement with the singleton quality, * whether or not the cluster resolves in the model. `DeviceTypeConformance.check` judges a resolved singleton's * placement; this only decides whether the declaration itself makes {@link endpoint} reach its node scope. */ function declaresSingleton(endpoint: E, pass: DeviceTypeValidationPass): boolean; /** * The names in {@link DeviceTypeFacts.statedConditionsOf} that name no condition in the endpoint's scope exactly. * * A name resolves in the scope of any of the endpoint's device types: their own conditions, their bases', the Base * device type's, and any condition qualified by its declarer (e.g. `RootNode.PowerSourceCond`). * * Two device types on one endpoint may each declare a condition of the same name, such as `PhysicalInputs` for * BasicVideoPlayer and CastingVideoPlayer. The name is not ambiguous: conditions hold by name, so stating it makes * it true for both, as qualifying it would. */ function unknownNames(endpoint: E, pass: DeviceTypeValidationPass): UnknownName[]; /** * The endpoints of the node scope of {@link nodeEndpoint}: the node endpoint and its descendants, without any node * endpoint below it and that node endpoint's descendants. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function nodeScopeOf(nodeEndpoint: E, pass: DeviceTypeValidationPass): E[]; /** * The conditions true for {@link endpoint} that its own facts decide: its structural conditions but `Duplicate`, * and those it states. For a name not {@link isUndecided undecided}, the set holds it exactly when the conditions * {@link collect} answers for {@link endpoint} in its node scope do, and it reads no other endpoint. */ function ownConditionsOf(endpoint: E, pass: DeviceTypeValidationPass): Set; /** * Whether other endpoints or the node's configuration may make the condition {@link name} true for an endpoint: * a node condition, `Duplicate`, a condition a requirement of a device type of the model asserts, or any name * qualified by a device type, which may resolve to one of those. */ function isUndecided(name: string, pass: DeviceTypeValidationPass): boolean; /** * The node endpoint whose node scope {@link endpoint} belongs to: the closest endpoint at or above it whose device * type is classified as a node. Undefined when there is none, so the endpoint belongs to no node scope. * * @see {@link MatterSpecification.v161.Core} § 9.2.6 */ function nodeEndpointOf(endpoint: E, pass: DeviceTypeValidationPass): E | undefined; } /** * The declared names of the Base device type's structural conditions. Conformance matches names exactly, so each * must stay spelled as Base declares it. * * @internal */ export declare enum StructuralCondition { Node = "Node", App = "App", Simple = "Simple", Dynamic = "Dynamic", Composed = "Composed", Client = "Client", Server = "Server", Duplicate = "Duplicate" } /** * The declared names of the conditions the node's configuration answers. Conformance matches names exactly, so each * must stay spelled as Base or RootNode declares it. */ export declare enum NodeCondition { CustomNetworkConfig = "CustomNetworkConfig", Ethernet = "Ethernet", WiFi = "WiFi", Thread = "Thread" } /** * {@link deviceType}'s conditions, resolved once per device type and model instance, shared by every pass resolved * in {@link pass}'s model. * * @internal */ export declare function conditionScopeOf(deviceType: DeviceTypeModel, pass: DeviceTypeValidationPass): Map; //# sourceMappingURL=ConditionAssertions.d.ts.map