export interface ScrollSpyOptions { /** CSS selector for the headings to track */ selector?: string; /** Margin around the root element */ rootMargin?: string; /** Container to search for headings */ container?: string | HTMLElement; /** Function to get heading depth, defaults to h1=1, h2=2, etc. */ getDepth?: (el: Element) => number; /** Function to get text value from element, defaults to textContent */ getValue?: (el: Element) => string; /** Function to get ID from element, defaults to element ID or generated from text */ getId?: (el: Element) => string; /** Disable automatic active ID updates from scroll events */ disableAutoUpdate?: boolean; } export interface TocItem { /** Unique identifier for the heading */ id: string; /** Text content of the heading */ value: string; /** Heading depth, e.g. 1 for h1, 2 for h2, etc. */ depth: number; /** Function to get the underlying DOM node, if available */ getNode?: () => HTMLElement | null; } export interface UseScrollSpyReturn { /** Collected heading items */ items: TocItem[]; /** Currently active heading ID, or null if none */ activeId: string | null; /** Set the active ID programmatically */ setActiveId: (id: string | null) => void; /** Re-collect headings and re-initialize the observer */ reinitialize: () => void; } export declare function useScrollSpy(options?: ScrollSpyOptions, initialData?: TocItem[]): UseScrollSpyReturn; export type { TocItem as UseScrollSpyItem };