import type SimpleLineSymbol from "./SimpleLineSymbol.js";
import type Symbol from "./Symbol.js";
import type { SimpleLineSymbolProperties } from "./SimpleLineSymbol.js";
import type { SymbolProperties } from "./Symbol.js";

export interface FillSymbolProperties extends SymbolProperties {
  /**
   * The outline of the polygon.
   *
   * @example
   * let sym = {
   *   type: "simple-fill",  // autocasts as new SimpleFillSymbol()
   *   color: "red",
   *   outline: {  // autocasts as new SimpleLineSymbol()
   *     color: [128, 128, 128, 0.5],
   *     width: "0.5px"
   *   }
   * };
   */
  outline?: (SimpleLineSymbolProperties & { type?: "simple-line" }) | null;
}

/**
 * Fill symbols are used to draw [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) graphics in a
 * [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)
 * in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new fill symbols, use either
 * [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) or [PictureFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html).
 *
 * Fill symbols may also be used to symbolize 2D polygon features
 * in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). However, it is
 * recommended you use [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) instead.
 *
 * @since 4.0
 * @see [Symbol Builder](https://developers.arcgis.com/javascript/latest/visualization/symbols-color-ramps/symbol-builder/)
 * @see [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html)
 * @see [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html)
 */
export default abstract class FillSymbol extends Symbol {
  /**
   * The outline of the polygon.
   *
   * @example
   * let sym = {
   *   type: "simple-fill",  // autocasts as new SimpleFillSymbol()
   *   color: "red",
   *   outline: {  // autocasts as new SimpleLineSymbol()
   *     color: [128, 128, 128, 0.5],
   *     width: "0.5px"
   *   }
   * };
   */
  get outline(): SimpleLineSymbol | null | undefined;
  set outline(value: (SimpleLineSymbolProperties & { type?: "simple-line" }) | null | undefined);
  /** The symbol type. */
  get type(): "simple-fill" | "picture-fill";
}