/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { CancelablePromise, Duration, MaybePromise } from "#general";
import type { ClientNode } from "#node/ClientNode.js";
import type { ServerNode } from "#node/ServerNode.js";
import { CommissionableDeviceIdentifiers } from "#protocol";
/**
 * Discovery of commissionable devices.
 *
 * This is a cancelable promise; use cancel() to terminate discovery.
 */
export declare abstract class Discovery<T = unknown> extends CancelablePromise<T> {
    #private;
    constructor(owner: ServerNode, options: Discovery.Options | undefined);
    get settled(): Promise<void>;
    protected abstract onDiscovered(node: ClientNode): void;
    protected abstract onComplete(): MaybePromise<T>;
    /**
     * 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;
    };
    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 "nodeN".
         */
        id?: string;
    };
}
//# sourceMappingURL=Discovery.d.ts.map