package ezjs_push

  1. Overview
  2. Docs

Module Ezjs_pushSource

Sourceclass type extendableEvent = object ... end

Notification API

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

Push API

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

Service Worker API

Sourceclass type serviceWorker = object ... end
Sourceclass type navigationPreloadState = object ... end
Sourceclass type navigationPreloadManager = object ... end
Sourceclass type sync_register_options = object ... end
Sourceclass type syncRegistration = object ... end
Sourceclass type syncManager = object ... end
Sourceclass type 'a contentIndex = object ... end
Sourceclass type get_notification_options = object ... end
Sourceclass type serviceWorkerRegistration = object ... end
Sourceclass type registration_options = object ... end
Sourceclass type serviceWorkerContainer = object ... end
Sourceclass type navigator = object ... end
Sourceclass type serviceWorkerGlobalScope = object ... end
Sourceval navigator : navigator Ezjs_min.t

OCaml Helpers

Sourcetype notification_action_ml = {
  1. na_action : string option;
  2. na_title : string option;
  3. na_icon : string option;
}
Sourceval empty_action : notification_action_ml
Sourcetype '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;
}
Sourceval empty_notif : 'a notification_options_ml
Sourcetype subscription_options_ml = {
  1. so_user_visible_only : bool option;
  2. so_application_server_key : string option;
}
Sourceval request_permission : (Ezjs_min.js_string Ezjs_min.t -> unit) -> unit
Sourceval permission : unit -> string
Sourceval service_worker : unit -> serviceWorkerContainer Ezjs_min.t
Sourceval register_worker : ?scope:string -> ?callback:(unit -> unit) -> string -> unit
Sourceval get_registration : ?none:(unit -> unit) -> ?scope:string -> (serviceWorkerRegistration Ezjs_min.t -> unit) -> unit
Sourceval registration : string -> (serviceWorkerRegistration Ezjs_min.t -> unit) -> unit
Sourceval 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
Sourceval unregister_worker : < unregister : 'res Js_of_ocaml.Js.meth.. > Js_of_ocaml.Js.t -> unit
Sourceval get_registrations : (serviceWorkerRegistration Ezjs_min.t list -> unit) -> unit
Sourceval unregister_all : unit -> unit
Sourceval push_manager : < pushManager : < get : 'res.. > Js_of_ocaml.Js.gen_prop.. > Js_of_ocaml.Js.t -> 'res
Sourceval onactivate : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onpush : (pushEvent Ezjs_min.t -> unit) -> unit
Sourceval onfetch : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval oninstall : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onmessage : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onnotificationclick : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onnotificationclose : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onpushsubscriptionchange : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval onsync : (Ezjs_min.Dom_html.event Ezjs_min.t -> unit) -> unit
Sourceval urlBase64ToUint8Array : string -> (int, int, Bigarray.int8_unsigned_elt) Js_of_ocaml__Typed_array.typedArray Js_of_ocaml.Js.t
Sourceval 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
Sourceval 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
Sourceval make_notification_options : 'a notification_options_ml -> notification_options Ezjs_min.t
Sourceval show_notification : ?callback:(notificationEvent Ezjs_min.t -> unit) -> ?options:'a notification_options_ml -> serviceWorkerRegistration Ezjs_min.t -> string -> unit