/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { AttributePath, ClusterType, DataVersionFilter, EventFilter, EventPath, ReadRequest } from "@matter/types"; import { Specifier } from "./Specifier.js"; /** * A read request formulated using Matter protocol semantics. */ export interface Read extends ReadRequest { } /** * Formulate a read request with extended options and name-based IDs. */ export declare function Read(options: Read.Options, ...selectors: Read.Selector[]): Read; /** * Formulate a read request with name-based IDs. */ export declare function Read(...selectors: Read.Selector[]): Read; export declare namespace Read { interface Options { attributes?: AttributePath[]; versionFilters?: DataVersionFilter[]; events?: EventPath[]; eventFilters?: EventFilter[]; fabricFilter?: boolean; interactionModelRevision?: number; } interface Attributes extends Read { attributeRequests: Exclude; } function containsAttribute(request: Read): request is Attributes; interface Events extends Read { eventRequests: Exclude; } function containsEvent(request: Read): request is Events; /** * Selects attributes or events to read. */ type Selector = ({ kind: "attribute"; } & AttributeSelector) | ({ kind: "event"; } & EventSelector); /** * Selects attributes to read. Limits fields to legal permutations per the Matter specification. */ type AttributeSelector = AttributeSelector.Concrete | AttributeSelector.FullWildcard | AttributeSelector.Global | AttributeSelector.WildcardEndpoint | AttributeSelector.WildcardAttribute | AttributeSelector.Endpoint; /** * Selects events to read. Limits fields to legal permutations per the Matter specification. */ type EventSelector = EventSelector.Concrete | EventSelector.FullWildcard | EventSelector.WildcardEndpoint | EventSelector.WildcardEvent | EventSelector.Endpoint; function Attribute(selector?: AttributeSelector): { kind: "attribute"; } & AttributeSelector; function Event(selector: T): { kind: "event"; } & T; interface WildcardFlags { skipRoot?: boolean; skipCustom?: boolean; skipDiagnostics?: boolean; skipGlobals?: boolean; skipAttributeList?: boolean; skipCommandList?: boolean; skipFixed?: boolean; skipChangesOmitted?: boolean; } type GlobalAttributeSpecifier = ClusterType.Attribute | Specifier.GlobalAttributeName; namespace AttributeSelector { interface Concrete { endpoint: Specifier.Endpoint; cluster: C; attributes: Specifier.Attribute> | Specifier.Attribute>[]; } interface Wildcard { flags?: WildcardFlags; } interface FullWildcard extends Wildcard { endpoint?: undefined; cluster?: undefined; attributes?: undefined; } interface Global extends Wildcard { endpoint?: Specifier.Endpoint; cluster?: undefined; attributes: GlobalAttributeSpecifier | GlobalAttributeSpecifier[]; } interface WildcardEndpoint extends Wildcard { endpoint?: undefined; cluster: C; attributes: Specifier.Attribute> | Specifier.Attribute>[]; } interface WildcardAttribute extends Wildcard { endpoint?: Specifier.Endpoint; cluster: Specifier.Cluster; attributes?: undefined; } interface Endpoint extends Wildcard { endpoint: Specifier.Endpoint; cluster?: undefined; attributes?: undefined; } } /** * Accumulates {@link AttributePath} entries for a batched Read, deduped and preserved in insertion order. * * Omitting fields applies wildcard semantics: omitting `attributeId` reads all attributes of a cluster; * omitting `clusterId` reads all clusters of an endpoint. */ class AttributePaths { #private; add(path: AttributePath): void; get paths(): ReadonlyArray; } namespace EventSelector { interface Concrete { endpoint: Specifier.Endpoint; cluster: Specifier.Cluster; events: Specifier.Event> | Specifier.Event>[]; } interface Wildcard { flags?: WildcardFlags; } interface FullWildcard extends Wildcard { endpoint?: undefined; cluster?: undefined; events?: undefined; } interface WildcardEndpoint extends Wildcard { endpoint?: undefined; cluster: Specifier.Cluster; events: Specifier.Event> | Specifier.Event>[]; } interface WildcardEvent extends Wildcard { endpoint: Specifier.Endpoint; cluster: Specifier.Cluster; events?: undefined; } interface Endpoint extends Wildcard { endpoint: Specifier.Endpoint; cluster?: undefined; events?: undefined; } } } //# sourceMappingURL=Read.d.ts.map