aboutsummaryrefslogtreecommitdiff
path: root/editor/storage.mli
blob: 5424119edbdced275dfbd896bf4244b59e5142cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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