summaryrefslogtreecommitdiff
path: root/editor/storage.mli
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2022-02-07 16:03:16 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 16:43:33 +0100
commit7c23b96ce5634550341b9554eda9d7c89a79e3c0 (patch)
treeda92baed0962717a882aa31e269243fba66ce0b3 /editor/storage.mli
parent896bfb14fa05cf07bb57216fdccd678e027bc4f9 (diff)
Update editor
Diffstat (limited to 'editor/storage.mli')
-rwxr-xr-xeditor/storage.mli25
1 files changed, 25 insertions, 0 deletions
diff --git a/editor/storage.mli b/editor/storage.mli
new file mode 100755
index 0000000..5424119
--- /dev/null
+++ b/editor/storage.mli
@@ -0,0 +1,25 @@
+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].
+
+ 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
+
+val save
+ : PM.View.editor_view Js.t -> (unit -> Jstr.t option) -> unit
+
+(** Remove the page from the storage and reload the page *)
+val delete
+ : (unit -> Jstr.t option) -> unit
+
+(** Collect all the keys to the existing pages *)
+val get_ids
+ : unit -> Jstr.t list