import type { TimeseriesBandSlotProps } from './timeseries-band.js'; import type { ChartVariant, GapPolicy, PointsDisplay } from './timeseries-props.js'; import type { ColorToken } from '../../core/types/color-palette.js'; import type { ValueRepresentation } from '../../core/types/scales.js'; import type { Timeseries, TimeseriesUnit } from '../../core/types/timeseries.js'; /** * @public */ export type TimeseriesZoomDomain = Date[] | number[]; /** * @internal */ export type AxesUnits = [TimeseriesUnit, TimeseriesUnit]; /** * @internal */ export interface SeriesMetadata { id: string; color: ColorToken; gapPolicy: GapPolicy; pointsDisplay: PointsDisplay; unit?: TimeseriesUnit; originalUnit?: TimeseriesUnit; } interface DatapointsMapBase { seriesId: string; color: ColorToken; isGap: boolean; variant: ChartVariantInternal; start: Date; end?: Date; center?: Date; value?: number; unit?: TimeseriesUnit; absoluteValue?: number; cumulativeValue?: number; y0?: number; absoluteY0?: number; y1?: number; absoluteY1?: number; seriesName: string | string[]; originalUnit?: TimeseriesUnit; } interface DatapointsMapWithoutBand extends DatapointsMapBase { variant: ChartVariant; } export interface DatapointsMapBand extends DatapointsMapBase { variant: 'band'; y0: number; y1: number; } /** * @internal */ export type DatapointsMap = DatapointsMapWithoutBand | DatapointsMapBand; /** * @internal */ export type WeakMapSeries = WeakMap; /** * @internal */ export type WeakMapDatapoints = WeakMap; /** * @internal */ export type ValueRepresentationPerVariant = Map; /** * @internal */ export type TimeseriesSlotProps = TimeseriesVariantSlotProps | TimeseriesBandSlotProps; /** * @internal */ export type TimeseriesVariantSlotProps = TimeseriesLineSlotProps | TimeseriesAreaSlotProps | TimeseriesBarSlotProps; /** * @internal */ export type TimeseriesPerVariant = Record & { shapePriority: ChartVariantInternal[]; band: TimeseriesBandSlotProps[]; }; /** * @public */ export interface TimeseriesChartVisualProps { /** Custom color to represent this series. Overrides the colorPalette config. Eg: '#e1e1e1'**/ color?: string; /** Value representation of the series */ valueRepresentation?: ValueRepresentation; } /** * @internal */ export interface TimeseriesVisualSlotProps { /** Custom color to represent this series. Overrides the colorPalette config. Eg: '#e1e1e1'**/ color?: string; /** Value representation of the serie */ valueRepresentation?: ValueRepresentation; /** Gap policy config of the series */ gapPolicy?: GapPolicy; /** Points to display config of the series */ pointsDisplay?: PointsDisplay; } /** * @internal */ export interface TimeseriesLineSlotProps extends Timeseries, TimeseriesVisualSlotProps { } /** * @internal */ export interface TimeseriesAreaSlotProps extends Timeseries, TimeseriesVisualSlotProps { } /** * @internal */ export type ChartVariantInternal = ChartVariant | 'band'; /** * @internal */ export type TimeseriesBarSlotProps = Timeseries & TimeseriesVisualSlotProps; export {};