import { InjectionKey, Ref, ShallowRef } from 'vue'; import { VueTemplateRefElement } from '../../composables/useResizeObserver.js'; export declare const TOC_CONTEXT_INJECTION_KEY: InjectionKey<{ /** * Set of currently visible hashes inside the page content (e.g. headlines). */ visibleHashes: Set; /** * Hashes of items actually used inside the TOC. * Used to "ignore" any irrelevant hashes that are not part of the TOC. */ tocItems: Set; }>; export type UseTocVisibilityOptions = { /** * Hash (without leading #). * * @example * "section-1"; */ hash: Ref; /** * Template ref to the component (e.g. headline). */ templateRef: Readonly>; }; /** * Composable that should be added to components (usually the OnyxHeadline) that should report its * visibility to the OnyxTableOfContents so the corresponding TOC item is automatically marked * active if the component (inside of the page content) becomes visible. * * @example * ```ts * const headline = useTemplateRef("headline"); * useTocVisibility({ hash: "section-1", templateRef: headline }); * ```; */ export declare const useTocVisibility: (options: UseTocVisibilityOptions) => void; export type UseTocContextOptions = { /** * Link / hash of the TOC item. * * @example * "#section-1"; */ href: Ref; }; /** * Composable for accessing the table of contents context (usually done by OnyxTableOfContentsItem) * to check whether the related component (usually OnyxHeadline) for this TOC item inside the page * content is currently visible to support auto active highlighting for the TOC item. * * @example * ```ts * const { isVisible } = useTocContext({ href: "#section-1" }); * // highlight TOC item as active when "isVisible" is true... * ```; */ export declare const useTocContext: (options: UseTocContextOptions) => { isVisible: import('vue').ComputedRef; };