package brr

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

Module Brr.GSource

The global object, its global objects and functions.

If you are:

Global objects

Depending on the JavaScript environment theses values can be undefined. You should know what you are doing or use Jv.defined to test the values.

Because of type dependencies some global objects are defined in their dedicated modules:

Sourceval console : Console.t

console is the global console object (if available). This is what Console.get returns initially.

Sourceval document : Document.t

document is the global document object (if available).

Sourceval navigator : Navigator.t

navigator is the global navigator object (if available).

Sourceval performance : Performance.t

performance is the global performance object (if available).

Sourceval window : Window.t

window is the global window object (if available).

Global event target and messaging

Sourceval target : Ev.target

target is globalThis as an event target.

Global properties

Sourceval is_secure_context : bool

is_secure_context is true iff the current context is secure.

Timers

Sourcetype timer_id = int

The type for timeout identifiers.

Sourceval set_timeout : ms:int -> (unit -> unit) -> timer_id

set_timeout ~ms f is a timer calling f in ms milliseconds unless stopped before.

Sourceval set_interval : ms:int -> (unit -> unit) -> timer_id

set_interval ~ms f is a timer calling f every ms milliseconds until it is stopped.

Sourceval stop_timer : timer_id -> unit

stop_timer tid stops timer tid.

Animation timing

Sourcetype animation_frame_id = int

The type for animation frame identifiers.

Sourceval request_animation_frame : (float -> unit) -> animation_frame_id

request_animation_frame f request f now to be called before the next repaint. With now indicating the point in time in ms when the function is called.

Sourceval cancel_animation_frame : animation_frame_id -> unit

cancel_animation_frame fid cancels the animation frame request a.

OCaml

Innovation. Community. Security.