export const WebChartTypes: {
    readonly Chart: "chart";
    readonly Text: "chartText";
    readonly Overlay: "chartOverlay";
    readonly Overlays: "chartOverlays";
    readonly Legend: "chartLegend";
    readonly CursorCrosshair: "cursorCrosshair";
    readonly Axis: "chartAxis";
    readonly GaugeAxisTick: "gaugeAxisTick";
    readonly GaugeNeedle: "gaugeNeedle";
    readonly CategoryAxisFormat: "category";
    readonly NumberAxisFormat: "number";
    readonly DateAxisFormat: "date";
    readonly Guide: "chartGuide";
    readonly ScatterSeries: "scatterSeries";
    readonly PieSeries: "pieSeries";
    readonly PieTick: "pieTick";
    readonly GaugeSeries: "gaugeSeries";
    readonly LineSeries: "lineSeries";
    readonly BarSeries: "barSeries";
    readonly HistogramSeries: "histogramSeries";
    readonly BoxPlotSeries: "boxPlotSeries";
    readonly RadarSeries: "radarSeries";
    readonly ComboLineAndBarSeries: "comboLineAndBarSeries";
    readonly HeatSeries: "heatSeries";
    readonly Buffer: "buffer";
    readonly SizePolicy: "sizeScale";
    readonly CalendarDateParts: "calendarDateParts";
};

export type WebChartTypes = (typeof WebChartTypes)[keyof typeof WebChartTypes];

export const WebChartStatisticType: {
    readonly Count: "count";
    readonly Sum: "sum";
    readonly Minimum: "min";
    readonly Maximum: "max";
    readonly Average: "avg";
    readonly StandardDeviation: "stddev";
    readonly Variance: "var";
    readonly ContinuousPercentile: "percentile-continuous";
    readonly DiscretePercentile: "percentile-discrete";
    readonly EnvelopeAggregate: "envelope-aggregate";
    readonly CentroidAggregate: "centroid-aggregate";
    readonly ConvexHullAggregate: "convex-hull-aggregate";
    readonly NoAggregation: "no_aggregation";
};

export type WebChartStatisticType = (typeof WebChartStatisticType)[keyof typeof WebChartStatisticType];

export const WebChartDataTransformations: {
    readonly None: "none";
    readonly Log: "logarithmic";
    readonly Sqrt: "squareRoot";
};

export type WebChartDataTransformations = (typeof WebChartDataTransformations)[keyof typeof WebChartDataTransformations];

export const WebChartColoringPatterns: {
    readonly Single: "singleColor";
    readonly Match: "colorMatch";
};

export type WebChartColoringPatterns = (typeof WebChartColoringPatterns)[keyof typeof WebChartColoringPatterns];

export const WebChartLegendPositions: {
    readonly Left: "left";
    readonly Right: "right";
    readonly Top: "top";
    readonly Bottom: "bottom";
};

export type WebChartLegendPositions = (typeof WebChartLegendPositions)[keyof typeof WebChartLegendPositions];

export const WebChartStackedKinds: {
    readonly Side: "sideBySide";
    readonly Stacked: "stacked";
    readonly Stacked100: "stacked100";
};

export type WebChartStackedKinds = (typeof WebChartStackedKinds)[keyof typeof WebChartStackedKinds];

export const WebChartBoxPlotMultipleSeriesKinds: {
    readonly Side: "sideBySide";
    readonly MeanLines: "meanLines";
};

export type WebChartBoxPlotMultipleSeriesKinds = (typeof WebChartBoxPlotMultipleSeriesKinds)[keyof typeof WebChartBoxPlotMultipleSeriesKinds];

export const WebChartSortOrderKinds: {
    readonly Ascending: "ASC";
    readonly Descending: "DESC";
};

export type WebChartSortOrderKinds = (typeof WebChartSortOrderKinds)[keyof typeof WebChartSortOrderKinds];

export const StatisticsDefaults: {
    readonly statisticType: "count";
    readonly sortingOrder: "ASC";
};

/** Represents the different types of smoothing that can be applied to a line chart when the `lineSmoothed` property is set to `true`. */
export const WebChartLineSmoothedKinds: {
    readonly Bezier: "bezier";
    readonly MonotoneX: "monotoneX";
    readonly MonotoneY: "monotoneY";
};

export type WebChartLineSmoothedKinds = (typeof WebChartLineSmoothedKinds)[keyof typeof WebChartLineSmoothedKinds];

/** The temporal binning units */
export const WebChartTemporalBinningUnits: {
    readonly Second: "seconds";
    readonly Minute: "minutes";
    readonly Hour: "hours";
    readonly Day: "days";
    readonly Week: "weeks";
    readonly Month: "months";
    readonly Quarter: "quarters";
    readonly Year: "years";
};

