/** * createTOC(options) * * A small, dependency-free TOC builder for static/dynamically inserted HTML. */ export type TOCOptions = { contentSelector: string; tocSelector: string; headingSelector?: string; excludeHeadingLevels?: number[]; addNumbers?: boolean; activeClass?: string; linkClass?: string; scrollBehavior?: ScrollIntoViewOptions; }; /** * Attach an IntersectionObserver to all anchor links inside the provided * TOC container. The function will lookup each link's target id * (from data-target-id or href) and observe the corresponding element in * the document. When a heading becomes visible, the corresponding link * inside the container will receive the `active` class by default (or a * custom class provided via options.activeClass). Returns the observer and * a destroy() helper to disconnect it when no longer needed. */ export declare function attachObserverToTOCLinks(tocId: string, options?: { activeClass?: string; root?: Element | null; rootMargin?: string; threshold?: number | number[]; }): { observer: IntersectionObserver; destroy: () => void; }; type HeadingData = { id: string; text: string; level: number; }; /** * Render TOC as an HTML string from HeadingData array. * This does not touch the DOM — it simply returns the HTML so you can insert it * into your renderer or manipulate it as you wish. */ export declare function renderTOCHTML(headingsData: HeadingData[], opts?: { addNumbers?: boolean; linkClass?: string; }): string; export {}; //# sourceMappingURL=createToc.d.ts.map