Source

xJs / lib / google.mli

Full commit
(* Implements a very small subset of Google API *)

open Js
open Base

class type t = object
  method load : string_t (* name *) -> string_t (* version *) -> 'option Js.t (* option *) -> unit meth
  method setOnLoadCallback : (unit -> unit) (* ? *) -> unit meth
end

val get_google : unit -> t Js.t
(** Get the variable "google" *)

val load_ajax_api : string_t -> string_t -> 'option Js.t -> unit
(** Load a specific Google API.
    The Loader API must be loaded beforehand by
    <script type="text/javascript" src="https://www.google.com/jsapi"/>
*)

val setOnLoadCallback : (unit -> unit) -> unit
(* Each API, such as Google Maps and Google Chart are provided
   in each module like GMaps or GChart. *)