package bonsai

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file helpers_intf.ml

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
open! Core
open! Import


module type S = sig
  type input
  type action
  type extra

  val show : unit -> unit
  val show_model : unit -> unit
  val set_input : input -> unit
  val do_actions : action list -> unit
  val get_extra : unit -> extra
end

module type S_vdom = sig
  include S

  val click_on : selector:string -> unit
  val input_text : selector:string -> text:string -> unit
end

module type Helpers = sig
  module type S = S

  val make_generic
    :  driver:('input, 's) Driver.t
    -> string_of_result:('result -> string)
    -> get_result:('s -> 'result)
    -> get_extra:('s -> 'extra)
    -> schedule_action:('s -> 'action -> unit)
    -> (module S
         with type action = 'action
          and type input = 'input
          and type extra = 'extra)

  val make
    :  driver:('input, 'result) Driver.t
    -> sexp_of_result:('result -> Sexp.t)
    -> (module S
         with type input = 'input
          and type action = Nothing.t
          and type extra = unit)

  val make_with_inject
    :  driver:('input, 'result * ('action -> unit Vdom.Effect.t)) Driver.t
    -> sexp_of_result:('result -> Sexp.t)
    -> (module S with type input = 'input and type action = 'action and type extra = unit)

  val make_string
    :  driver:('input, string) Driver.t
    -> (module S
         with type input = 'input
          and type action = Nothing.t
          and type extra = unit)

  val make_string_with_inject
    :  driver:('input, string * ('action -> unit Vdom.Effect.t)) Driver.t
    -> (module S with type input = 'input and type action = 'action and type extra = unit)

  val make_vdom
    :  ?vdom_to_string:(Vdom.Node.t -> string)
    -> driver:('input, Vdom.Node.t) Driver.t
    -> (module S_vdom
         with type input = 'input
          and type action = Nothing.t
          and type extra = unit)

  val make_vdom_with_extra
    :  ?vdom_to_string:(Vdom.Node.t -> string)
    -> driver:('input, Vdom.Node.t * 'extra) Driver.t
    -> (module S_vdom
         with type input = 'input
          and type action = Nothing.t
          and type extra = 'extra)

  val make_vdom_with_inject
    :  ?vdom_to_string:(Vdom.Node.t -> string)
    -> driver:('input, Vdom.Node.t * ('action -> unit Vdom.Effect.t)) Driver.t
    -> (module S_vdom
         with type input = 'input
          and type action = 'action
          and type extra = unit)
end
OCaml

Innovation. Community. Security.