diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:14:09 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:43:33 +0100 |
commit | bf94695abeda0d7bb296ae4cd0f9a53782587d4a (patch) | |
tree | 06dac432cfaa57dc6ad428b116332fdf777c84d8 /editor/state/storage.mli | |
parent | 4d35508a76676a548ac45e0bff2d63eafaf014e2 (diff) |
Update editor organisation
Diffstat (limited to 'editor/state/storage.mli')
-rwxr-xr-x | editor/state/storage.mli | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/editor/state/storage.mli b/editor/state/storage.mli new file mode 100755 index 0000000..5b7e0a0 --- /dev/null +++ b/editor/state/storage.mli @@ -0,0 +1,36 @@ +module Js = Js_of_ocaml.Js + +(** Provide a function for extracting the page id from the URL *) +val page_id + : unit -> Jstr.t option + +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 + : Jstr.t option -> content Js.t + +val save + : check:(content Js.t -> bool) -> content Js.t -> Jstr.t option -> (bool, Jv.Error.t) result + +(** Remove the page from the storage. *) +val delete + : (unit -> Jstr.t option) -> unit + +(** Collect all the keys to the existing pages *) +val get_ids + : unit -> Jstr.t list |