package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Bonsai_test.Handle end
type ('result, 'incoming) t
val show : (_, _) t -> unit

show prints out the result of the component as specified by the Result_spec that was passed into Handle.create.

val show_diff : ?location_style:Patdiff_kernel.Format.Location_style.t -> ?diff_context:int -> (_, _) t -> unit

show_diff will print the diff of the view between now and the last time that show or show_diff was called.

diff_context can be used to adjust the number of unchanged lines before and after the diffed content. Defaults to 16

val recompute_view : (_, _) t -> unit

recompute_view is like show, but it doesn't print anything. Calling recompute_view between invocations of show_diff does not affect the diff the gets shown.

val recompute_view_until_stable : ?max_computes:int -> (_, _) t -> unit

This function calls recompute_view until either max_computes is reached (defaults to 100), or there are no more after-display lifecycle events for processing.

This can be useful when using e.g. Bonsai.Edge.on_change, which might otherwise delay their effects until the next frame.

val store_view : (_, _) t -> unit

store_view is like show except that instead of printing the view to stdout, it only stores the current view for use with show_diff. This can be useful if you want to print the diff of "before->after" without being required to print the entirety of "before".

val flush : (_, _) t -> unit

Flushes all the events in the event queue. This can be useful if e.g. you are completing an Effect synchronously via Svar, and don't want to go through the other functions which flush (like show)

val result : ('result, _) t -> 'result
val do_actions : (_, 'incoming) t -> 'incoming list -> unit
val clock : (_, _) t -> Ui_incr.Clock.t
val advance_clock_by : (_, _) t -> Core.Time_ns.Span.t -> unit
val advance_clock : to_:Core.Time_ns.t -> (_, _) t -> unit
val show_model : (_, _) t -> unit
  • alert rampantly_nondeterministic This function exposes Bonsai internals that may change without warning
val result_incr : ('r, 'i) t -> 'r Ui_incr.t
val lifecycle_incr : (_, _) t -> Ui_incr.Packed.t
val action_input_incr : (_, _) t -> Ui_incr.Packed.t
val create : (module Bonsai_web_test__.Proc.Result_spec.S with type incoming = 'b and type t = 'a) -> ?rpc_implementations: Async_rpc_kernel.Rpc.Connection.t Async_rpc_kernel.Rpc.Implementation.t list -> ?connectors: (Bonsai_web.Rpc_effect.Where_to_connect.t -> Bonsai_web.Rpc_effect.Connector.t) -> ?start_time:Core.Time_ns.t -> ?optimize:bool -> 'a Bonsai_web.Computation.t -> ('a, 'b) t
val click_on : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ?shift_key_down:bool -> ?alt_key_down:bool -> ?ctrl_key_down:bool -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val submit_form : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val set_checkbox : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ?shift_key_down:bool -> ?alt_key_down:bool -> ?ctrl_key_down:bool -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> checked:bool -> unit
val input_text : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> text:string -> unit
val keydown : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ?shift_key_down:bool -> ?alt_key_down:bool -> ?ctrl_key_down:bool -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> key:Js_of_ocaml.Dom_html.Keyboard_code.t -> unit
val change : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> value:string -> unit
val focus : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val blur : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ?related_target:string -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val mousemove : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val mouseenter : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> unit
val wheel : ?extra_event_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> delta_y:float -> unit
val trigger_hook : ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> name:string -> ('c -> unit Bonsai_web.Vdom.Effect.t) Core.Type_equal.Id.t -> 'c -> unit
val trigger_hook_via : ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> name:string -> 't Core.Type_equal.Id.t -> f:('t -> 'c -> unit Bonsai_web.Vdom.Effect.t) -> 'c -> unit
val get_hook_value : ('a, 'b) t -> get_vdom:('a -> Bonsai_web.Vdom.Node.t) -> selector:string -> name:string -> 'c Core.Type_equal.Id.t -> 'c
module Bulk_size_tracker : sig ... end
module Position_tracker : sig ... end
module Drag_and_drop : sig ... end
OCaml

Innovation. Community. Security.