import type { ChartModel } from "../chart-model/chart-model.js";
import type { WebChartNullPolicyTypes, WebChartTemporalBinningUnits, WebChartTimeAggregationTypes } from "../../spec/chart-object-literals.js";

export abstract class ModelWithTemporalBinning extends ChartModel {
  /**
   * Policy which tells the chart how to handle null values.
   *
   * `null`: Break the bar where null values are present.
   * `zero`: Treats null values as zero.
   * `interpolate`:
   *   - Bar series: same effect as `null`
   *   - Line series: connects the lines across null values.
   */
  accessor nullPolicy: WebChartNullPolicyTypes | undefined;
  /** Time interval size for a temporal bar chart or line chart. */
  accessor temporalBinningSize: number | undefined;
  /** Time interval units for a temporal bar chart or line chart. */
  accessor temporalBinningUnit: WebChartTemporalBinningUnits | undefined;
  /** Time aggregation type for a temporal bar chart or line chart. */
  accessor timeAggregationType: WebChartTimeAggregationTypes | undefined;
  /** Whether to trim incomplete time intervals for a temporal bar chart or line chart. */
  accessor trimIncompleteTimeInterval: boolean | undefined;
  /** Resets the time interval to default for a temporal line chart. */
  resetTimeInterval(): void;
}