/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Observable } from "@matter/general";
import { Discovery } from "./Discovery.js";
class ContinuousDiscovery extends Discovery {
  #discovered = Observable();
  #result = Array();
  #bounded;
  constructor(owner, options) {
    super(owner, options);
    this.#bounded = options?.timeout !== void 0;
  }
  /**
   * Emitted as discovery encounters new nodes.
   */
  get discovered() {
    return this.#discovered;
  }
  onDiscovered(node) {
    if (this.#bounded) {
      this.#result.push(node);
    }
    this.#discovered.emit(node);
  }
  onComplete() {
    return this.#result;
  }
}
export {
  ContinuousDiscovery
};
//# sourceMappingURL=ContinuousDiscovery.js.map
