Created
April 2, 2020 11:46
-
-
Save grindpride/ce8a7b7d94f8c8d797262dc278607682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'tiptap-commands' { | |
import { EditorView } from "prosemirror-view"; | |
import { Transaction, EditorState, Plugin } from "prosemirror-state"; | |
import { InputRule } from "prosemirror-inputrules"; | |
import { NodeType, MarkType } from "prosemirror-model"; | |
export interface DispatchFn { | |
(tr: Transaction): boolean | |
} | |
export interface Command { | |
(...params: any[]): CommandFunction; | |
} | |
export interface CommandFunction { | |
(state: EditorState, dispatch: DispatchFn | undefined, view: EditorView): boolean; | |
} | |
export function toggleWrap(type: NodeType): Command | |
export function wrappingInputRule( | |
regexp: RegExp, | |
nodeType: NodeType, | |
getAttrs?: (arg: {} | string[]) => object | undefined, | |
joinPredicate?: (strs: string[], node: Node) => boolean | |
): InputRule | |
export function toggleMark(type: MarkType, attrs?: { [key: string]: any }): Command | |
export function pasteRule(regexp: RegExp, type: string, getAttrs: (() => { [key: string]: any }) | { [key: string]: any }): Plugin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment