import type Collection from "../../core/Collection.js";
import type BuildingSublayer from "./BuildingSublayer.js";
import type { BuildingSublayerUnion } from "./types.js";
import type { BuildingSublayerProperties } from "./BuildingSublayer.js";

export interface BuildingGroupSublayerProperties extends BuildingSublayerProperties, Partial<Pick<BuildingGroupSublayer, "listMode">> {
  /**
   * Indicates if the sublayer is visible in the view. Can be used to toggle the visibility of
   * all nested sublayers.
   */
  visible?: boolean;
}

/**
 * Hierarchical group of [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/) sublayers. It is used to group
 * [BuildingComponentSublayers](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/)
 * into disciplines. If a [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/) has a Full Model
 * sublayer, then this is also represented as a [BuildingGroupSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingGroupSublayer/).
 *
 * @since 4.10
 * @see [Sample - BuildingSceneLayer with Slice widget](https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-slice/)
 * @see [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/)
 * @see [BuildingComponentSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/)
 */
export default class BuildingGroupSublayer extends BuildingSublayer {
  constructor(properties?: BuildingGroupSublayerProperties);
  /**
   * Indicates how the sublayer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/) widget.
   * The possible values are listed below.
   *
   * Value | Description
   * ------|------------
   *  show | The sublayer is visible in the table of contents.
   *  hide | The sublayer is hidden in the table of contents.
   *  hide-children | Hide the children layers from the table of contents.
   *
   * @default "show"
   * @since 4.11
   */
  accessor listMode: "hide" | "show" | "hide-children";
  /** A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of sublayers. */
  get sublayers(): Collection<BuildingSublayerUnion>;
  readonly type: "building-group";
  /**
   * Indicates if the sublayer is visible in the view. Can be used to toggle the visibility of
   * all nested sublayers.
   */
  accessor visible: boolean;
  /**
   * Loads all contained sublayers.
   *
   * @returns Resolves when all sublayers have been loaded.
   *   Rejects if at least one of the sublayers failed to load.
   * @since 4.11
   * @see [BuildingComponentSublayer.load()](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/#load)
   * @example
   * // Load all contained sublayers but ignore if one or more of them failed to load
   * buildingGroupSublayer.loadAll()
   *   .catch(function(error) {
   *     // Ignore any failed resources
   *   })
   *   .then(function() {
   *     console.log("All loaded");
   *   });
   */
  loadAll(): Promise<this>;
}