import { type SharedValue } from "react-native-reanimated"; import type { SkFont } from "@shopify/react-native-skia"; import type { ChartEngineLayout } from "../core/useLiveChartEngine"; import { type YAxisEntry } from "../draw/grid"; import type { ChartPadding } from "../draw/line"; import type { ReferenceLine } from "../types"; /** Screen-space geometry for one reference line / band, recomputed each frame. */ export interface ReferenceLineLayout { visible: boolean; /** Line y, or band top-edge y. */ y: number; /** Band bottom-edge y (value/time band); equals `y` for a plain line. */ yBottom: number; /** Left x extent of the plot (badge / label / connector anchor). */ x1: number; /** Right x extent of the plot (badge / label / connector anchor). */ x2: number; /** * Left x of the **drawn** line / band. Equals {@link x1} normally, or `0` * (canvas edge) when the line is full-width. Decoupled from {@link x1} so the * line can run through the gutter while the badge/label stays in the plot. */ lineX1: number; /** Right x of the drawn line / band: {@link x2} normally, or the canvas width when full-width. */ lineX2: number; /** Stroke the plain horizontal line (true for a plain Form-A line, or a full-width badged line). */ drawLine: boolean; /** Resolved label text (with appended value when `showValue`); "" when hidden. */ label: string; labelX: number; labelY: number; /** True when a Form-A value is off-screen (badge pinned to the edge + chevron). */ offAxis: boolean; /** Off-axis chevron points up (target above range) vs down (below). */ chevronUp: boolean; /** True when the value renders as a pill badge (icon / text / chevron tag). */ badge: boolean; /** Badge pill rect left x. */ pillX: number; /** Badge pill rect width. */ pillW: number; /** Badge icon glyph x (-1 when no icon). */ iconX: number; /** Badge icon glyph (""/none). */ icon: string; /** Off-axis chevron center x (-1 when no chevron). */ chevronCx: number; /** Connector dashed-line start x (-1 when no connector). */ connStart: number; /** Connector dashed-line end x. */ connEnd: number; } /** Axis-aligned screen rect of a reference-line badge pill (the press hit-target). */ export interface ReferenceBadgeRect { x: number; y: number; w: number; h: number; } /** * Screen-space pill rect for a Form-A reference line's **badge**, or `null` when * the line has no pressable badge (no `badge`/`offAxisBadge`, not a value line, a * legacy off-axis badge while in range, or the canvas isn't laid out / range is * degenerate). Shares `badgeGeometry` + the edge classification with * {@link useReferenceLine}, so the hit-target tracks the rendered pill exactly. * Pure worklet — used by {@link useReferenceLinePress} for tap hit-testing. */ export declare function computeReferenceBadgeRect(line: ReferenceLine, canvasWidth: number, canvasHeight: number, padding: ChartPadding, dMin: number, dMax: number, font: SkFont, formatValue: (value: number) => string, /** Live value override (e.g. a dragged value), defaulting to `line.value`. */ valueOverride?: number): ReferenceBadgeRect | null; /** * Derives screen-space layout for a single reference line or band. Supports all * three scalar/band `ReferenceLine` forms (horizontal line, horizontal value * band, vertical time band) plus the pill badge for a Form-A value (in-range tag * + off-screen chevron pin). The series form is handled by * `ReferenceLineSeriesOverlay`. */ export declare function useReferenceLine(engine: ChartEngineLayout, padding: ChartPadding, line: ReferenceLine | undefined, formatValue: (v: number) => string, font: SkFont, /** * Per-line live value overrides (e.g. dragged values), index-aligned with the * chart's `referenceLines`. When provided and the slot at {@link index} holds a * number, the Form-A line tracks that value instead of the static `line.value`, * so a drag updates the rendered line/badge on the UI thread. Omit for static lines. */ dragValues?: SharedValue, index?: number, /** Y-axis labels used to match the right-anchored grid endpoint. */ yAxisEntries?: SharedValue, /** Enables clipping when set; matches {@link YAxisConfig.labelRightMargin}. */ labelRightMargin?: number, /** Gap before the label column; matches {@link YAxisConfig.gridEndGap}. */ gridEndGap?: number, /** Font used by the Y-axis labels; badge font overrides must not move the line. */ yAxisFont?: SkFont): SharedValue; //# sourceMappingURL=useReferenceLine.d.ts.map