/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { type HeadingTagType } from '@lexical/rich-text'; import { type LexicalEditor, type NodeKey } from 'lexical'; import { type JSX } from 'react'; /** * A single entry in the table of contents, as a tuple of the heading node's * {@link NodeKey}, its text content, and its heading tag (for example `'h1'`). */ export type TableOfContentsEntry = [ key: NodeKey, text: string, tag: HeadingTagType ]; type Props = { children: (values: TableOfContentsEntry[], editor: LexicalEditor) => JSX.Element; }; /** * Tracks every {@link HeadingNode} in the editor and keeps an ordered list of * {@link TableOfContentsEntry}s in sync as headings are added, removed, edited, * or moved. It is a render-prop component: `children` receives the current * entries and the editor and returns the element used to render the table of * contents. * * @returns The element returned by the `children` render prop. */ export declare function TableOfContentsPlugin({ children }: Props): JSX.Element; export {};