export type WebChartTemporalBinningUnits = (typeof WebChartTemporalBinningUnits)[keyof typeof WebChartTemporalBinningUnits];

/** Represents the units that can be used for calendar-based date parts binning. */
export const WebChartCalendarDatePartsUnits: {
    readonly DayOfMonth: "dayOfMonth";
    readonly DayOfWeek: "dayOfWeek";
    readonly DayOfYear: "dayOfYear";
    readonly HourOfDay: "hourOfDay";
    readonly MonthOfYear: "monthOfYear";
    readonly MinuteOfDay: "minuteOfDay";
    readonly WeekOfYear: "weekOfYear";
    readonly QuarterOfYear: "quarterOfYear";
};

export type WebChartCalendarDatePartsUnits = (typeof WebChartCalendarDatePartsUnits)[keyof typeof WebChartCalendarDatePartsUnits];

/** The temporal binning units for the calendar based binning offset */
export const WebChartCalendarBinningOffsetUnits: {
    readonly Second: "seconds";
    readonly Minute: "minutes";
    readonly Hour: "hours";
    readonly Day: "days";
};

export type WebChartCalendarBinningOffsetUnits = (typeof WebChartCalendarBinningOffsetUnits)[keyof typeof WebChartCalendarBinningOffsetUnits];

/** Represents the different types of heat rule that can be applied to a heat chart. */
export const WebChartHeatChartHeatRulesTypes: {
    readonly Gradient: "gradient";
    readonly Renderer: "renderer";
};

export type WebChartHeatChartHeatRulesTypes = (typeof WebChartHeatChartHeatRulesTypes)[keyof typeof WebChartHeatChartHeatRulesTypes];

/** Represents the different types of null policy that can be applied to a chart using the time binning feature. */
export const WebChartNullPolicyTypes: {
    readonly Null: "null";
    readonly Zero: "zero";
    readonly Interpolate: "interpolate";
};

export type WebChartNullPolicyTypes = (typeof WebChartNullPolicyTypes)[keyof typeof WebChartNullPolicyTypes];

/** Represents the different types of time aggregation that can be applied to a chart using the time binning feature. */
export const WebChartTimeAggregationTypes: {
    readonly Start: "equalIntervalsFromStartTime";
    readonly End: "equalIntervalsFromEndTime";
};

export type WebChartTimeAggregationTypes = (typeof WebChartTimeAggregationTypes)[keyof typeof WebChartTimeAggregationTypes];

/** Represents the different types of behaviors that can applied to a chart axis. */
export const WebChartLabelBehavior: {
    readonly Hide: "hide";
    readonly Rotate: "rotate";
    readonly Stagger: "stagger";
    readonly Wrap: "wrap";
};

export type WebChartLabelBehavior = (typeof WebChartLabelBehavior)[keyof typeof WebChartLabelBehavior];

export const WebChartVersionStatus: {
    readonly Same: "same";
    readonly Newer: "newer";
    readonly Older: "older";
    readonly Unrecognized: "unrecognized";
};

export type WebChartVersionStatus = (typeof WebChartVersionStatus)[keyof typeof WebChartVersionStatus];

/** Represents the different types of axes that can be used in a chart. */
export const WebChartAxisTypes: {
    readonly Value: "value";
    readonly Date: "date";
    readonly Category: "category";
};

export type WebChartAxisTypes = (typeof WebChartAxisTypes)[keyof typeof WebChartAxisTypes];

/** Represents the different types of gauge charts. */
export const GaugeChartSubTypes: {
    readonly FeatureGauge: "featureGauge";
    readonly StatisticGauge: "statisticGauge";
};

export type GaugeChartSubTypes = (typeof GaugeChartSubTypes)[keyof typeof GaugeChartSubTypes];

/** Represents the types of scales that can be applied to the size policy. Use by bubble charts (scatterplot). */
export const SizePolicyScaleTypes: {
    readonly Linear: "linear";
    readonly Logarithmic: "logarithmic";
};

export type SizePolicyScaleTypes = (typeof SizePolicyScaleTypes)[keyof typeof SizePolicyScaleTypes];

/** Labels orientation for radar chart axes. */
export const WebChartRadarChartAxisLabelsOrientation: {
    readonly Radial: "radial";
    readonly Circular: "circular";
    readonly Horizontal: "horizontal";
};

export type WebChartRadarChartAxisLabelsOrientation = (typeof WebChartRadarChartAxisLabelsOrientation)[keyof typeof WebChartRadarChartAxisLabelsOrientation];

