import type { ChartOptions, DeepPartial, ISeriesApi, SeriesDataItemTypeMap, SeriesOptionsMap, SeriesType } from 'lightweight-charts'; import type { HSLColor, RGBColor } from '@refinitiv-ui/utils/color.js'; type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; type SeriesOptions = UnionToIntersection; type SeriesList = ISeriesApi; type SeriesDataItem = SeriesDataItemTypeMap[keyof SeriesDataItemTypeMap]; type RowLegend = NodeListOf | HTMLElement | null; type ColorToStringFunction = (param: string, ...arg: (string | number | undefined)[]) => RGBColor | HSLColor | null; type LegendStyle = 'vertical' | 'horizontal'; interface InteractiveChartConfig { series: InteractiveChartSeries[]; options?: DeepPartial; } interface Theme { color?: string; backgroundColor: string; textColor: string; scalePriceBorderColor: string; scaleTimesBorderColor: string; gridVertLineColor: string; gridHorzLineColor: string; crossHairColor: string; chartUpColor: string; chartDownColor: string; fillOpacity?: number; lineWidth?: number; } interface InteractiveChartSeries { type: string; symbol?: string; symbolName?: string; legendVisible?: boolean; legendPriceFormatter?: (price: string | number) => string | number; data: SeriesDataItem[]; seriesOptions?: SeriesOptions; } export { InteractiveChartConfig, InteractiveChartSeries, Theme, RowLegend, SeriesList, SeriesDataItem, SeriesOptions, ColorToStringFunction, LegendStyle };