Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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 to dispatch
  • 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]