/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { ClientNode } from "#node/ClientNode.js"; import type { ServerNode } from "#node/ServerNode.js"; import { CancelablePromise, Duration, MaybePromise } from "@matter/general"; import { CommissionableDeviceIdentifiers, Scanner } from "@matter/protocol"; /** * Discovery of commissionable devices. * * This is a cancelable promise; use cancel() to terminate discovery. */ export declare abstract class Discovery extends CancelablePromise { #private; constructor(owner: ServerNode, options: Discovery.Options | undefined); get settled(): Promise; protected get owner(): ServerNode; protected abstract onDiscovered(node: ClientNode): void; protected abstract onComplete(): MaybePromise; /** * Terminate discovery. * * This will not abort node initialization but it will terminate any active discoveries. The discovery result will * be the same as if the discovery had timed out. * * To abort the operation due to error use {@link cancel}. */ stop(): void; toString(): string; protected onCancel(reason: Error): void; } export declare namespace Discovery { type Options = CommissionableDeviceIdentifiers & { timeout?: Duration; /** * Optional filter to restrict which scanners participate in discovery. When omitted all available scanners * are used. Use this to limit discovery to a specific transport (e.g. only UDP/mDNS or only BLE). */ scannerFilter?: (scanner: Scanner) => boolean; }; type InstanceOptions = Options & { /** * The local ID to assign the node if newly discovered. This is the stable identifier used for the node's "id" * property. * * By default matter.js assigns an ID of the form "peerN". */ id?: string; }; } //# sourceMappingURL=Discovery.d.ts.map