import type Color from "../Color.js";
import type Collection from "../core/Collection.js";
import type Symbol from "./Symbol.js";
import type Symbol3DLayer from "./Symbol3DLayer.js";
import type StyleOrigin from "./support/StyleOrigin.js";
import type { SymbolProperties } from "./Symbol.js";
import type { Symbol3DLayerProperties } from "./Symbol3DLayer.js";
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
import type { StyleOriginProperties } from "./support/StyleOrigin.js";

export interface Symbol3DProperties extends SymbolProperties {
  /**
   * > [!WARNING]
   * >
   * > 3D symbols do not support colors on the symbol level. Colors may be set on individual symbol layer materials instead. Setting the color property on a 3D symbol will not have any effect. The color property is present for consistency with other symbol types.
   *
   * @example
   * // CSS color string
   * symbol.color = "dodgerblue";
   * @example
   * // HEX string
   * symbol.color = "#33cc33";
   * @example
   * // array of RGBA values
   * symbol.color = [51, 204, 51, 0.3];
   * @example
   * // object with rgba properties
   * symbol.color = {
   *   r: 51,
   *   g: 51,
   *   b: 204,
   *   a: 0.7
   * };
   */
  color?: Color | null;
  /**
   * The origin of the style from which the symbol was originally referenced.
   *
   * A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part
   * of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It
   * does not affect actual appearance or rendering of the symbol.
   */
  styleOrigin?: StyleOriginProperties | null;
  /**
   * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) objects used to visualize the graphic or feature.
   *
   * Individual symbol layers may be autocast as objects and specified using the `type` property.
   */
  symbolLayers?: ReadonlyArrayOrCollection<Symbol3DLayerProperties>;
}

/**
 * Symbol3D is the base class for all 3D symbols. It is used to render 2D
 * [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), and
 * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/) features in a
 * [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and 3D mesh features in a
 * [SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/). All 3D symbols must be used in a
 * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) instance; there is no support for 3D rendering
 * in [MapViews](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
 *
 * There are five types of 3D symbols. Four of them correspond with a different feature
 * geometry type. The fifth, [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LabelSymbol3D/), may be applied to
 * any geometry type. See the table below to learn about which symbol types are supported for
 * each geometry type.
 *
 * Geometry type | Valid symbol types
 * --------------|-------------------
 * [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) | [PointSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PointSymbol3D/), [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LabelSymbol3D/)
 * [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/) | [LineSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3D/), [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LabelSymbol3D/)
 * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/) | [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/PolygonSymbol3D/), [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LabelSymbol3D/)
 * Mesh | [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/MeshSymbol3D/), [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/references/core/symbols/LabelSymbol3D/)
 *
 * All 3D symbols have a [symbolLayers](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3D/#symbolLayers) property, which is an array of
 * [Symbol3DLayers](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) that define the appearance of the symbol.
 * All symbols must have at least one [symbol layer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/)
 * added to the [symbolLayers](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3D/#symbolLayers) property. The Symbol3D object is a container
 * that holds multiple symbol layers that determine the appearance of the symbol.
 * One layer may be an outline, another the fill, etc.
 * The relationship of symbol layers to symbol is similar to the relationship
 * of [operational layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers) to a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/).
 * There are various types of symbol layers
 * that may be used based on the symbol type and geometry of the features. See
 * [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) to learn more about symbol layers.
 *
 * @since 4.0
 * @see [Symbol Builder](https://developers.arcgis.com/javascript/latest/symbol-builder/)
 * @see [Renderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/)
 * @see [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/)
 * @see [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/)
 * @see [Styles and data visualization](https://developers.arcgis.com/javascript/latest/visualization/)
 * @see [ArcGIS blog - Working with icons, lines, and fill symbols](https://blogs.esri.com/esri/arcgis/2016/01/19/3d-visualization-working-with-icons-lines-and-fill-symbols/)
 * @see [ArcGIS blog - Working with objects, paths, and extrusion](https://blogs.esri.com/esri/arcgis/2016/01/25/3d-visualization-working-with-objects-paths-and-extrusion/)
 * @see [ArcGIS blog - Using attributes to represent real-world sizes of features](https://blogs.esri.com/esri/arcgis/2016/02/01/3d-visualization-using-attributes-to-represent-real-world-sizes-of-features/)
 */
export default abstract class Symbol3D extends Symbol {
  /**
   * > [!WARNING]
   * >
   * > 3D symbols do not support colors on the symbol level. Colors may be set on individual symbol layer materials instead. Setting the color property on a 3D symbol will not have any effect. The color property is present for consistency with other symbol types.
   *
   * @example
   * // CSS color string
   * symbol.color = "dodgerblue";
   * @example
   * // HEX string
   * symbol.color = "#33cc33";
   * @example
   * // array of RGBA values
   * symbol.color = [51, 204, 51, 0.3];
   * @example
   * // object with rgba properties
   * symbol.color = {
   *   r: 51,
   *   g: 51,
   *   b: 204,
   *   a: 0.7
   * };
   */
  accessor color: Color | null;
  /**
   * The origin of the style from which the symbol was originally referenced.
   *
   * A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part
   * of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It
   * does not affect actual appearance or rendering of the symbol.
   */
  get styleOrigin(): StyleOrigin | null | undefined;
  set styleOrigin(value: StyleOriginProperties | null | undefined);
  /**
   * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/Symbol3DLayer/) objects used to visualize the graphic or feature.
   *
   * Individual symbol layers may be autocast as objects and specified using the `type` property.
   */
  get symbolLayers(): Collection<Symbol3DLayer>;
  set symbolLayers(value: ReadonlyArrayOrCollection<Symbol3DLayerProperties>);
  /** The symbol type. */
  get type(): "point-3d" | "line-3d" | "polygon-3d" | "mesh-3d" | "label-3d";
}