import { IMarkdownParser } from '@jupyterlab/rendermime'; import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; import { TableOfContents } from '../tokens'; /** * Markdown heading */ export interface IMarkdownHeading extends TableOfContents.IHeading { /** * Heading line */ line: number; /** * Raw string containing the heading */ raw: string; } /** * Build the heading html id. * * @param raw Raw markdown heading * @param level Heading level * @param sanitizer HTML sanitizer */ export declare function getHeadingId(markdownParser: IMarkdownParser, raw: string, level: number, sanitizer?: IRenderMime.ISanitizer): Promise; /** * Parses the provided string and returns a list of headings. * * @param text - Markdown text * @param parser - A Markdown parser instance used to render the content to HTML. * @returns List of headings * * @remarks * Renders Markdown to HTML and extracts `

`–`

` elements. * Returns an empty list if the parser is `null`. */ export declare function parseHeadings(markdownText: string, parser: IMarkdownParser | null): Promise; /** * @deprecated in favour of async parseHeadings() * * Parses the provided string and returns a list of headings. * * @param text - Input text * @returns List of headings * */ export declare function getHeadings(text: string): IMarkdownHeading[]; /** * Returns whether a MIME type corresponds to a Markdown flavor. * * @param mime - MIME type string * @returns boolean indicating whether a provided MIME type corresponds to a Markdown flavor * * @example * const bool = isMarkdown('text/markdown'); * // returns true * * @example * const bool = isMarkdown('text/plain'); * // returns false */ export declare function isMarkdown(mime: string): boolean;