import type { JSONSupport } from "../../core/JSONSupport.js";
import type { TimeUnit as TimeUnits } from "../../core/units.js";

export interface TimeUnitProperties extends Partial<Pick<TimeUnit, "time" | "units">> {}

/**
 * A geoprocessing object that contains time information.
 *
 * @since
 * 5.0
 * const [Geoprocessor, TimeUnit] = await $arcgis.import([
 *   "@arcgis/core/rest/Geoprocessor.js",
 *   "@arcgis/core/rest/support/TimeUnit.js",
 * ]);
 * const parameters = {
 *   Input_Time: new TimeUnit({
 *     time: 2,
 *     units: "esriTimeUnitsWeeks",
 *   }),
 * };
 * const geoprocessor = new Geoprocessor({});
 * geoprocessor.submitJob(parameters).then((result) => {
 *   // handle the result
 * });
 * @see
 * [geoprocessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html)
 * > [!WARNING]
 * >
 * > The string representation of `GPTimeUnit` is not supported.
 * @see [GPTimeUnit](https://developers.arcgis.com/rest/services-reference/enterprise/gp-data-types/#gptimeunit)
 */
export default class TimeUnit extends JSONSupport {
  constructor(properties?: TimeUnitProperties);
  /**
   * Specifies the numerical time.
   *
   * @default 0
   */
  accessor time: number;
  /** Specifies the unit of time. */
  units?: TimeUnits | null;
}