import type { ScaleBand, ScaleLinear, ScaleSymLog, ScaleTime } from 'd3-scale'; import { TIME, type XYAxisAnyNumericalType, type XYAxisInternalTypes } from './axis.js'; import type { XYChartAxisInternal } from './xy-chart-internals.js'; import type { XYChartCategoricalAxisProps, XYChartLinearAxisInternalProps, XYChartLogAxisInternalProps, XYChartTimeAxisProps } from './xy-chart.js'; import { DateTimeFormatter, FormatterWithPrecision } from '../../core/types/formatter.js'; import type { AnyNumberScale, AnyScale, 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 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 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 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; };