import { type RefObject } from "react"; export interface SectionNavHandle { /** Attach to the SCROLLING element — the one carrying `overflow-y`. */ scrollRef: RefObject; /** The section the scroll currently sits in — drives the rail item's `current`. */ activeKey: K; /** `ref={register(key)}` on each section. Stable per key, so a re-render never * detaches and re-attaches the node. */ register: (key: K) => (node: HTMLElement | null) => void; /** Scroll to a section — the rail item's `onPress`. */ jumpTo: (key: K) => void; /** `onScroll={nav.onScroll}` on the same element. It carries nothing: every * measurement is read off `scrollRef`. */ onScroll: () => void; } /** * Scroll-spy for a LONG record surface with a left outline rail: one scrolling * page whose sections register their nodes, a rail that jumps to them, and an * `activeKey` that follows the scroll. * * Pass the keys in PAGE ORDER — the spy walks them top-down. * * Both the jump AND the highlight read the live DOM position, so async content * growing ABOVE a section can never stale either. A section that unmounts keeps * its last measured offset rather than collapsing to the page top. * * The LAST key is active whenever the scroll reaches the end: a final section * shorter than the viewport never scrolls its top past the trigger line. */ export declare function useSectionNav(keys: readonly [K, ...K[]]): SectionNavHandle;