import { Node } from '@tiptap/core';
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model';
import { PluginKey } from '@tiptap/pm/state';
import { SuggestionOptions } from '@tiptap/suggestion';

export interface MentionNodeAttrs {
    /**
     * The identifier for the selected item that was mentioned, stored as a `data-value`
     * attribute.
     */
    id: string | null;
    /**
     * The label to be rendered by the editor as the displayed text for this mentioned
     * item, if provided. Stored as a `data-label` attribute. See `renderLabel`.
     */
    label?: string | null;
    /**
     * The title to be rendered by the editor as the type data for this mentioned
     * item, if provided. Stored as a `data-type` attribute. See `renderLabel`.
     */
    type?: string | null;
}
export type MentionOptions<SuggestionItem = any, Attrs extends Record<string, any> = MentionNodeAttrs> = {
    /**
     * The HTML attributes for a mention node.
     * @default {}
     * @example { class: 'foo' }
     */
    HTMLAttributes: Record<string, any>;
    /**
     * Whether to delete the trigger character with backspace.
     * @default false
     */
    deleteTriggerWithBackspace: boolean;
    /**
     * A function to render the HTML of a mention.
     * @param props The render props
     * @returns The HTML as a ProseMirror DOM Output Spec
     * @example ({ options, node }) => ['span', { 'data-type': 'mention' }, `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`]
     */
    renderHTML: (props: {
        node: ProseMirrorNode;
        options: MentionOptions<SuggestionItem, Attrs>;
    }) => DOMOutputSpec;
    /**
     * A function to render the label of a mention.
     * @deprecated use renderText and renderHTML instead
     * @param props The render props
     * @returns The label
     * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
     */
    renderLabel?: (props: {
        node: ProseMirrorNode;
        options: MentionOptions<SuggestionItem, Attrs>;
    }) => string;
    /**
     * A function to render the text of a mention.
     * @param props The render props
     * @returns The text
     * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
     */
    renderText: (props: {
        node: ProseMirrorNode;
        options: MentionOptions<SuggestionItem, Attrs>;
    }) => string;
    /**
     * The suggestion options.
     * @default {}
     * @example { char: '@', pluginKey: MentionPluginKey, command: ({ editor, range, props }) => { ... } }
     */
    suggestion: Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>;
};
/**
 * The plugin key for the mention plugin.
 * @default 'mention'
 */
export declare const MentionPluginKey: PluginKey<any>;
/**
 * This extension allows you to insert mentions into the editor.
 * @see https://www.tiptap.dev/api/extensions/mention
 */
export declare const Mention: Node<MentionOptions<any, MentionNodeAttrs>, any>;
