Command
Commands are functions that take a state and a an optional transaction dispatch function and...
- determine whether they apply to this state
- if not, return false
- if
dispatch
was passed, perform their effect, possibly by passing a transaction todispatch
- return true
In some cases, the editor view is passed as a third argument.
type Command = (
state: EditorState,
dispatch?: (tr: Transaction) => void,
view?: EditorView,
) => boolean;§Type
§
(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView) => boolean
[src]