package ezjs_push

  1. Overview
  2. Docs
class type 'a promise = object ... end
class type notification_action = object ... end
class type notification_options = object ... end
class type subscription_options = object ... end
class type notification = object ... end
class type notificationEvent = object ... end
class type pushSubscription = object ... end
class type pushManager = object ... end
class type serviceWorkerRegistration = object ... end
class type serviceWorkerContainer = object ... end
class type navigator = object ... end
class type pushMessageData = object ... end
val navigator : navigator Js_of_ocaml.Js.t
val notification : notification Js_of_ocaml.Js.t
type notification_action_ml = {
  1. na_action : string option;
  2. na_title : string option;
  3. na_icon : string option;
}
type data = string
type notifictaion_options_ml = {
  1. no_actions : notification_action_ml list option;
  2. no_body : string option;
  3. no_icon : string option;
  4. no_tag : string option;
  5. no_vibrate : int list option;
  6. no_require_interaction : bool option;
  7. no_data : data option;
}
type subscrition_options_ml = {
  1. so_user_visible_only : bool option;
  2. so_application_server_key : string option;
}
val jthen : < _then : 't0 -> 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> 't00 -> 'res0
val then1 : < _then : 'a -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> 'c -> unit
val then0 : < _then : ('a -> unit) -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
val catch : < catch : 't2 -> 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> 't20 -> 'res0
val catch1 : < catch : 'a -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> 'c -> unit
val unopt : 'a -> ('b -> 'c) -> 'd option -> 'e
val request_permission : (string Js_of_ocaml.Js.t -> unit) -> unit
val permission : unit -> string
val service_worker : unit -> serviceWorkerContainer Js_of_ocaml.Js.t
val register_worker : string -> (serviceWorkerRegistration Js_of_ocaml.Js.t -> unit) -> unit
val get_registration : ?none:(unit -> unit) -> (serviceWorkerRegistration Js_of_ocaml.Js.t -> unit) -> unit
val registration : string -> (serviceWorkerRegistration Js_of_ocaml.Js.t -> unit) -> unit
val update_service_worker : < update : 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
val unregister_service_worker : < unregister : 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
val push_manager : < pushManager : < get : 'res.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> 'res0
val urlBase64ToUint8Array : string -> Js_of_ocaml.Typed_array.uint8Array Js_of_ocaml.Js.t
val subscribe : ?options:subscrition_options_ml -> < pushManager : < get : < subscribe : subscription_options Js_of_ocaml.Js.t -> < _then : 'a -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> 'c -> unit
val get_subscription : ?none:(unit -> unit) -> < pushManager : < get : < getSubscription : < _then : ('a Js_of_ocaml.Js.Opt.t -> unit) -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> ('a -> unit) -> unit
val subscription : ?options:subscrition_options_ml -> < pushManager : < get : < getSubscription : < _then : ('a Js_of_ocaml.Js.Opt.t -> unit) -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t Js_of_ocaml.Js.meth ; subscribe : subscription_options Js_of_ocaml.Js.t -> < _then : ('a -> unit) -> 'c Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> ('a -> unit) -> unit
val show_notification : ?options:notifictaion_options_ml -> string -> < showNotification : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> notification_options Js_of_ocaml.Js.t -> < _then : ('a -> unit) -> 'b Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit