import type { Fragment, Node as ProsemirrorNode, NodeType, Schema } from 'prosemirror-model';
import { Mark } from 'prosemirror-model';
import type { GenericNode } from 'mystjs';
import type { Root } from '../../spec';
import type { UseSchema } from '../../schemas';
import { markNames, nodeNames } from '../../types';
declare type Attrs = Record<string, any>;
declare type ProtoNode = {
    type: NodeType;
    attrs: Attrs;
    content: (ProtoNode | ProsemirrorNode)[];
};
export declare enum ignoreNames {
    directive = "directive",
    role = "role"
}
/** MarkdownParseState tracks the context of a running token stream.
 *
 * Loosly based on prosemirror-markdown
 */
export declare class MarkdownParseState {
    schema: Schema;
    marks: Mark[];
    stack: ProtoNode[];
    handlers: Record<string, TokenHandler>;
    constructor(schema: Schema, handlers: Record<string, TokenHandler>);
    top(): ProtoNode;
    addNode(type: NodeType, attrs: Attrs, content: ProsemirrorNode | Fragment | ProsemirrorNode[] | undefined): ProsemirrorNode | null;
    addText(text?: string): void;
    openMark(mark: Mark): void;
    closeMark(mark: Mark): void;
    openNode(type: NodeType, attrs: Record<string, any>): void;
    closeNode(): ProsemirrorNode | null | undefined;
    parseTokens(tokens?: GenericNode[] | null): void;
}
declare type TokenHandler = (token: GenericNode, tokens: GenericNode[]) => {
    name: nodeNames | markNames | ignoreNames;
    children?: GenericNode[] | string;
};
export declare function fromMdast(tree: Root, useSchema: UseSchema): ProsemirrorNode;
export {};
