/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { Agent } from "#endpoint/Agent.js"; import type { Endpoint } from "#endpoint/Endpoint.js"; import type { SupportedElements } from "#endpoint/properties/Behaviors.js"; import { Construction, EventEmitter, Lifecycle, Lifetime, MaybePromise, Observable } from "@matter/general"; import type { Behavior } from "../Behavior.js"; import { Reactor } from "../Reactor.js"; import { Datasource } from "../state/managed/Datasource.js"; /** * The "backing" for a behavior manages those portions of behavior that endure for the lifetime of an endpoint. */ export declare abstract class BehaviorBacking { #private; get construction(): Construction; constructor(endpoint: Endpoint, type: Behavior.Type, store: Datasource.Store, options?: Behavior.Options); toString(): string; get path(): import("@matter/model").DataModelPath; /** * Initialize state by applying values from options and invoking the behavior's initialize() function. * * Initiated via {@link Construction#start} by Behaviors class once the backing is installed. */ [Construction.construct](agent: Agent): MaybePromise; get [Lifetime.owner](): Construction>; initializeDataSource(): void; /** * Destroy the backing. */ close(agent?: Agent): MaybePromise; /** * Set state from options and invoke {@link Behavior.invokeInitializer}. * * This is an optional extension point for derivatives. Errors thrown here are recorded and place the behavior into * crashed state. */ protected invokeInitializer(behavior: Behavior, options?: Behavior.Options): MaybePromise; /** * The {@link Endpoint} that owns the behavior. */ get endpoint(): Endpoint; /** * The {@link Behavior.Type} backed. */ get type(): Behavior.Type; set type(type: Behavior.Type); /** * Rebuild state derived from {@link type} after the backed cluster structure changes. Derivatives that cache * additional type-derived data override to refresh it. */ protected refreshForChangedType(): void; /** * Create an instance of the backed {@link Behavior}. * * Derivatives may override to perform additional setup beyond simple instantiation. */ createBehavior(agent: Agent, type: Behavior.Type): Behavior; /** * The source of raw data that backs managed state instances. */ get datasource(): Datasource; /** * Access the datasource if present. */ get maybeDatasource(): Datasource | undefined; protected get datasourceOptions(): Datasource.Options; /** * The data provider for {@link datasource}. */ protected readonly store: Datasource.Store; /** * Obtain internal state for a behavior instance. */ getInternal(): object; /** * Access the event object. Unlike state, the events object does not vary by instance. */ get events(): EventEmitter; /** * The status of the behavior. */ get status(): Lifecycle.Status; /** * A read-only offline view of behavior state. */ get stateView(): {}; /** * Supported elements. */ abstract readonly elements: SupportedElements | undefined; /** * Install a reactor. */ reactTo>(observable: O, reactor: Reactor, ReturnType>, options?: Reactor.Options): void; /** * Terminate reactions. */ stopReacting(selector?: { observable?: Observable; reactor?: Reactor; }): Promise; /** * We provide two forms of optimized change tracking. * * {@link ProtocolService} offers a low-level service that supports the Matter protocol. * * {@link ChangeNotificationService} is a higher-level service that supports state synchronization use cases. * * This method informs these services of changes. */ protected broadcastChanges(props: string[]): void; } //# sourceMappingURL=BehaviorBacking.d.ts.map