package ezjs_push

  1. Overview
  2. Docs
class type extendableEvent = object ... end

Notification API

class type notification_action = object ... end
class type notification_options = object ... end
class type notification_static = object ... end
class type notification_instance = object ... end
class type notificationEvent = object ... end

Push API

class type subscription_options = object ... end
class type pushSubscription = object ... end
class type pushManager = object ... end
class type pushMessageData = object ... end
class type pushEvent = object ... end

Service Worker API

class type serviceWorker = object ... end
class type navigationPreloadState = object ... end
class type navigationPreloadManager = object ... end
class type sync_register_options = object ... end
class type syncRegistration = object ... end
class type syncManager = object ... end
class type 'a contentIndex = object ... end
class type get_notification_options = object ... end
class type serviceWorkerRegistration = object ... end
class type registration_options = object ... end
class type serviceWorkerContainer = object ... end
class type navigator = object ... end
class type serviceWorkerGlobalScope = object ... end
val navigator : navigator Ezjs_min.t
val notification : notification_static Ezjs_min.t

OCaml Helpers

type notification_action_ml = {
  1. na_action : string option;
  2. na_title : string option;
  3. na_icon : string option;
}
val empty_action : notification_action_ml
type 'data notification_options_ml = {
  1. no_dir : string option;
  2. no_lang : string option;
  3. no_badge : string option;
  4. no_body : string option;
  5. no_tag : string option;
  6. no_icon : string option;
  7. no_image : string option;
  8. no_data : 'data option;
  9. no_vibrate : int list option;
  10. no_renotify : bool option;
  11. no_require_interaction : bool option;
  12. no_actions : notification_action_ml list option;
  13. no_silent : bool option;
  14. no_timestamp : string option;
}
val empty_notif : 'a notification_options_ml
type subscription_options_ml = {
  1. so_user_visible_only : bool option;
  2. so_application_server_key : string option;
}
val request_permission : (Ezjs_min.js_string Ezjs_min.t -> unit) -> unit
val permission : unit -> string
val service_worker : unit -> serviceWorkerContainer Ezjs_min.t
val register_worker : ?scope:string -> ?callback:(unit -> unit) -> string -> unit
val get_registration : ?none:(unit -> unit) -> ?scope:string -> (serviceWorkerRegistration Ezjs_min.t -> unit) -> unit
val registration : string -> (serviceWorkerRegistration Ezjs_min.t -> unit) -> unit
val update_worker : ?callback:('a -> unit) -> < update : 'a Ezjs_min.Promise.promise Js_of_ocaml.Js.t Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
val unregister_worker : < unregister : 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
val get_registrations : (serviceWorkerRegistration Ezjs_min.t list -> unit) -> unit
val unregister_all : unit -> unit
val push_manager : < pushManager : < get : 'res.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> 'res
val onactivate : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onpush : (pushEvent Ezjs_min.t -> unit) -> unit
val onfetch : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val oninstall : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onmessage : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onnotificationclick : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onnotificationclose : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onpushsubscriptionchange : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val onsync : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
val urlBase64ToUint8Array : string -> (int, Stdlib.Bigarray.int8_unsigned_elt) Js_of_ocaml__Typed_array.typedArray Js_of_ocaml.Js.t
val make_subscription_options : subscription_options_ml -> subscription_options Ezjs_min.t
val subscribe : ?verbose:bool -> ?options:subscription_options_ml -> < pushManager : < get : < subscribe : subscription_options Ezjs_min.t Ezjs_min.optdef -> 'a Ezjs_min.Promise.promise 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 get_subscription : ?none:(unit -> unit) -> < pushManager : < get : < getSubscription : 'a Ezjs_min.Opt.t Ezjs_min.Promise.promise 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 make_notification_action : notification_action_ml -> notification_action Ezjs_min.t
val make_notification_options : 'a notification_options_ml -> notification_options Ezjs_min.t
val show_notification : ?callback:(notificationEvent Ezjs_min.t -> unit) -> ?options:'a notification_options_ml -> serviceWorkerRegistration Ezjs_min.t -> string -> unit
OCaml

Innovation. Community. Security.