/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { ServerNode } from "#node/ServerNode.js"; import { StorageDriver } from "@matter/general"; import { MockServerNode } from "./mock-server-node.js"; /** * Manages a mock network with nodes on it. */ export declare class MockSite { #private; /** * Creates an empty site. All nodes added share one network simulator unless a node brings its own. */ constructor(options?: MockSite.Options); /** * Adds a plain {@link ServerNode} (not a {@link MockServerNode}) with mock crypto, a simulated network host and * site-backed storage, and starts it unless `online` is `false`. Missing `index` and `id` are assigned (`device`). * The site closes the node and any environment it created on {@link close}. */ addNode(type?: T, options?: MockServerNode.Options): Promise>; addNode(definition: T | MockServerNode.Configuration, options?: MockServerNode.Options): Promise>; /** * Adds an offline controller node with commissioning disabled and admin fabric id 1. Missing `index` and `id` are assigned (`controller`); the options object is modified. */ addController(options?: MockServerNode.Options): Promise>; /** * Adds a node with an On/Off Light device and starts it, unless the options say otherwise. */ addDevice(options?: MockServerNode.Options): Promise>; /** * Adds a controller (not started) and a device, without commissioning them. */ addUncommissionedPair(options?: MockSite.PairOptions): Promise<{ controller: ServerNode; device: ServerNode; }>; /** * Adds a controller and a device, starts the controller and commissions the device into its fabric using mock time (90 s * timeout). Entropy is enabled on both only while pairing. */ addCommissionedPair(options?: MockSite.PairOptions): Promise<{ controller: ServerNode; device: ServerNode; }>; /** * Closes all nodes still open, then the environments the site created for them. */ close(): Promise; /** * The in-memory store backing the given node id (or node), created on first use. Persists across node restarts within the site. */ storageFor(id: string | { id: string; }): Record; /** * Closes the site, so it can be used with `await using`. */ [Symbol.asyncDispose](): Promise; } export declare namespace MockSite { /** * Options for {@link MockSite}. */ interface Options { /** * Creates the storage driver for a node, given its backing store. Defaults to a memory driver. */ createStorageDriver?: (store: Record) => StorageDriver; } /** * Per-node configuration for the pair-creating methods of {@link MockSite}. */ interface PairOptions { /** * Configuration of the controller node. */ controller?: MockServerNode.Configuration; /** * Configuration of the device node. */ device?: MockServerNode.Configuration; } } //# sourceMappingURL=mock-site.d.ts.map