/** The types of order assocated with chart data. */
export const WebChartOrderDataByTypes: {
    readonly YValue: "arcgis-charts-y-value";
    readonly Mean: "arcgis-charts-mean";
    readonly Median: "arcgis-charts-median";
    readonly Category: "arcgis-charts-category";
    readonly MultiAxes: "arcgis-charts-multi-axes";
};

export type WebChartOrderDataByTypes = (typeof WebChartOrderDataByTypes)[keyof typeof WebChartOrderDataByTypes];

/**
 * A data order option that allows the items to be ordered on both the x- and y-axes;
 *
 * For each axis, the order can be either a direction (ascending or descending) for all axis types;
 * or a predefined list of labels when the axis is categorical.
 *
 * @remarks This order option is currently only used in heat charts.
 */
export interface WebChartMultiAxesDataOrder {
  /** The type of order, which is two dimensional. */
  orderType: "arcgis-charts-multi-axes";
  /** The direction of the order for the x axis. If the axis is categorical, this can also be a predefined list of labels. */
  orderByX?: string[] | WebChartSortOrderKinds;
  /** The direction of the order for the y axis. If the axis is categorical, this can also be a predefined list of labels. */
  orderByY?: string[] | WebChartSortOrderKinds;
}

/**
 * A data order option that allows the items to be ordered either ascending or descending.
 * This option can be used for the following types of order: by category, by mean, by median, and by y value.
 *
 * @remarks This order option is currently not available for Heat charts.
 */
export interface WebChartDirectionalDataOrder {
  /** The type of order, eg by category, by mean, by median, or by y value. */
  orderType: "arcgis-charts-category" | "arcgis-charts-mean" | "arcgis-charts-median" | "arcgis-charts-y-value";
  /** The direction of the order, either ascending or descending. */
  orderBy: WebChartSortOrderKinds;
  /**
   * Indicates whether to order data by the label or the value.
   *
   * For example, when a field has domain coded values or supbtypes, setting this property to `false` will order the data by the field value.
   * Otherwise the domain description, subtypes description, or the alias of the field will be used to sort the data.
   *
   * @default true
   */
  preferLabel?: boolean;
}

/** A data order option that allows the items to be ordered by `category` based on a predefined list of labels. */
export interface WebChartPredefinedLabelsDataOrder {
  /** The type of order, which is by category. */
  orderType: "arcgis-charts-category";
  /**
   * The predefined list of labels to order the data by.
   *
   * When the value of the `preferLabel` property is set to `false`, the `orderBy` list should be a list of
   * coded domain values or field names; otherwise, it should be a list of domain descriptions, subtypes descriptions, or field aliases.
   */
  orderBy: string[];
  /**
   * Indicates whether to order data by the label or the value.
   *
   * For example, when a field has domain coded values or supbtypes, setting this property to `false` will order the data by the field value.
   * Otherwise the domain description, subtypes description, or the alias of the field will be used to sort the data.
   *
   * When the value is set to `true` or undefined, the `orderBy` property should contain a list of labels like domain descriptions, subtypes descriptions, or field aliases.
   * When the value is set to `false`, the `orderBy` property should contain a list of coded domain values or field names, in order for the data to be sorted correctly.
   *
   * @default true
   */
  preferLabel?: boolean;
}

/** Order options for split-by series. */
export interface WebChartOrderSeriesBy {
  /**
   * When the value is set to true, we want to order the split-by series based on the series' names (alias, custom label, or description).
   *
   * When the value is set to false, we want to order the split-by series based on the series' split-by values.
   *
   * @default true
   */
  preferLabel?: boolean;
  /**
   * The direction of the order.
   *
   * @default WebChartSortOrderKinds.Ascending
   */
  orderBy?: WebChartSortOrderKinds;
}

/** Represents the different types of views that can be applied to a heat chart. */
export const WebChartHeatChartViewTypes: {
    readonly singleCalendarView: "SingleCalendarView";
    readonly sequentialCalendarViews: "SequentialCalendarViews";
};

export type WebChartHeatChartViewTypes = (typeof WebChartHeatChartViewTypes)[keyof typeof WebChartHeatChartViewTypes];

/** Class break types for data classification in charts. */
export const WebChartClassBreakTypes: {
    readonly equalInterval: "equal-interval";
    readonly quantile: "quantile";
    readonly naturalBreaks: "natural-breaks";
    readonly manual: "manual";
};

/** Class break types for data classification in charts. */
export type WebChartClassBreakTypes = (typeof WebChartClassBreakTypes)[keyof typeof WebChartClassBreakTypes];