import type { ChartModel } from "../chart-model/chart-model.js";
import type { ModelParams } from "../interfaces/chart-interfaces.js";
import type { ModelTypes, PieChartDataSortingKinds, PieChartSlicesDisplay, PieChartDataModes } from "../interfaces/common.js";
import type { WithColorMatch } from "../properties/color-match.js";
import type { WithDataLabelsVisibility } from "../properties/data-labels/data-labels-visibility.js";
import type { WithDataLabelsSymbol } from "../properties/data-labels/data-labels-symbol.js";
import type { PieChartLegendModel } from "./pie-chart-legend-model.js";
import type { ChartConfig } from "../../utils/types/index.js";
import type { WebChartPieChartGroupSlice, WebChartPieChartSlice } from "../../spec/web-chart.js";
import type { WebChartStatisticType } from "../../spec/chart-object-literals.js";
import type { Color, ISimpleLineSymbol } from "../../spec/rest-js-types.js";
import type { ModelWithTooltips } from "../mixins/model-with-tooltips.js";

export class PieChartModel extends PieChartModelSuperclass {
  /** Aggregation type for the pie chart. */
  accessor aggregationType: WebChartStatisticType;
  /** Align the data labels on the left or right side of the chart instead of the default position around the chart. */
  accessor alignDataLabels: boolean | undefined;
  /** Category field for the pie chart. */
  accessor category: string;
  /** Setting for placing the data labels inside of the slices. */
  accessor dataLabelsInside: boolean | undefined;
  /** Offset for the data labels. */
  accessor dataLabelsOffset: number;
  /** Number of decimal places to display in the slice values. */
  accessor decimalPlaces: number;
  /**
   * Whether to display the category on the data label.
   * **Note:** If the setting is not found in the config, it will default to `true`.
   */
  accessor displayCategoryOnDataLabel: boolean;
  /**
   * Display category value on tooltip setting from the chart config.
   *
   * **Note**: If the setting is not found in the config, it will default to `true`.
   */
  accessor displayCategoryValueOnTooltip: boolean;
  /**
   * Whether to display the numeric value on the data label.
   * **Note:** If the setting is not found in the config, it will default to `true`.
   */
  accessor displayNumericValueOnDataLabel: boolean;
  /**
   * Display numeric value on tooltip setting from the chart config.
   *
   * **Note**: If the setting is not found in the config, it will default to `true`.
   */
  accessor displayNumericValueOnTooltip: boolean;
  /**
   * Whether to display the percentage on the data label.
   *
   * **Note:** If the setting is not found in the config, it will default to `true`.
   */
  accessor displayPercentageOnDataLabel: boolean;
  /**
   * Display percentage on tooltip setting from the chart config.
   *
   * **Note**: If the setting is not found in the config, it will default to `true`.
   */
  accessor displayPercentageOnTooltip: boolean;
  /** Display type for the pie chart slices. Specifies whether to display the slices as a `percentage`, `value`, or `both`. */
  accessor displayType: PieChartSlicesDisplay;
  /** End angle of the pie chart. */
  accessor endAngle: number | null | undefined;
  /** Array of grouped slice ids for the pie chart. */
  accessor groupedSliceIds: string[];
  /** Threshold below which slices will be grouped. */
  accessor groupingThreshold: number;
  /** Inner radius size for the pie chart. */
  accessor innerRadiusSize: number;
  /** Character limit for the slice labels. */
  accessor labelCharacterLimit: number | null;
  /**
   * The pie chart data mode.
   *
   * `category` - The chart is using values from the category field to determine each slice.
   * `fields` - The chart is using aggregated values from the numeric fields to determine each slice.
   */
  accessor mode: PieChartDataModes;
  /** Numeric fields for the pie chart. */
  get numericFields(): string[];
  set numericFields(value: string[] | string);
  /** Optimize data labels overlapping setting for the pie chart. */
  accessor optimizeDataLabelsOverlapping: boolean | undefined;
  /**
   * List of category's values for custom sort.
   *
   * @example
   * ```ts
   * pieChartModel.orderByList = ["Field1", "Field2", "Field3"];
   * ```
   */
  accessor orderByList: string[];
  /** Order of the slice array by returning an array of slice ids */
  accessor orderOfSlices: string[] | undefined;
  /** Prefix of the percentages of the slices. */
  accessor percentagePrefix: string | undefined;
  /** Suffix of the percentages of the slices. */
  accessor percentageSuffix: string | undefined;
  /** Slice grouping configuration for the pie chart. */
  accessor sliceGrouping: WebChartPieChartGroupSlice | undefined;
  /** Array of slices for the pie chart. */
  accessor slices: WebChartPieChartSlice[] | undefined;
  /** Start angle of the pie chart. */
  accessor startAngle: number | null | undefined;
  /** Ticks symbol connecting slices to labels. */
  accessor ticksSymbol: ISimpleLineSymbol | undefined;
  /** Visibility of the ticks. */
  accessor ticksVisibility: boolean;
  /** Prefix of the values of the slices. */
  accessor valuePrefix: string | undefined;
  /** Suffix of the values of the slice. */
  accessor valueSuffix: string | undefined;
  /** Generate the proper chart title given the current config. */
  generateChartTitle(): string;
  /** Gets the list of the category values for the chart. */
  getCustomSortValues(): Promise<string[]>;
  /**
   * Gets the original name of the slice based on the slice index.
   *
   * @param sliceIndex - The index of the slice.
   */
  getOriginalSliceName(sliceIndex: number): Date | number | string | null | undefined;
  /**
   * Gets the color of the slice based on the slice index. If the index is out of bounds, this function will return `undefined`.
   *
   * @param sliceIndex - The index of the slice.
   */
  getSliceColor(sliceIndex: number): Color | undefined;
  /**
   * Gets the slice id for a given slice index. If the index is out of bounds, this function will return `undefined`.
   *
   * @param sliceIndex - The index of the slice.
   */
  getSliceId(sliceIndex: number): string | undefined;
  /**
   * Gets the slice index for a given slice id. If the `sliceId` is not found, this function will return `undefined`.
   *
   * @param sliceId - The id of the slice.
   */
  getSliceIndex(sliceId: string): number | undefined;
  /**
   * Gets the name of the slice based on the slice index. If the index is out of bounds, this function will return `undefined`.
   *
   * @param sliceIndex - The index of the slice.
   */
  getSliceName(sliceIndex: number): string | undefined;
  /** Gets the length of the slices array. */
  getSlicesLength(): number;
  /** Gets the sort order for the pie chart. */
  getSortOrder(): PieChartDataSortingKinds;
  /**
   * Moves the custom sort values in-place for the order by list in the config.
   * **Note:** This method should be only used when the sort order is set to `customSort`.
   *
   * @param fromIndex - The index to move the custom sort item from.
   * @param toIndex - The index to move the category item to.
   */
  moveCustomSortValuesInOrderByList(fromIndex: number, toIndex: number): void;
  /**
   * Moves a series from one index in the series array to another.
   *
   * @param fromIndex - Index to move the series from.
   * @param toIndex - Index to move the series to.
   */
  moveSeries(fromIndex: number, toIndex: number): void;
  /** Returns whether the series styling is able to be reset. */
  resetAvailable(): boolean;
  /** Resets the slices styling to the default styling. */
  resetSlices(): void;
  /**
   * Sets the color of the slice based on the slice index.
   *
   * @param color - The color for the slice.
   * @param sliceIndex - The index of the slice.
   */
  setSliceColor(color: Color | undefined, sliceIndex: number): void;
  /**
   * Sets name of the slice based on the slice index.
   *
   * @param name - The name for the slice.
   * @param sliceIndex - The index of the slice.
   */
  setSliceName(name: string, sliceIndex: number): void;
  /**
   * Sets the sort order for the pie chart.
   *
   * @param sortOrder - The sort order.
   * @param orderByList - The list of category values.
   */
  setSortOrder(sortOrder: PieChartDataSortingKinds, orderByList?: string[]): void;
  /**
   * Completes the async setup process for the chart model. Must be called before using the model.
   *
   * @param params
   */
  setup(params: ModelParams<ChartConfig<typeof ModelTypes.PieChart>>): Promise<void>;
}
declare const PieChartModelSuperclass: typeof ChartModel & typeof WithDataLabelsSymbol & typeof WithDataLabelsVisibility & typeof WithColorMatch & typeof ModelWithTooltips & typeof PieChartLegendModel