/** * Represents a data series for the chart. * @template Data - The type of the data array for the series. */ interface Series { /** * Label of the series (used for legends, etc.). */ label: string; /** * Data values for the series. */ data: Data; } /** * Configuration for axis ticks. */ interface TickConfig { /** * The interval between ticks on the axis. */ interval: number; } /** * Configuration for the Y axis of the chart. */ interface YAxisConfig { /** * Maximum value for the Y axis. */ maxValue?: number; /** * Minimum value for the Y axis. */ minValue?: number; /** * Labels for the Y axis. */ labels?: Array; /** * Step size between ticks on the Y axis. */ step?: number; /** * Tick configuration for the Y axis. */ tick?: TickConfig; } /** * Configuration for the X axis of the chart. */ interface XAxisConfig { /** * Labels for the X axis. */ labels?: Array; } /** * Represents a single data value in the chart (can be a number or undefined). */ type DataValue = number | undefined; /** * Represents the position of an object in the chart. */ type AxisCoordinates = { xStart: number; xEnd: number; yStart: number; yEnd: number; }; /** * Represents the configuration for the header of the chart. */ type HeaderConfig = { title?: string; actionsExtra?: React.ReactNode; }; type ChartColor = 'primaryLight' | 'blueLight' | 'greenLight' | 'redLight' | 'orangeLight' | 'yellowLight' | 'pinkLight' | 'greyLight' | 'primaryMedium' | 'blueMedium' | 'greenMedium' | 'redMedium' | 'orangeMedium' | 'yellowMedium' | 'pinkMedium' | 'greyMedium'; /** * Represents the configuration for the style of the chart. */ type StyleConfig = { /** * Chart colors config. */ series?: Array<{ label: string; color?: ChartColor; }>; }; export type { Series, XAxisConfig, YAxisConfig, DataValue, AxisCoordinates, HeaderConfig, StyleConfig, };