import { ScaleLinear as D3ScaleLinear, ScalePoint as D3ScalePoint, ScaleBand as D3ScaleBand, ScaleLogarithmic as D3ScaleLogarithmic, ScaleSymLog as D3ScaleSymLog, ScaleTime as D3ScaleTime } from 'd3-scale'; import { TIME_PRECISION } from './timeHelpers'; export type ScaleAxis = 'x' | 'y'; export type OtherScaleAxis = Axis extends 'x' ? 'y' : 'x'; export type NumericValue = { valueOf(): number; }; export type StringValue = { toString(): string; }; export type ScaleValue = NumericValue | StringValue | Date | null; export interface ScaleTypeToSpec { linear: ScaleLinearSpec; log: ScaleLogSpec; symlog: ScaleSymlogSpec; point: ScalePointSpec; band: ScaleBandSpec; time: ScaleTimeSpec; } export type ScaleType = keyof ScaleTypeToSpec; export type ScaleSpec = ScaleTypeToSpec[keyof ScaleTypeToSpec]; export type ReversibleScaleSpec = ScaleLinearSpec | ScaleLogSpec | ScaleSymlogSpec; export declare const isReversibleScaleSpec: (scaleSpec: ScaleSpec) => scaleSpec is ReversibleScaleSpec; export interface ScaleTypeToScale { linear: Input extends NumericValue ? ScaleLinear : never; log: Input extends NumericValue ? ScaleLog : never; symlog: Input extends NumericValue ? ScaleSymlog : never; point: Input extends StringValue ? ScalePoint : never; band: Input extends StringValue ? ScaleBand : never; time: Input extends StringValue | Date ? ScaleTime : never; } export type Scale = ScaleTypeToScale[keyof ScaleTypeToScale]; export type ScaleLinearSpec = { type: 'linear'; min?: 'auto' | number; max?: 'auto' | number; stacked?: boolean; reverse?: boolean; clamp?: boolean; nice?: boolean | number; round?: boolean; }; export interface ScaleLinear extends D3ScaleLinear { type: 'linear'; stacked: boolean; } export interface ScaleLogSpec { type: 'log'; base?: number; min?: 'auto' | number; max?: 'auto' | number; round?: boolean; reverse?: boolean; nice?: boolean | number; } export interface ScaleLog extends D3ScaleLogarithmic { type: 'log'; } export interface ScaleSymlogSpec { type: 'symlog'; constant?: number; min?: 'auto' | number; max?: 'auto' | number; round?: boolean; reverse?: boolean; nice?: boolean | number; } export interface ScaleSymlog extends D3ScaleSymLog { type: 'symlog'; } export type ScalePointSpec = { type: 'point'; }; export interface ScalePoint extends D3ScalePoint { type: 'point'; } export type ScaleBandSpec = { type: 'band'; round?: boolean; }; export interface ScaleBand extends D3ScaleBand { type: 'band'; } export type ScaleTimeSpec = { type: 'time'; format?: 'native' | string; precision?: TIME_PRECISION; min?: 'auto' | Date | string; max?: 'auto' | Date | string; useUTC?: boolean; nice?: boolean; }; export interface ScaleTime extends D3ScaleTime { type: 'time'; useUTC: boolean; } export type AnyScale = Scale; export type ScaleWithBandwidth = ScaleBand | ScalePoint; export type Series = { data: { data: { x: XValue | null; y: YValue | null; }; }[]; }[]; export type SerieAxis = { data: { data: Record; }[]; }[]; export type ComputedSerieAxis = { all: readonly Value[]; min: Value; minStacked?: Value; max: Value; maxStacked?: Value; }; export type TicksSpec = number | string | readonly Value[]; //# sourceMappingURL=types.d.ts.map