import type { JSONSupport } from "../../core/JSONSupport.js";
import type { ParameterValue as ParameterValueType } from "../types.js";

export interface ParameterValueProperties<T extends ParameterValueType = ParameterValueType> extends Partial<Pick<ParameterValue<T>, "dataType" | "paramName" | "value">> {}

/**
 * Represents the output parameters of a [geoprocessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html) method
 * and their properties and values.
 *
 * @since 4.0
 * @see [geoprocessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html)
 * @see [GPMessage](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-GPMessage.html)
 * @see [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html)
 */
export default class ParameterValue<T extends ParameterValueType = ParameterValueType> extends JSONSupport {
  constructor(properties?: ParameterValueProperties<T>);
  /** Specifies the parameter's data type. */
  dataType: T["dataType"];
  /**
   * The name of the parameter the value is for.
   *
   * @since 4.28
   */
  accessor paramName: string | null | undefined;
  /**
   * The value of the parameter. The structure of this value depends on the [data type](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ParameterValue.html#dataType) of the parameter.
   * The value could be a single value or an array of values. The table below lists the singular _data types_.
   *
   * | Data Type                | JavaScript Type |
   * |--------------------------|-----------------|
   * | areal-unit               | [ArealUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ArealUnit.html) |
   * | boolean                  | [Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
   * | data-file                | [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html) |
   * | date                     | [Date](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) |
   * | double                   | [Number (float)](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) |
   * | feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html), [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html), or [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) |
   * | field                    | [Field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) |
   * | linear-unit              | [LinearUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-LinearUnit.html) |
   * | long                     | [Number (int)](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) |
   * | raster-data              | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RasterData.html) or [MapImage](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html) |
   * | raster-data-layer        | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RasterData.html) or [MapImage](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html) |
   * | record-set               | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html) or [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html) |
   * | string                   | [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) |
   * | time-unit                | [TimeUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-TimeUnit.html) |
   * | value-table              | [Value table](https://developers.arcgis.com/rest/services-reference/enterprise/gp-data-types/#gpvaluetable) is a flexible table-like object consisting of rows and columns containing various values. |
   *
   * Alternatively, this property could be an array of values. The table below lists all valid arrays.
   *
   * | Data Type                            | JavaScript Type |
   * |--------------------------------------|-----------------|
   * | multi-value-areal-unit               | An array of [areal units](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ArealUnit.html) |
   * | multi-value-boolean                  | An array of [booleans](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
   * | multi-value-composite                | An array containing any combination of singular data types in the table above excluding `value-table`. See [GPComposite](https://developers.arcgis.com/rest/services-reference/enterprise/gp-data-types/#gpcomposite). |
   * | multi-value-data-file                | An array of [data files](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html) |
   * | multi-value-date                     | An array of [dates](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) |
   * | multi-value-double                   | An array of [doubles](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) |
   * | multi-value-feature-record-set-layer | An array of [feature sets](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html), [data files](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html), or [feature layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) |
   * | multi-value-field                    | An array of [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) |
   * | multi-value-linear-unit              | An array of [linear units](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-LinearUnit.html) |
   * | multi-value-long                     | An array of [longs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) |
   * | multi-value-raster-data              | An array of [rasters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RasterData.html) or [map images](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html) |
   * | multi-value-raster-data-layer        | An array of [rasters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-RasterData.html) or [map images](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html) |
   * | multi-value-record-set               | An array of [feature sets](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html) or [data files](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DataFile.html) |
   * | multi-value-time-unit                | An array of [Time units](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-TimeUnit.html) |
   * | multi-value-string                   | An array of [strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) |
   *
   * @see [Geoprocessing service data types](https://developers.arcgis.com/rest/services-reference/enterprise/gp-data-types.htm)
   */
  accessor value: T["value"];
}