import type SceneView from "../views/SceneView.js";
import type Widget from "./Widget.js";
import type VisibleElements from "./Weather/VisibleElements.js";
import type WeatherViewModel from "./Weather/WeatherViewModel.js";
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
import type { WidgetProperties } from "./Widget.js";
import type { HeadingLevel } from "./support/types.js";
import type { WeatherViewModelProperties } from "./Weather/WeatherViewModel.js";
import type { VisibleElementsProperties } from "./Weather/VisibleElements.js";

/** @deprecated since version 4.33. Use the [Weather component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-weather/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). */
export interface WeatherProperties extends WidgetProperties, Partial<Pick<Weather, "headingLevel" | "view">> {
  /**
   * Icon which represents the widget. It is typically used when the widget is controlled by another
   * one (e.g. in the Expand widget).
   *
   * @default "partly-cloudy"
   * @since 4.27
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   */
  icon?: Icon["icon"] | null;
  /**
   * The widget's default label.
   *
   * @since 4.11
   */
  label?: string | null;
  /**
   * The view model for this widget. This is a class that contains all the logic (properties and methods)
   * that controls this widget's behavior. See the [WeatherViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Weather/WeatherViewModel/)
   * class to access all properties and methods on the widget.
   */
  viewModel?: WeatherViewModelProperties;
  /**
   * This property provides the ability to display or hide the individual elements of the widget.
   *
   * @example
   * weather.visibleElements = {
   *    header: true
   * }
   */
  visibleElements?: VisibleElementsProperties;
}

/**
 * The Weather widget provides an interface for easily selecting and configuring the
 * weather effects in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). For this, the widget modifies the `weather` property of
 * [SceneView.environment](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment). The different weather types are:
 * [sunny](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunnyWeather/), [cloudy](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/CloudyWeather/),
 * [rainy](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/RainyWeather/), [snowy](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SnowyWeather/),
 * and [foggy](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/FoggyWeather/).
 *
 * @deprecated since version 4.33. Use the [Weather component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-weather/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
 * @since 4.23
 * @see [WeatherViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Weather/WeatherViewModel/) - _Deprecated since 4.33. Use the [Weather component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-weather/) instead._
 * @see [SceneView.environment](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment)
 * @see [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/)
 * @see [Sample - Weather visualization](https://developers.arcgis.com/javascript/latest/sample-code/scene-weather/)
 * @example
 * const widget = new Weather({ view: view });
 *
 * // Adds the weather widget in the top right corner of the view
 * view.ui.add(widget, "top-right");
 */
export default class Weather extends Widget<WeatherProperties> {
  constructor(properties?: WeatherProperties);
  /**
   * Indicates the heading level to use for the title of the widget. By default, this message is rendered
   * as level 4 headings (e.g. `<h4>Time range</h4>`). Depending on the widget's placement
   * in your app, you may need to adjust this heading for proper semantics. This is
   * important for meeting accessibility standards.
   *
   * @default 4
   * @see [Heading Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)
   * @example widget.headingLevel = 4;
   */
  accessor headingLevel: HeadingLevel;
  /**
   * Icon which represents the widget. It is typically used when the widget is controlled by another
   * one (e.g. in the Expand widget).
   *
   * @default "partly-cloudy"
   * @since 4.27
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   */
  get icon(): Icon["icon"];
  set icon(value: Icon["icon"] | null | undefined);
  /**
   * The widget's default label.
   *
   * @since 4.11
   */
  get label(): string;
  set label(value: string | null | undefined);
  /** A reference to the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/). This widget is only supported in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). */
  accessor view: SceneView | null | undefined;
  /**
   * The view model for this widget. This is a class that contains all the logic (properties and methods)
   * that controls this widget's behavior. See the [WeatherViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Weather/WeatherViewModel/)
   * class to access all properties and methods on the widget.
   */
  get viewModel(): WeatherViewModel;
  set viewModel(value: WeatherViewModelProperties);
  /**
   * This property provides the ability to display or hide the individual elements of the widget.
   *
   * @example
   * weather.visibleElements = {
   *    header: true
   * }
   */
  get visibleElements(): VisibleElements;
  set visibleElements(value: VisibleElementsProperties);
}