/**
 * Candlestick chart type definitions
 * @countermeasure/web-components/charts/candlestick/types
 */

import type { BaseChartConfig, AxisConfig, TooltipConfig } from '../types'

export interface CandlestickItem {
  date: string
  open: number
  high: number
  low: number
  close: number
  volume?: number
}

export interface CandlestickChartConfig extends BaseChartConfig {
  /** OHLC bars rendered along the time axis in order. */
  data: CandlestickItem[]
  /** Optional X-axis configuration override. */
  xAxis?: AxisConfig
  /** Optional Y-axis configuration override. */
  yAxis?: AxisConfig
  /** Optional tooltip configuration (formatter, enabled flag). */
  tooltip?: TooltipConfig
  /**
   * Color used for bullish (close ≥ open) candles.
   * @default '#22c55e'
   */
  upColor?: string
  /**
   * Color used for bearish (close < open) candles.
   * @default '#ef4444'
   */
  downColor?: string
  /**
   * Render a volume bar chart beneath the candles.
   * @default false
   */
  showVolume?: boolean
}
