Module Brr_io.NotificationSource

Notifying users.

See the Notification API.

Permission

Sourcemodule Permission : sig ... end

Permission enum.

Sourceval permission : unit -> Permission.t

permission () is the permission granted by the user.

Sourceval request_permission : unit -> Permission.t Fut.or_error

request_permission () requests permission to display notifications.

Notifications

Sourcemodule Direction : sig ... end

Direction enum.

Sourcemodule Action : sig ... end

Actions.

Sourcetype opts

The type for notification options.

Sourceval opts : ?dir: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:Action.t list -> unit -> opts
Sourcetype t

The type for Notification objects.

Sourcetype notification = t

See t .

Sourceval create : ?opts:opts -> Jstr.t -> t

create title ~opts is a notification with title title and options opts.

Sourceval close : t -> unit

close n closes n.

Sourceval as_target : t -> Brr.Ev.target

as_target n is n as an event target.

Properties

Sourceval actions : t -> Action.t list

action n are the actions of n.

Sourceval badge : t -> Jstr.t

badge n is the badge of n.

Sourceval body : t -> Jstr.t

body n is the body of n.

Sourceval data : t -> 'a

data n is the data of n. Warning. This is unsafe, constrain the result type.

Sourceval dir : t -> Direction.t

dir n is the dir of n.

Sourceval lang : t -> Jstr.t

lang n is the lang of n.

Sourceval tag : t -> Jstr.t

tag n is the tag of n.

Sourceval icon : t -> Jstr.t

icon n is the icon of n.

Sourceval image : t -> Jstr.t

image n is the image of n.

Sourceval renotify : t -> bool

renotify n indicates n replaces an old notification.

Sourceval require_interaction : t -> bool

require_interaction n indicates n requires interaction.

Sourceval silent : t -> bool

silent n indicates n should be silent.

Sourceval timestamp_ms : t -> int

timestamp_ms n is the timestamp of n.

Sourceval title : t -> Jstr.t

title n is the title of n.

Events

Sourcemodule Ev : sig ... end

Notification events.