/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { PeerLossContext } from "#peer/PeerLossContext.js"; import type { MessageExchange } from "#protocol/MessageExchange.js"; import type { NodeSession } from "#session/NodeSession.js"; import { AsyncObservable, Bytes, Construction, Duration, MatterFlowError } from "@matter/general"; import { SubjectId, VendorId } from "@matter/types"; import { Fabric } from "../fabric/Fabric.js"; import { FabricManager } from "../fabric/FabricManager.js"; import { SessionManager } from "../session/SessionManager.js"; import { FailsafeTimer } from "./FailsafeTimer.js"; export declare class MatterFabricInvalidAdminSubjectError extends MatterFlowError { } /** * A "timed operation" is a command or sequence of commands that operate with a failsafe timer that will abort the * operation if it does not complete within a specific window. * * FailsafeContext maintains the failsafe timer and tracks information required to rollback state if the operation * aborts. * * Timed operations are exclusive for a node. */ export declare abstract class FailsafeContext { #private; constructor(options: FailsafeContext.Options); extend(fabric: Fabric | undefined, expiryLength: Duration, currentExchange?: MessageExchange): Promise; get fabricIndex(): import("@matter/types").FabricIndex | undefined; get construction(): Construction; get commissioned(): AsyncObservable<[], void>; get associatedFabric(): Fabric | undefined; get csrSessionId(): number | undefined; get forUpdateNoc(): boolean | undefined; get rootCertSet(): boolean; get hasRootCert(): boolean; get rootCert(): AllowSharedBufferSource | undefined; completeCommission(): Promise; getFailSafeContext(): FailsafeTimer; getNextFabricIndex(): import("@matter/types").FabricIndex; replaceFabric(fabric: Fabric): Promise; /** * Handles a CSR from OperationalCredentials cluster and stores additional internal information for further * validity checks. */ createCertificateSigningRequest(isForUpdateNoc: boolean, sessionId: number): Promise; closePaseSession(context: PeerLossContext): Promise; close(currentExchange?: MessageExchange): Promise; /** Handles adding a trusted root certificate from Operational Credentials cluster. */ setRootCert(rootCert: Bytes): Promise; /** * Build a new Fabric object based on an existing fabric for the "UpdateNoc" case of the Operational Credentials * cluster. */ buildUpdatedFabric(nocValue: Bytes, icacValue: Bytes | undefined): Promise; /** Build a new Fabric object for a new fabric for the "AddNoc" case of the Operational Credentials cluster. */ buildFabric(nocData: { nocValue: Bytes; icacValue: Bytes | undefined; adminVendorId: VendorId; ipkValue: Bytes; caseAdminSubject: SubjectId; }): Promise; protected rollback(currentExchange?: MessageExchange): Promise; abstract storeEndpointState(): Promise; /** Restore Cluster data when the FailSafe context expired. */ abstract restoreNetworkState(): Promise; restoreFabric(fabric: Fabric): Promise; abstract restoreBreadcrumb(): Promise; } export declare namespace FailsafeContext { interface Options { sessions: SessionManager; fabrics: FabricManager; expiryLength: Duration; maxCumulativeFailsafe: Duration; session: NodeSession; } } //# sourceMappingURL=FailsafeContext.d.ts.map