import type LayerPerformanceInfo from "./LayerPerformanceInfo.js";

/**
 * This class contains information about performance in the scene like global memory usage
 * and additional details for layers about memory consumption and number of features.
 *
 * > [!WARNING]
 * >
 * > **This class is experimental** and should be used for debugging purposes only.
 * > Its interface will change in future releases.
 *
 * @since 4.15
 * @see [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html)
 * @see [Sample - SceneView memory resources](https://developers.arcgis.com/javascript/latest/sample-code/sceneview-memory/)
 */
export default abstract class SceneViewPerformanceInfo {
  /**
   * An estimate of the memory used by the [Edges3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html) feature when
   * added to 3D objects in [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or to polygons with
   * [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) symbols.
   *
   * @default 0
   */
  readonly edgesMemory: number;
  /** An array representing detailed information about memory usage of most layers. */
  readonly layerPerformanceInfos: Array<LayerPerformanceInfo>;
  /**
   * Quality level as a number between 0 and 1.
   * The quality decreases when layers would need more memory than available, which reduces the level of detail, number
   * of features and terrain tile resolution.
   *
   * @default 1
   */
  readonly quality: number;
  /**
   * An estimate of the memory currently in use by [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) and
   * [tiled layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html), in bytes.
   *
   * This property also includes internal memory of the terrain subsystem, e.g., memory used to composite
   * tiles in case multiple [tiled layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) are added to the scene.
   *
   * @default 0
   */
  readonly terrainMemory: number;
  /**
   * The total memory available to the SceneView, in bytes.
   *
   * @default 0
   */
  readonly totalMemory: number;
  /**
   * An estimate of the memory that is in use by the SceneView, in bytes.
   *
   * @default 0
   */
  readonly usedMemory: number;
}