Module Brr_io.Notification
Notifying users.
See the Notification API.
Permission
module Permission : sig ... endPermission enum.
val permission : unit -> Brr_io.Notification.Permission.tpermission () is the permission granted by the user.
val request_permission : unit -> Brr_io.Notification.Permission.t Fut.or_errorrequest_permission () requests permission to display notifications.
Notifications
module Direction : sig ... endDirection enum.
module Action : sig ... endActions.
val opts :
?dir:Brr_io.Notification.Direction.t ->
?lang:Jstr.t ->
?body:Jstr.t ->
?tag:Jstr.t ->
?image:Jstr.t ->
?icon:Jstr.t ->
?badge:Jstr.t ->
?timestamp_ms:int ->
?renotify:bool ->
?silent:bool ->
?require_interaction:bool ->
?data:'a ->
?actions:Brr_io.Notification.Action.t list ->
unit ->
Brr_io.Notification.optsThe type for Notification objects.
type notification = Brr_io.Notification.tSee t .
val create : ?opts:Brr_io.Notification.opts -> Jstr.t -> Brr_io.Notification.tcreate title ~opts is a notification with title title and options opts.
val close : Brr_io.Notification.t -> unitclose n closes n.
val as_target : Brr_io.Notification.t -> Brr.Ev.targetas_target n is n as an event target.
Properties
val actions : Brr_io.Notification.t -> Brr_io.Notification.Action.t listaction n are the actions of n.
val badge : Brr_io.Notification.t -> Jstr.tbadge n is the badge of n.
val body : Brr_io.Notification.t -> Jstr.tbody n is the body of n.
val data : Brr_io.Notification.t -> 'adata n is the data of n. Warning. This is unsafe, constrain the result type.
val dir : Brr_io.Notification.t -> Brr_io.Notification.Direction.tdir n is the dir of n.
val lang : Brr_io.Notification.t -> Jstr.tlang n is the lang of n.
val tag : Brr_io.Notification.t -> Jstr.ttag n is the tag of n.
val icon : Brr_io.Notification.t -> Jstr.ticon n is the icon of n.
val image : Brr_io.Notification.t -> Jstr.timage n is the image of n.
val renotify : Brr_io.Notification.t -> boolrenotify n indicates n replaces an old notification.
val require_interaction : Brr_io.Notification.t -> boolrequire_interaction n indicates n requires interaction.
val silent : Brr_io.Notification.t -> boolsilent n indicates n should be silent.
val timestamp_ms : Brr_io.Notification.t -> inttimestamp_ms n is the timestamp of n.
val title : Brr_io.Notification.t -> Jstr.ttitle n is the title of n.
Events
module Ev : sig ... endNotification events.
val to_jv : Brr_io.Notification.t -> Jv.jvval of_jv : Jv.jv -> Brr_io.Notification.t