import { Cheerio, CheerioAPI } from 'cheerio/slim'; import { IPureNode } from 'markmap-common'; export declare enum Levels { None = 0, H1 = 1, H2 = 2, H3 = 3, H4 = 4, H5 = 5, H6 = 6, Block = 7, List = 8, ListItem = 9 } export interface IHtmlNode { id: number; tag: string; html: string; level: Levels; parent: number; childrenLevel: Levels; children?: IHtmlNode[]; comments?: string[]; data?: Record; } export interface IHtmlParserContext { $node: Cheerio; $: CheerioAPI; getContent($node: Cheerio, preserveTag?: boolean): { html?: string; comments?: string[]; }; } export interface IHtmlParserResult { html?: string | null; comments?: string[]; queue?: Cheerio; nesting?: boolean; } export type IHtmlParserSelectorRules = Record IHtmlParserResult>; export interface IHtmlParserOptions { selector: string; selectorRules: IHtmlParserSelectorRules; } export declare const defaultOptions: IHtmlParserOptions; export declare function parseHtml(html: string, opts?: Partial): IHtmlNode; export declare function convertNode(htmlRoot: IHtmlNode): IPureNode; export declare function buildTree(html: string, opts?: Partial): IPureNode;