aboutsummaryrefslogtreecommitdiff
path: root/editor/quill.mli
blob: 7405102fa3a2a915f4dd99a342c1dbafe379a845 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
open Brr

(** Constructor options *)
type options

val options
  : unit -> options

val bounds
  : (options, El.t) J.prop

val debug
  : (options, Jstr.t) J.prop

val placeholder
  : (options, Jstr.t) J.prop

val readonly
  : (options, Jstr.t) J.prop

val theme
  : (options, Jstr.t) J.prop

val scrollingContainer
  : (options, El.t) J.prop

type delta 

val delta_to_json
  : delta -> Json.t

val delta_of_json
  : Json.t -> delta

type operations 

val ops
  : (delta, operations) J.prop

type t 

(** Constructor.

    [quill element] will create the editor inside the given element

*)
val quill
  : ?options:options -> El.t -> (t, Jv.Error.t) Result.t


(** Return the editor content *)
val get_contents
  : t -> delta

val set_contents
  : t -> delta -> unit

(** [extract_content t index length] return the content starting from index,
    with length elements *)
val extract_contents
  : t -> int -> int -> delta

val on_text_change
  : t -> (string -> string -> string -> unit) -> unit

(* [update_contents t delta] replace the content with the commands given
   by delta.
*)
val update_contents
  : t -> delta -> delta