import type { Token, TagCollectionType } from './types';
export declare function escapeHtml(source: string): string;
/**
* A configurable markdown <=> HTML converter.
*
* Examples:
*
* const hopdown = new HopDown();
*
* const html = hopdown.toHTML('**bold**');
* html === '
bold
';
*
* const markdown = hopdown.toMarkdown(html);
* markdown === '**bold**';
*
* const node = hopdown.toEditorNode('**bold**');
* (node as HTMLElement).outerHTML === (
* "" +
* "**" +
* "bold" +
* "" +
* "
"
* );
*/
export declare class HopDown {
tags: TagCollectionType;
private tokenizer;
constructor(tags?: TagCollectionType | null);
/**
* Convert a markdown string to tokens.
*/
tokenize(source: string): Token[];
/**
* Convert an HTML string or a DocumentFragment to markdown.
*/
toMarkdown: (html: string | DocumentFragment) => string;
/**
* Convert a markdown string to a DocumentFragment consisting of wysiwyg editor nodes.
*/
toEditorNode: (markdown: string) => DocumentFragment;
toHTML: (markdown: string) => string;
/**
* Recursive entrypoint for converting markdown to html.
*/
inlineToHTML: (markdown: string) => string;
/**
* Recursive entrypoint for converting markdown to editor nodes.
*/
private inlineToEditorNodes;
/**
* Convert an HTML node to a markdown string. Used by toMarkdown().
*/
private nodeToMarkdown;
/**
* Convert a token stream to editor nodes.
*/
private tokensToEditorNodes;
/**
* Convert a token stream to HTML. Matches open/close delimiter
* pairs and wraps their content in the appropriate HTML tags.
* Unmatched delimiters are emitted as literal text.
*/
private tokensToHTML;
/**
* Match open/close delimiter pairs in a token stream. Unmatched
* openers/closers are converted to text tokens so they render
* as literal characters.
*/
private pairDelimiters;
}