import React from 'react'; import type { Section, ContentSection } from '../../file-system/index.tsx'; /** A section for the table of contents (either Section or ContentSection). */ export type TableOfContentsSection = Section | ContentSection; export interface TableOfContentsComponents { /** Root navigation element. */ Root: React.ComponentType<{ children?: React.ReactNode; 'aria-labelledby'?: string; }>; /** Title heading. */ Title: React.ComponentType<{ id?: string; children?: React.ReactNode; }>; /** Ordered list of items. */ List: React.ComponentType<{ depth: number; children?: React.ReactNode; }>; /** Individual list item. */ Item: React.ComponentType<{ children?: React.ReactNode; }>; /** Anchor link to a heading. */ Link: React.ComponentType<{ children?: React.ReactNode; href: string; suppressHydrationWarning?: boolean; 'aria-current'?: React.AriaAttributes['aria-current']; }>; } export interface TableOfContentsProps { /** The sections to display within the table of contents. */ sections: TableOfContentsSection[]; /** Override the default component renderers. */ components?: Partial; /** Optional content rendered after the section links. */ children?: React.ReactNode; } /** A table of contents that displays links to the sections in the current document. */ export declare function TableOfContents({ sections, components, children, }: TableOfContentsProps): React.JSX.Element | null;