/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { AsyncObservable, Observable } from "@matter/general"; import type { Endpoint } from "../Endpoint.js"; /** * State related to a {@link Endpoint}'s lifecycle. */ export declare class EndpointLifecycle { #private; /** * Emitted when an endpoint is installed into an initialized owner. */ get installed(): Observable<[], void>; /** * Emitted when an endpoint is fully initialized excepting children. */ get ready(): Observable<[], void>; /** * Emitted when an endpoint is fully initialized including children. */ get partsReady(): Observable<[], void>; /** * @deprecated use {@link partsReady} */ get treeReady(): Observable<[], void>; /** * Emitted when the endpoint begins destruction. */ get destroying(): Observable<[], void>; /** * Emitted when the endpoint is destroyed. */ get destroyed(): Observable<[], void>; /** * Bubbling event indicating changes to endpoint structure. */ get changed(): Observable<[type: EndpointLifecycle.Change, endpoint: Endpoint], void>; /** * Emitted on factory reset. */ get reset(): AsyncObservable<[], void>; /** * Emitted when the endpoint's `ConfigurationVersion` changes — from `BasicInformation` on a node's root endpoint or * `BridgedDeviceBasicInformation` on a bridged endpoint. Wired for client peers by {@link Peers}. */ get configurationVersionChanged(): Observable<[], void>; /** * Is the {@link Endpoint} installed in a {@link Node}? */ get isInstalled(): boolean; /** * Is the {@link Endpoint} fully initialized, excepting children? */ get isReady(): boolean; /** * Is the {@link Endpoint} fully initialized, including children? */ get isPartsReady(): boolean; /** * Can the {@link Endpoint}'s state be read right now? * * Only between completed construction and the start of a reset or of destruction. An initializing endpoint has * nothing to answer with yet, and a resetting, crashed or closing one has nothing left. */ get isReadable(): boolean; /** * Has the {@link Endpoint} begun closing or deleting, or has its construction crashed? A closing or deleted endpoint * does not become readable again; a crashed one may be restarted. Unlike "not {@link isReadable}", this is false * while the endpoint initializes or while a reset runs outside of a deletion. */ get isGone(): boolean; /** * Throw if the {@link Endpoint} {@link isGone}: {@link CrashedDependencyError} if its construction crashed, * {@link DestroyedDependencyError} once it began closing or deleting. */ assertNotGone(): void; /** * @deprecated use {@link isPartsReady} */ get isTreeReady(): boolean; /** * Designates endpoint as essential. * * By default endpoints are considered "essential". An essential endpoint must initialize successfully or an error * is thrown. Non-essential endpoints may be installed even if they have errors. * * You may configure this property via {@link Endpoint.Configuration#isEssential}. */ get isEssential(): boolean; /** * Does the endpoint have an ID? */ get hasId(): boolean; /** * Does the endpoint have an endpoint number? */ get hasNumber(): boolean; constructor(endpoint: Endpoint, isEssential?: boolean); /** * Bubble a lifecycle change event from a child. */ bubble(type: EndpointLifecycle.Change, endpoint: Endpoint): void; /** * Inform the Lifecycle of a change in lifecycle. */ change(type: EndpointLifecycle.Change): void; protected emitError(name: string, error: Error): void; /** * Revert to uninstalled state. */ resetting(): void; } export declare namespace EndpointLifecycle { enum Change { Installed = "installed", Ready = "ready", PartsReady = "partsReady", Crashed = "crashed", Destroying = "destroying", Destroyed = "destroyed", ServersChanged = "serversChanged", ClientsChanged = "clientsChanged", IdAssigned = "idAssigned", NumberAssigned = "numberAssigned" } } //# sourceMappingURL=EndpointLifecycle.d.ts.map