/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { AsyncObservable, Bytes, Construction, Crypto, Environment, Environmental, Key, MatterError, MaybePromise, Observable, StorageContext } from "@matter/general"; import { FabricId, FabricIndex } from "@matter/types"; import { Fabric } from "./Fabric.js"; /** Specific Error for when a fabric is not found. */ export declare class FabricNotFoundError extends MatterError { } export declare class FabricTableFullError extends MatterError { } export declare class FabricManager { #private; constructor(crypto: Crypto, storage?: StorageContext); get crypto(): Crypto; get construction(): Construction; [Construction.construct](): Promise; close(): Promise; static [Environmental.create](env: Environment): FabricManager; get events(): { added: Observable<[fabric: Fabric], void>; replaced: Observable<[fabric: Fabric], void>; leaving: Observable<[fabric: Fabric], void>; deleting: AsyncObservable<[fabric: Fabric], void>; deleted: AsyncObservable<[fabric: Fabric], void>; failsafeClosed: Observable<[], void>; }; clear(): Promise; /** * Test whether the fabric identified by {@link identifier} is present. */ has(address: Fabric.Identifier): boolean; /** * Obtain the fabric identified by {@link identifier}. * * Throws if the fabric is not found. */ for(identifier: Fabric.Identifier): Fabric; /** * Get the fabric identified by {@link identifier} if present. */ maybeFor(identifier: Fabric.Identifier): Fabric | undefined; allocateFabricIndex(): FabricIndex; persistFabrics(): MaybePromise; addFabric(fabric: Fabric): void; [Symbol.iterator](): ArrayIterator; get fabrics(): Fabric[]; get length(): number; find(predicate: (fabric: Fabric) => boolean): Fabric | undefined; map(translator: (fabric: Fabric) => T): T[]; /** * @deprecated Migration-only. Returns the maximum legacy per-operational-key group data counter across all fabrics, * so the node-global group data counter can be seeded above every previously used value. Remove once the migration * window has passed. */ legacyGroupDataCounterMax(): Promise; /** * @deprecated Migration-only. Clears the legacy per-operational-key group data counters from all fabrics after the * node-global counter has been seeded from them. Remove once the migration window has passed. */ clearLegacyGroupDataCounters(): Promise; findFabricFromDestinationId(destinationId: Bytes, initiatorRandom: Bytes): Promise; findByKeypair(keypair: Key): Fabric | undefined; forDescriptor(descriptor: { rootPublicKey: Bytes; fabricId: FabricId; }): Fabric | undefined; /** * Replace a fabric by a new object for the same fabric under new operational credentials, as UpdateNOC and NOC * rotation produce. The new object shares the groups, access control and ICD state of the replaced one, so these * stay intact and in effect throughout. */ replaceFabric(fabric: Fabric): Promise; } //# sourceMappingURL=FabricManager.d.ts.map