import type { SkFont } from "@shopify/react-native-skia"; import type { GridMetrics } from "../types"; export interface YAxisEntry { y: number; label: string; alpha: number; } export interface RightAnchoredYAxisColumnLayout { /** Shared left X for every label in the column. */ labelX: number; /** Grid/reference-line end X immediately before the column gap. */ gridEndX: number; } /** * Measure the widest Y-axis label and anchor the shared left-aligned column to * a fixed canvas-edge margin. Shared by the axis and reference-line worklets so * their right edges cannot drift apart. */ export declare function rightAnchoredYAxisColumnLayout(canvasWidth: number, entries: readonly YAxisEntry[], font: SkFont, labelRightMargin: number, gridEndGap?: number): RightAnchoredYAxisColumnLayout; /** * Fixed-count Y-axis: place exactly `count` price labels evenly **in pixels** * across the plot band — top = `displayMax`, bottom = `displayMin`. Values track * the live range each frame (no nice-number rounding), so the label count stays * constant while data streams in. * * `minGap` is a floor: the count drops to what fits when the plot is too short * to space `count` labels at least `minGap` px apart. Clamped to * `[2, MAX_Y_LABELS]`. Every entry is fully opaque — there's no per-line fade * because the count (and thus each line's pixel slot) doesn't change. */ export declare function fixedGridEntries(displayMax: number, valRange: number, chartH: number, padTop: number, count: number, minGap: number, formatValue: (v: number) => string): YAxisEntry[]; /** * Pick a nice Y-axis interval using TradingView's cycling divisor approach. * Hysteresis: once chosen, sticks until pixel spacing falls outside [0.5x, 4x] of minGap. */ export declare function pickInterval(valRange: number, pxPerUnit: number, minGap: number, prev: number): number; /** * Blend factor for fine (non-coarse) grid lines from pixel spacing. * Exposed for unit tests; matches `computeGridEntries` behaviour. */ export declare function fineLineTargetAlpha(finePx: number, minGap?: number): number; /** * Compute grid entries with per-label alpha fading. * `labelAlphas` is mutated in place (persistent state across frames). */ export declare function computeGridEntries(displayMin: number, displayMax: number, canvasHeight: number, padTop: number, padBottom: number, prevInterval: number, labelAlphas: Record, formatValue: (v: number) => string, dt: number, minGap?: number, grid?: GridMetrics, count?: number, intervalScale?: number): { entries: YAxisEntry[]; interval: number; }; //# sourceMappingURL=grid.d.ts.map