import { IMarkdownString } from "../common/htmlContent.js";
import * as marked from "../common/marked/marked.js";
import { URI } from "../common/uri.js";
import * as domSanitize from "./domSanitize.js";
export type MarkdownActionHandler = (linkContent: string, mdStr: IMarkdownString) => void;
/**
 * Options for the rendering of markdown with {@link renderMarkdown}.
 */
export interface MarkdownRenderOptions {
    readonly codeBlockRenderer?: (languageId: string, value: string) => Promise<HTMLElement>;
    readonly codeBlockRendererSync?: (languageId: string, value: string, raw?: string) => HTMLElement;
    readonly asyncRenderCallback?: () => void;
    readonly actionHandler?: MarkdownActionHandler;
    readonly fillInIncompleteTokens?: boolean;
    readonly sanitizerConfig?: MarkdownSanitizerConfig;
    readonly markedOptions?: MarkdownRendererMarkedOptions;
    readonly markedExtensions?: marked.MarkedExtension[];
}
/**
 * Subset of options passed to `Marked` for rendering markdown.
 */
export interface MarkdownRendererMarkedOptions {
    readonly gfm?: boolean;
    readonly breaks?: boolean;
}
export interface MarkdownSanitizerConfig {
    readonly replaceWithPlaintext?: boolean;
    readonly allowedTags?: {
        readonly override: readonly string[];
    };
    readonly allowedAttributes?: {
        readonly override: ReadonlyArray<string | domSanitize.SanitizeAttributeRule>;
    };
    readonly allowedLinkSchemes?: {
        readonly augment: readonly string[];
    };
    readonly remoteImageIsAllowed?: (uri: URI) => boolean;
}
/**
 * Low-level way create a html element from a markdown string.
 *
 * **Note** that for most cases you should be using {@link import('../../editor/browser/widget/markdownRenderer/browser/markdownRenderer.js').MarkdownRenderer MarkdownRenderer}
 * which comes with support for pretty code block rendering and which uses the default way of handling links.
 */
export declare function renderMarkdown(markdown: IMarkdownString, options?: MarkdownRenderOptions, target?: HTMLElement): {
    element: HTMLElement;
    dispose: () => void;
};
export declare const allowedMarkdownHtmlTags: readonly string[];
export declare const allowedMarkdownHtmlAttributes: readonly (string | domSanitize.SanitizeAttributeRule)[];
/**
 * Renders `str` as plaintext, stripping out Markdown syntax if it's a {@link IMarkdownString}.
 *
 * For example `# Header` would be output as `Header`.
 */
export declare function renderAsPlaintext(str: IMarkdownString | string, options?: {
    /** Controls if the ``` of code blocks should be preserved in the output or not */
    readonly includeCodeBlocksFences?: boolean;
}): string;
export declare function fillInIncompleteTokens(tokens: marked.TokensList): marked.TokensList;
