import type { CandlePoint, LivelinePoint } from "liveline";
import type { LineChartPoint, LineChartSeries } from "./chart.types";
/** Utility helpers for normalizing and projecting chart series data for Liveline. */
export declare const normalizeSeries: (series: LineChartSeries[]) => LineChartSeries[];
export declare const formatDefaultChartValue: (value: number) => string;
export declare const resolveChartTimeFormatter: (windowSeconds: number) => (timestamp: number) => string;
export declare const toLivelinePoints: (points: LineChartPoint[]) => LivelinePoint[];
export declare const toLivelineCandles: (points: LineChartPoint[]) => CandlePoint[];
/**
 * Pad a sparse candle array so liveline always sees >= 2 entries.
 * Liveline treats `effectiveCandles.length < 2` as empty and draws "No data".
 * When only one candle exists we prepend a duplicate shifted back by one interval.
 */
export declare const padSparseCandles: (candles: CandlePoint[], intervalSeconds?: number) => CandlePoint[];
export declare const resolveCandleWidthSeconds: (points: LineChartPoint[], fallback?: number) => number | undefined;
export declare const resolveWindowSeconds: (normalizedSeries: LineChartSeries[]) => number;
/**
 * Renderer-only fallback. Liveline anchors its visible window to `Date.now()`
 * and refuses to draw fewer than 2 points per series, so this helper:
 *   - extends a series forward to "now" (projecting the last known value)
 *     when the tail is older than 5 minutes, and
 *   - pads single-point series with a duplicate shifted 5m back.
 *
 * **It is a fallback only.** The real-time pipeline keeps the chart fresh by
 * (a) ticking the rolling window's `nowSec`, (b) backfilling via REST refetch
 * at each candle bucket, and (c) promoting closed WS live candles into the
 * cached history. When those are working, `extendSeriesToNow` is a no-op.
 */
export declare const extendSeriesToNow: (series: LineChartSeries[]) => LineChartSeries[];
export declare const resolveLatestValue: (points: LineChartPoint[]) => number;
export declare const resolveActiveSeriesId: (series: LineChartSeries[], activeSeriesId: string | null) => string;
export declare const formatDefaultSeriesLabel: (seriesItem: LineChartSeries) => string;
export declare const resolveSelectedSeries: (series: LineChartSeries[], activeSeriesId: string) => LineChartSeries | undefined;
export declare const resolvePrimaryLineData: (primarySeries: LineChartSeries | undefined) => LivelinePoint[];
