From 54f6e68c051afec0d20c349352feee5356e11b35 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 7 Feb 2022 15:49:48 +0100 Subject: Update editor code --- editor/state/state.mli | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'editor/state/state.mli') diff --git a/editor/state/state.mli b/editor/state/state.mli index 6984067..20d5288 100755 --- a/editor/state/state.mli +++ b/editor/state/state.mli @@ -11,6 +11,7 @@ type t = ; pm : Prosemirror.t } + val eq: t -> t -> bool (** Update the title element according to the page. *) @@ -26,3 +27,18 @@ val load_page (** Initialise a new state *) val init : Prosemirror.t -> Prosemirror.View.editor_view Js.t -> float -> Jstr.t option -> t + +type state = t +module type Event = sig + + type t + + val update: t -> state -> state + +end + +type event = E : 'a * (module Event with type t = 'a) -> event + +(** Simple helper for the main event loop *) +val run + : ?eq:(t -> t -> bool) -> t -> event Note.E.t -> state Note.S.t -- cgit v1.2.3