From 274789e733c46e7e20fc1dc918a7251b0206b3d2 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 15 Feb 2021 23:03:21 +0100 Subject: Working key handler --- editor/prosemirror/prosemirror.mli | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'editor/prosemirror/prosemirror.mli') diff --git a/editor/prosemirror/prosemirror.mli b/editor/prosemirror/prosemirror.mli index a4c5d35..7a723d3 100755 --- a/editor/prosemirror/prosemirror.mli +++ b/editor/prosemirror/prosemirror.mli @@ -100,6 +100,10 @@ and State : sig val create_text_selection : t -> Model.node Js.t -> int -> text_selection Js.t + type dispatch = (transaction Js.t -> unit) + + type command = editor_state Js.t -> dispatch Js.opt -> bool Js.t + end (* Editor view *) @@ -146,23 +150,26 @@ module History : sig : t -> history_prop Js.t -> State.plugin Js.t val undo - : t -> State.editor_state Js.t -> (State.transaction -> unit) -> bool + : t -> State.command val redo - : t -> State.editor_state Js.t -> (State.transaction -> unit) -> bool + : t -> State.command end module Keymap : sig val keymap - : t -> (string * (State.editor_state Js.t -> (State.transaction Js.t -> unit) -> bool)) array -> State.plugin Js.t + : t -> (string * State.command) array -> State.plugin Js.t end module Commands : sig val baseKeymap - : t -> (string * (State.editor_state Js.t -> (State.transaction -> unit) -> bool)) array + : t -> (string * State.command) array + + val set_block_type + : t -> Model.node_type Js.t -> < .. > Js.t -> State.command end -- cgit v1.2.3