/**
 * @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 "#general";
import { FabricId, FabricIndex } from "#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<FabricManager>;
    [Construction.construct](): Promise<void>;
    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<void>;
    /**
     * 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<void>;
    addFabric(fabric: Fabric): void;
    [Symbol.iterator](): ArrayIterator<Fabric>;
    get fabrics(): Fabric[];
    get length(): number;
    find(predicate: (fabric: Fabric) => boolean): Fabric | undefined;
    map<T>(translator: (fabric: Fabric) => T): T[];
    findFabricFromDestinationId(destinationId: Bytes, initiatorRandom: Bytes): Promise<Fabric>;
    findByKeypair(keypair: Key): Fabric | undefined;
    forDescriptor(descriptor: {
        rootPublicKey: Bytes;
        fabricId: FabricId;
    }): Fabric | undefined;
    replaceFabric(fabric: Fabric): Promise<void>;
}
//# sourceMappingURL=FabricManager.d.ts.map