add type to this context in extensions
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { MarkType, NodeType } from 'prosemirror-model'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { Editor } from './Editor'
|
||||
import { GlobalAttributes } from './types'
|
||||
@@ -16,11 +17,9 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
/**
|
||||
* Global attributes
|
||||
*/
|
||||
addGlobalAttributes?: (
|
||||
this: {
|
||||
options: Options,
|
||||
},
|
||||
) => GlobalAttributes,
|
||||
addGlobalAttributes?: (this: {
|
||||
options: Options,
|
||||
}) => GlobalAttributes,
|
||||
|
||||
/**
|
||||
* Commands
|
||||
@@ -28,6 +27,7 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
addCommands?: (this: {
|
||||
options: Options,
|
||||
editor: Editor,
|
||||
type: NodeType | MarkType,
|
||||
}) => Commands,
|
||||
|
||||
/**
|
||||
@@ -36,6 +36,7 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
addKeyboardShortcuts?: (this: {
|
||||
options: Options,
|
||||
editor: Editor,
|
||||
type: NodeType | MarkType,
|
||||
}) => {
|
||||
[key: string]: any
|
||||
},
|
||||
@@ -46,6 +47,7 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
addInputRules?: (this: {
|
||||
options: Options,
|
||||
editor: Editor,
|
||||
// type: NodeType | MarkType,
|
||||
}) => any[],
|
||||
|
||||
/**
|
||||
@@ -54,6 +56,7 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
addPasteRules?: (this: {
|
||||
options: Options,
|
||||
editor: Editor,
|
||||
type: NodeType | MarkType,
|
||||
}) => any[],
|
||||
|
||||
/**
|
||||
@@ -62,6 +65,7 @@ export interface ExtensionSpec<Options = {}, Commands = {}> {
|
||||
addProseMirrorPlugins?: (this: {
|
||||
options: Options,
|
||||
editor: Editor,
|
||||
type: NodeType | MarkType,
|
||||
}) => Plugin[],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user