import { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; import { Types } from '../../libs'; import { IMatcherConfig, TextMatcherHandler } from '../../schema/matchers'; declare type TextShortCutHandler = (view: EditorView, state: EditorState, match: RegExpExecArray, start: number, end: number, insertText: string) => Transaction | null | undefined; declare const SHORTCUT_KEY: PluginKey; declare class TextShortcut implements IMatcherConfig { readonly name: string; readonly matcher: RegExp; readonly handler: TextShortCutHandler; readonly config: IMatcherConfig; constructor(name: string, matcher: TextShortcut['matcher'], handler: TextShortcut['handler'] | string, config: TextShortcut['config']); } interface ITextShortcutPlugin extends Plugin { getStatus: () => boolean; } declare const createTextShortcutPlugin: (_textShortcuts: TextShortcut[], _enable?: boolean) => ITextShortcutPlugin; declare const undoTextShortcut: (state: EditorState, dispatch?: ((transaction: Transaction) => void) | undefined) => boolean; declare const getShortcutAttrs: (getAttrs: TextMatcherHandler | Types.StringMap | undefined, view: EditorView, match: RegExpExecArray, start: number, end: number) => false | Types.StringMap | null | undefined; export { createTextShortcutPlugin, getShortcutAttrs, ITextShortcutPlugin, SHORTCUT_KEY, TextShortcut, TextShortCutHandler, undoTextShortcut, };