import type { ComponentOptions, PrefixStyleProps } from '../../core'; import type { GroupStyleProps, LineStyleProps, PathStyleProps, RectStyleProps, TextStyleProps } from '../../shapes'; import type { ExtendDisplayObject } from '../../types'; import type { SeriesAttr } from '../../util'; import type { TitleStyleProps } from './title'; import type { CategoryItemsStyleProps } from './category/items'; import type { HandleStyleProps } from './continuous/handle'; import type { RibbonStyleProps } from './continuous/ribbon'; export type Interpolate = (val: number) => T; export interface ContinuousBaseDatum { id?: string; [keys: string]: any; } export interface ContinuousDatum extends ContinuousBaseDatum { value: number; } export type LabelStyleProps = TextStyleProps & PrefixStyleProps & { align?: 'value' | 'range'; direction?: 'positive' | 'negative'; filter?: (val: T, index: number, arr: T[]) => boolean; formatter?: (val: T, index: number, arr: T[]) => string; /** spacing between label and legend ribbon */ spacing?: number; }; export type IndicatorStyleProps = PathStyleProps & TextStyleProps & { formatter: (val: T) => ExtendDisplayObject; indicate: (val: T) => void; padding: SeriesAttr; }; export type LegendBaseStyleProps = GroupStyleProps & PrefixStyleProps, 'background'> & PrefixStyleProps, 'title'> & { orientation?: 'horizontal' | 'vertical'; padding?: SeriesAttr; showTitle?: boolean; classNamePrefix?: string; }; export type LegendBaseOptions = ComponentOptions; export type ContinuousStyleProps = LegendBaseStyleProps & PrefixStyleProps>, 'handle'> & PrefixStyleProps>, 'indicator'> & PrefixStyleProps>, 'label'> & PrefixStyleProps>, 'ribbon'> & Partial> & { data: ContinuousDatum[]; domain?: [number, number]; defaultValue?: [number, number]; height: number; showHandle?: boolean; showIndicator?: boolean; showLabel?: boolean; showTick?: boolean; slidable?: boolean; step?: number; width: number; }; export type ContinuousOptions = ComponentOptions; export type CategoryStyleProps = LegendBaseStyleProps & CategoryItemsStyleProps & { dx?: number; dy?: number; }; export type CategoryOptions = ComponentOptions;