UNPKG

@ssa-ui-kit/widgets

Version:
29 lines (28 loc) 1.03 kB
import { Point, LineSvgProps, CustomLayerProps } from '@nivo/line'; import { ScaleTimeSpec } from '@nivo/scales'; import { MainColors, DropdownOptionProps } from '@ssa-ui-kit/core'; export interface OptionType extends DropdownOptionProps { value: 'd' | 'w' | 'm'; label: string; precision: string; } export interface MealNutrientsProps { caption?: string; options: OptionType[]; data: LineSvgProps['data']; onOptionChange?: (option: OptionType) => void; } export interface MealNutrientsTooltipProps { colorName: keyof MainColors; point: Exclude<Point, 'data'> & { data: Point['data'] & { comp?: number; unit?: string; }; }; } export type UseChartConfig = (ref: React.RefObject<HTMLElement>, data: LineSvgProps['data'], precision: ScaleTimeSpec['precision'] | 'week') => Pick<LineSvgProps, 'xScale' | 'axisBottom'>; export type ScaleSpec = LineSvgProps['xScale']; export type CustomPointLayerProps = CustomLayerProps & { currentPoint?: Point; };