import { SparkChartPadding, SparkSeries } from './types'; export declare const DEFAULT_CHART_PADDING: SparkChartPadding; export interface ProjectedPoint { x: number; y: number; } export interface ProjectionBox { width: number; height: number; padding: SparkChartPadding; } export declare function resolvePadding(padding?: Partial): SparkChartPadding; export declare function clamp(value: number, min: number, max: number): number; /** * Fits every series into one shared value range. A flat series is padded by ±1 * so it draws through the middle instead of collapsing onto an edge. */ export declare function resolveValueDomain(series: SparkSeries[], explicit?: [number, number]): [number, number]; /** * Shared time range. A zero span (single sample, or every sample stamped alike) * returns a collapsed range and callers fall back to index spacing. */ export declare function resolveTimeDomain(series: SparkSeries[]): [number, number]; export declare function projectSeries(series: SparkSeries, box: ProjectionBox, timeDomain: [number, number], valueDomain: [number, number]): ProjectedPoint[]; /** Pointer progress (0–1 across the stage) to the nearest sample index. */ export declare function indexFromRatio(ratio: number, pointCount: number): number; /** Sample index back to progress, for placing the cursor line. */ export declare function ratioFromIndex(index: number, pointCount: number): number; /** Horizontal gutters the samples are inset by — the axis labels live here. */ export interface PlotInset { left: number; right: number; } /** * Pointer x to the nearest sample. Samples span the **plot box**, not the * stage: mapping the raw stage ratio drifts away from the drawn points by * whatever the y-axis gutter is, so the crosshair stops sitting on its sample. */ export declare function indexFromPointerX(clientX: number, rect: { left: number; width: number; }, pointCount: number, inset: PlotInset): number; /** Sample index to its x inside the plot box, in stage pixels. */ export declare function plotX(index: number, pointCount: number, inset: PlotInset, stageWidth: number): number; /** * Keeps the tooltip's centre inside the stage. The box is centred on the * cursor, so only the outer half-width at each end can overhang — clamping in * pixels lets it travel as far as the stage physically allows, where a fixed * percentage band freezes it over the outer third of a wide card. */ export declare function clampAnchorCenter(center: number, halfWidth: number, stageWidth: number, margin?: number): number;