import { type SharedValue } from "react-native-reanimated"; import type { VisibleRange } from "../types"; export type { VisibleRange }; /** Engine SharedValues the visible-range reaction reads. */ export interface VisibleRangeEngineRefs { timestamp: SharedValue; displayWindow: SharedValue; viewEnd: SharedValue; } export interface UseVisibleRangeOptions { engine: VisibleRangeEngineRefs; /** Earliest retained time (unix seconds) — used for the `onReachStart` trigger. */ minTime: SharedValue; /** Fires (throttled to ~1 Hz) when the visible window's edges change. */ onVisibleRangeChange?: (range: VisibleRange) => void; /** * Fires once when the window's left edge comes within one window-width of the * earliest retained data — the cue to lazily page in older history. Re-arms * after the edge moves back out. */ onReachStart?: () => void; } /** * Throttle key for a visible range: integer seconds of each edge plus the * near-start flag. The reaction emits only when this changes, so a live chart * (whose right edge slides every frame) notifies at most ~once per second rather * than per frame, and `onReachStart` edge-triggers off the trailing flag. */ export declare function rangeSignature(startSec: number, endSec: number, near: boolean): string; /** Whether the window's left edge is within `threshold` seconds of the oldest data. */ export declare function isNearStart(winStart: number, minTime: number, threshold: number): boolean; /** * Bridges the UI-thread visible window to JS paging callbacks. A reaction watches * the window edges and `scheduleOnRN`s `onVisibleRangeChange` (throttled) and * `onReachStart` (edge-triggered near the oldest data). Inert when both callbacks * are absent. Used by both `LiveChart` and `LiveChartSeries`. */ export declare function useVisibleRange({ engine, minTime, onVisibleRangeChange, onReachStart, }: UseVisibleRangeOptions): void; //# sourceMappingURL=useVisibleRange.d.ts.map