import type { ScaleBand, ScaleLinear, ScaleSymLog, ScaleTime } from 'd3-scale'; import { type CATEGORICAL, TIME, type XYAxisAnyNumericalType, type XYAxisInternalTypes } from './axis.js'; import type { XYChartExploreState } from './state.js'; import { DOT_VARIANT, DotSeriesWithDatapoints, LINE_VARIANT, LineSeriesWithDatapoints, AREA_VARIANT, AreaSeriesWithDatapoints, XYChartAxisInternal, type XYChartColorScale, type XYChartLinearAxisInternalProps, type XYChartLogAxisInternalProps } from './xy-chart-internals.js'; import type { XYChartCategoricalAxisProps, XYChartTimeAxisProps } from './xy-chart-props.js'; import type { XYChartSelectionLinearMetadata, DotOrLineSelection } from './xy-chart-selection.js'; import type { DotDatapoint, LineDatapoint, AreaDatapoint, XYChartData } from './xy-chart.js'; import { DateTimeFormatter, FormatterWithPrecision } from '../../core/types/formatter.js'; import type { AnyNumberScale, AnyScale, CategoricalScales, DateScales } from '../../core/types/scales.js'; /** * Type guard to check if the value is a primitive number * @param value - a value to be checked * @returns return true if it's a number or false if it's not **/ export declare const isNumber: (value: unknown) => value is number; /** * Type guard to check if the value is a primitive string * @param value - a value to be checked * @returns return true if it's a string or false if it's not **/ export declare const isString: (value: unknown) => value is string; /** * Type guard to check if the value is a instance of Date object * @param value - a value to be checked * @returns return true if it's a Date object or false if it's not **/ export declare const isDate: (value: unknown) => value is Date; export declare const isFunction: (fn: unknown) => fn is (data: T) => U; export interface DotScaleTime { scale: ScaleTime; v0: Date; v1: Date | undefined; } export interface DotScaleLog { scale: ScaleSymLog; v0: number; } export interface DotScaleLinear { scale: ScaleLinear; v0: number; v1: undefined; } export interface DotScaleBand { scale: ScaleBand; v0: string; v1: undefined; } export interface LineScaleTime { scale: ScaleTime; v0: Date; v1: Date | undefined; } export interface LineScaleLog { scale: ScaleSymLog; v0: number; } export interface LineScaleLinear { scale: ScaleLinear; v0: number; v1: undefined; } export interface LineScaleBand { scale: ScaleBand; v0: string; v1: undefined; } export interface BarScaleTime { scale: ScaleTime; v0: Date | undefined; v1: Date | undefined; } export interface BarScaleLog { scale: ScaleSymLog; v0: number | undefined; v1: number | undefined; } export interface BarScaleLinear { scale: ScaleLinear; v0: number | undefined; v1: number | undefined; } export interface BarScaleBand { scale: ScaleBand; v0: string | undefined; v1: undefined; } export interface AreaScaleTime { scale: ScaleTime; v0: Date | undefined; v1: Date | undefined; } export interface AreaScaleLog { scale: ScaleSymLog; v0: number | undefined; v1: number | undefined; } export interface AreaScaleLinear { scale: ScaleLinear; v0: number | undefined; v1: number | undefined; } export interface AreaScaleBand { scale: ScaleBand; v0: string | undefined; v1: string | undefined; } export interface TooltipCategorical { formatter: undefined; v0: string; v1: undefined; } export interface TooltipNumerical { formatter: FormatterWithPrecision; v0: number; v1: number; } export interface TooltipTime { formatter: DateTimeFormatter; v0: Date; v1: Date; } export interface NumericalHoveringPoint { v0: number; scale: ScaleLinear; } export interface TimeHoveringPoint { v0: Date; scale: ScaleTime; } export interface CategoricalHoveringPoint { v0: string; scale: ScaleBand; } export interface RectScaleLinear { scale: ScaleLinear; v0: number; v1: number; } export interface RectScaleLog { scale: ScaleSymLog; v0: number; v1: number; } export interface RectScaleTime { scale: ScaleTime; v0: Date; v1: Date; } export interface RectScaleBand { scale: ScaleBand; v0: string; v1: never; } export declare const isLinear: (axisType: string) => boolean; export declare const isLogarithmic: (axisType: string) => boolean; export declare const isTime: (axisType: string) => boolean; export declare const isCategorical: (axisType: string) => boolean; export declare const isNumerical: (axisType: string) => boolean; export declare const isAnyNumber: (axisType: string) => boolean; export declare function isLinearAxis(axis: XYChartAxisInternal): axis is XYChartAxisInternal & XYChartLinearAxisInternalProps; export declare function isLogarithmicAxis(axis: XYChartAxisInternal): axis is XYChartAxisInternal & XYChartLogAxisInternalProps; export declare function isNumericalAxis(axis: XYChartAxisInternal): axis is XYChartAxisInternal & (XYChartLinearAxisInternalProps | XYChartLogAxisInternalProps); export declare function isAnyNumericalAxis(axis: T): axis is T & { type: XYAxisAnyNumericalType; }; export declare function isTimeAxis(axis: XYChartAxisInternal): axis is XYChartAxisInternal & XYChartTimeAxisProps; export declare function isCategoricalAxis(axis: { type: XYChartAxisInternal['type']; }): axis is XYChartAxisInternal & XYChartCategoricalAxisProps; export declare function isCategoricalScale(args: { axisType: XYAxisInternalTypes | undefined; axisScale: AnyScale | undefined; }): args is { axisType: CATEGORICAL; axisScale: CategoricalScales; }; export declare function isTimeScale(args: { axisType: XYAxisInternalTypes | undefined; axisScale: AnyScale | undefined; }): args is { axisType: TIME; axisScale: DateScales; }; export declare function isAnyNumericalScale(args: { axisType: XYAxisInternalTypes | undefined; axisScale: AnyScale | undefined; }): args is { axisType: XYAxisInternalTypes; axisScale: AnyNumberScale; }; export declare function isDotContentPoint(content: XYChartExploreState['content']): content is { type: typeof DOT_VARIANT; series: DotSeriesWithDatapoints; datapoint: DotDatapoint; }; export declare function isLineContentPoint(content: XYChartExploreState['content']): content is { type: typeof LINE_VARIANT; series: LineSeriesWithDatapoints; datapoint: LineDatapoint; }; export declare function isAreaContentPoint(content: XYChartExploreState['content']): content is { type: typeof AREA_VARIANT; series: AreaSeriesWithDatapoints; datapoint: AreaDatapoint; }; export declare function isNumericColoringScale(colorScale: XYChartColorScale): boolean; export declare const isValidCategoryValue: (value: unknown) => value is string; export declare function isDotOrLineSelection(point: XYChartSelectionLinearMetadata): point is DotOrLineSelection;