import type { DOMOutputSpec, Mark as ProseMirrorMark, MarkSpec, Node as ProseMirrorNode, NodeSpec, NodeType } from './pm/model';
import type { Plugin, Transaction } from './pm/state';
export type Extension<Options = any, Storage = any> = {
    type: 'extension';
    name: string;
    parent: Extension | null;
    child: Extension | null;
    options: Options;
    storage: Storage;
    config: ExtensionConfig;
};
export type Node<Options = any, Storage = any> = {
    type: 'node';
    name: string;
    parent: Node | null;
    child: Node | null;
    options: Options;
    storage: Storage;
    config: NodeConfig;
};
export type Mark<Options = any, Storage = any> = {
    type: 'mark';
    name: string;
    parent: Mark | null;
    child: Mark | null;
    options: Options;
    storage: Storage;
    config: MarkConfig;
};
export type AnyExtension = Extension | Node | Mark;
export type Extensions = AnyExtension[];
export type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig;
export type ParentConfig<T> = Partial<{
    [P in keyof T]: T[P] extends (...args: infer A) => infer R ? (...args: A) => R : T[P];
}>;
export type KeyboardShortcutCommand = (props: {
    editor: any;
}) => boolean;
export type RawCommands = Record<string, (...args: any[]) => any>;
export type GlobalAttributes = Array<{
    types: string[];
    attributes: Record<string, any>;
}>;
export type Attributes = Record<string, {
    default?: any;
    rendered?: boolean;
    renderHTML?: ((attributes: Record<string, any>) => Record<string, any> | null) | null;
    parseHTML?: ((element: HTMLElement) => any | null) | null;
    keepOnSplit?: boolean;
    isRequired?: boolean;
}>;
export type NodeViewRenderer = (props: NodeViewRendererProps) => any;
export type NodeViewRendererProps = {
    editor: any;
    node: ProseMirrorNode;
    getPos: () => number | undefined;
    HTMLAttributes: Record<string, any>;
    decorations: any[];
    extension: Node;
};
export type ExtensionConfig<Options = any, Storage = any> = {
    [key: string]: any;
    name: string;
    priority?: number;
    defaultOptions?: Options;
    addOptions?: (this: {
        name: string;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addOptions'];
    }) => Options;
    addStorage?: (this: {
        name: string;
        options: Options;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addStorage'];
    }) => Storage;
    addGlobalAttributes?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        extensions: (Node | Mark)[];
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addGlobalAttributes'];
    }) => GlobalAttributes;
    addCommands?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addCommands'];
    }) => Partial<RawCommands>;
    addKeyboardShortcuts?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addKeyboardShortcuts'];
    }) => Record<string, KeyboardShortcutCommand>;
    addInputRules?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addInputRules'];
    }) => any[];
    addPasteRules?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addPasteRules'];
    }) => any[];
    addProseMirrorPlugins?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addProseMirrorPlugins'];
    }) => Plugin[];
    addExtensions?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['addExtensions'];
    }) => Extensions;
    extendNodeSchema?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendNodeSchema'];
    }, extension: Node) => Record<string, any>) | null;
    extendMarkSchema?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendMarkSchema'];
    }, extension: Mark) => Record<string, any>) | null;
    onBeforeCreate?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBeforeCreate'];
    }) => void) | null;
    onCreate?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onCreate'];
    }) => void) | null;
    onUpdate?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onUpdate'];
    }) => void) | null;
    onSelectionUpdate?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onSelectionUpdate'];
    }) => void) | null;
    onTransaction?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onTransaction'];
    }, props: {
        editor: any;
        transaction: Transaction;
    }) => void) | null;
    onFocus?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onFocus'];
    }, props: {
        event: FocusEvent;
    }) => void) | null;
    onBlur?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBlur'];
    }, props: {
        event: FocusEvent;
    }) => void) | null;
    onDestroy?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        parent: ParentConfig<ExtensionConfig<Options, Storage>>['onDestroy'];
    }) => void) | null;
};
export type NodeConfig<Options = any, Storage = any> = ExtensionConfig<Options, Storage> & {
    topNode?: boolean;
    content?: NodeSpec['content'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['content'];
        editor?: any;
    }) => NodeSpec['content']);
    marks?: NodeSpec['marks'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['marks'];
        editor?: any;
    }) => NodeSpec['marks']);
    group?: NodeSpec['group'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['group'];
        editor?: any;
    }) => NodeSpec['group']);
    inline?: NodeSpec['inline'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['inline'];
        editor?: any;
    }) => NodeSpec['inline']);
    atom?: NodeSpec['atom'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['atom'];
        editor?: any;
    }) => NodeSpec['atom']);
    selectable?: NodeSpec['selectable'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['selectable'];
        editor?: any;
    }) => NodeSpec['selectable']);
    draggable?: NodeSpec['draggable'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['draggable'];
        editor?: any;
    }) => NodeSpec['draggable']);
    code?: NodeSpec['code'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['code'];
        editor?: any;
    }) => NodeSpec['code']);
    whitespace?: NodeSpec['whitespace'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['whitespace'];
        editor?: any;
    }) => NodeSpec['whitespace']);
    defining?: NodeSpec['defining'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['defining'];
        editor?: any;
    }) => NodeSpec['defining']);
    isolating?: NodeSpec['isolating'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['isolating'];
        editor?: any;
    }) => NodeSpec['isolating']);
    parseHTML?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['parseHTML'];
        editor?: any;
    }) => NodeSpec['parseDOM'];
    renderHTML?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['renderHTML'];
        editor?: any;
    }, props: {
        node: ProseMirrorNode;
        HTMLAttributes: Record<string, any>;
    }) => DOMOutputSpec) | null;
    renderText?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['renderText'];
        editor?: any;
    }, props: {
        node: ProseMirrorNode;
        pos: number;
        parent: ProseMirrorNode;
        index: number;
    }) => string) | null;
    addAttributes?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
        editor?: any;
    }) => Attributes | Record<string, never>;
    addNodeView?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        editor: any;
        type: NodeType;
        parent: ParentConfig<NodeConfig<Options, Storage>>['addNodeView'];
    }) => NodeViewRenderer) | null;
};
export type MarkConfig<Options = any, Storage = any> = ExtensionConfig<Options, Storage> & {
    keepOnSplit?: boolean | (() => boolean);
    inclusive?: MarkSpec['inclusive'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['inclusive'];
        editor?: any;
    }) => MarkSpec['inclusive']);
    excludes?: MarkSpec['excludes'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['excludes'];
        editor?: any;
    }) => MarkSpec['excludes']);
    exitable?: boolean | (() => boolean);
    group?: MarkSpec['group'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['group'];
        editor?: any;
    }) => MarkSpec['group']);
    spanning?: MarkSpec['spanning'] | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['spanning'];
        editor?: any;
    }) => MarkSpec['spanning']);
    code?: boolean | ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['code'];
        editor?: any;
    }) => boolean);
    parseHTML?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['parseHTML'];
        editor?: any;
    }) => MarkSpec['parseDOM'];
    renderHTML?: ((this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['renderHTML'];
        editor?: any;
    }, props: {
        mark: ProseMirrorMark;
        HTMLAttributes: Record<string, any>;
    }) => DOMOutputSpec) | null;
    addAttributes?: (this: {
        name: string;
        options: Options;
        storage: Storage;
        parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
        editor?: any;
    }) => Attributes | Record<string, never>;
};
//# sourceMappingURL=extension-types.d.ts.map