import type { Mark, Node } from "prosemirror-model";
import type { MarkdownSerializerDynamicModifier } from "./MarkdownSerializerDynamicModifier.js";
export interface SerializerNodeToken {
    (state: MarkdownSerializerState, node: Node, parent: Node, index: number): void;
}
export interface SerializerMarkToken {
    open: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
    close: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
    mixable?: boolean;
    expelEnclosingWhitespace?: boolean;
    escape?: boolean;
}
interface SerializerOptions {
    tightLists?: boolean;
    escapeExtraCharacters?: RegExp;
    hardBreakNodeName?: string;
    strict?: boolean;
    commonEscape?: RegExp;
    startOfLineEscape?: RegExp;
    escape?: boolean;
}
interface MarkMap {
    [markName: string]: SerializerMarkToken;
}
interface NodeMap {
    [nodeName: string]: SerializerNodeToken;
}
export declare class MarkdownSerializer {
    private readonly nodes;
    private readonly marks;
    private readonly dynamicModifier?;
    constructor(nodes: NodeMap, marks: MarkMap, dynamicModifier?: MarkdownSerializerDynamicModifier);
    serialize(content: Node, options?: Partial<SerializerOptions>): string;
    containsNode(nodeName: string): boolean;
    containsMark(markName: string): boolean;
}
export declare class MarkdownSerializerState {
    out: string;
    inTightList: boolean;
    noAutoBlank: boolean;
    isAutolink: boolean | undefined;
    escapeWhitespace: boolean;
    escapeCharacters?: string[];
    private readonly nodes;
    private readonly marks;
    private readonly options;
    private delim;
    private closed;
    private readonly dynamicModifier?;
    constructor(nodes: NodeMap, marks: MarkMap, options?: Partial<SerializerOptions>, dynamicModifier?: MarkdownSerializerDynamicModifier);
    setNoAutoBlank(): void;
    unsetNoAutoBlank(): void;
    flushClose(size?: number | null): void;
    wrapBlock(delim: string, firstDelim: string | null, node: Node, f: () => void): void;
    atBlank(): boolean;
    ensureNewLine(): void;
    write(content?: string | null): void;
    closeBlock(node?: Node): void;
    text(text: string, escape?: boolean): void;
    render(node: Node, parent: Node, index: number): void;
    renderContent(parent: Node): void;
    renderInline(parent: Node): void;
    renderList(node: Node, delim: string, firstDelim: (index: number, firstDelimNode: Node) => string): void;
    esc(str: string, startOfLine?: boolean): string;
    escWhitespace(str: string): string;
    repeat(str: string, n: number): string;
    markString(mark: Mark, open: boolean, parent: Node, index: number): string;
    getEnclosingWhitespace(text: string): {
        leading: string | undefined;
        trailing: string | undefined;
    };
}
export {};
