diff --git a/src/cordova_googleplus.mli b/src/cordova_googleplus.mli index 20fcb86..72b4a7f 100644 --- a/src/cordova_googleplus.mli +++ b/src/cordova_googleplus.mli @@ -1 +1,46 @@ -(*TODO*) +[@@@js.stop] + +val available : unit -> bool + +[@@@js.start] + +[@@@js.implem +let available () = + Js_of_ocaml.Js.Optdef.test Js_of_ocaml.Js.Unsafe.global##.plugins##.googleplus] + +module Login : sig + type parameters + + type user + + type error = Ojs.t + + val parameters : + ?web_client_id:string -> + ?offline:bool -> + ?id_token:string -> + ?server_auth_code:string -> + ?profile:string -> + ?email:string -> + ?scopes:Ojs.t list -> + unit -> + parameters + [@@js.builder] [@@js.verbatim_names] + + val login : + ?param:parameters -> + ?onInit:(user -> unit) -> + ?onError:(error -> unit) -> + unit -> + unit + [@@js.global "window.plugins.googleplus.login"] +end + +type loginResponse + +val loginResponse : Login.user -> loginResponse [@@js.call] + +val id_token : loginResponse -> string [@@js.get "id_token"] + +val logout : ?onInit:(Ojs.t -> unit) -> ?onError:(Ojs.t -> unit) -> unit -> unit + [@@js.global "window.plugins.googleplus.logout"]