diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:09:50 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:43:33 +0100 |
commit | 37485464a4da41462fc285d03229221f44860397 (patch) | |
tree | 38e9969c62e865ba7d9e258eb8c5d22172496ded /editor/storage.mli | |
parent | 7c23b96ce5634550341b9554eda9d7c89a79e3c0 (diff) |
Changed the application structure in the editor
Diffstat (limited to 'editor/storage.mli')
-rwxr-xr-x | editor/storage.mli | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/editor/storage.mli b/editor/storage.mli index 5424119..7ae77a6 100755 --- a/editor/storage.mli +++ b/editor/storage.mli @@ -1,20 +1,31 @@ -module PM = Prosemirror module Js = Js_of_ocaml.Js (** Provide a function for extracting the page id from the URL *) val page_id : unit -> Jstr.t option -(** load pm schema content f] will load the content and store it into the - element [content]. +class type content = object + + method title + : Jstr.t Js.opt Js.readonly_prop + + method content + : Jv.t Js.opt Js.readonly_prop + + method date + : float Js.opt Js.readonly_prop + +end + +(** load f] will try to load the content associated with the given key. The function [f] is called to identified which is the appropriate page id. *) val load - : PM.t -> PM.Model.schema Js.t -> Brr.El.t -> (unit -> Jstr.t option) -> PM.State.editor_state Js.t + : (unit -> Jstr.t option) -> content Js.t val save - : PM.View.editor_view Js.t -> (unit -> Jstr.t option) -> unit + : check:(content Js.t -> bool) -> content Js.t -> (unit -> Jstr.t option) -> (bool, Jv.Error.t) result (** Remove the page from the storage and reload the page *) val delete |