import { type ReactNode } from 'react'; import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units'; import type { ThresholdMetadata, TooltipConfigData } from './meter-bar-chart-internal.js'; import type { MeterBarChartThresholdIndicatorProps } from './meter-bar-chart.js'; import { ColorRuleProps } from '../../../core/types/color-rule.js'; import type { Formatter } from '../../../core/types/formatter.js'; import { MeterBarToolbarConfig } from '../../shared/types/meter-bar-toolbar.js'; import type { MeterBarSize, SlotWithAutoDefault } from '../../shared/types/meter-bars.js'; /** * @internal */ export interface MeterBarChartSlots { label?: ReactNode; min?: SlotWithAutoDefault; max?: SlotWithAutoDefault; value?: SlotWithAutoDefault; thresholds?: ThresholdMetadata; tooltip?: TooltipConfigData; colorRules: ColorRuleProps[]; toolbar?: MeterBarToolbarConfig; } /** * Tooltip configuration to be provided by the consumer. * @public */ export interface MeterBarChartTooltipConsumerConfig { /** * Set to true to hide the tooltip. * @defaultValue false */ hidden?: boolean; } /** * Configuration props to be provided by the consumer * @public */ export interface MeterBarChartConsumerConfig { /** * The chart thresholds to include inside meter bar charts that are within the configuration */ thresholdsIndicators?: MeterBarChartThresholdConsumerConfig; /** * The size to apply to meter bar charts that are within the configuration * @defaultvalue 'size16' */ size?: MeterBarSize; /** * The custom unit for the value of the meter bar. */ unit?: string | Unit; /** * Min value for the meter bar chart scale * @defaultValue 0 */ min?: number; /** * Max value for the meter bar chart scale * @defaultValue 100 */ max?: number; /** Show the loading indicator when truthy. * @defaultValue false */ loading?: boolean; /** * Custom Formatter for the chart */ formatter?: Formatter | FormatOptions; /** * Tooltip configuration. Pass `{ hidden: true }` to hide the tooltip. * @defaultValue \{ hidden: false \} */ tooltip?: MeterBarChartTooltipConsumerConfig /** * @deprecated Use `tooltip: { hidden: boolean }` instead. (APPDEV-17990) */ | boolean; /** Color rules to apply to the meter bar chart */ colorRules?: ColorRuleProps[]; /** Configuration for the toolbar */ toolbar?: MeterBarToolbarConfig; } /** * Threshold configuration props to be provided by the consumer * @public */ export interface MeterBarChartThresholdConsumerConfig { /** * The data input for a list of thresholds * @defaultValue [] */ data?: MeterBarChartThresholdIndicatorProps[]; /** * Set to true to display the threshold legend and false to hide it. * @defaultValue false */ legend?: boolean; }