Package org.w3c.notifications

Platform and version requirements: JS

Kotlin JavaScript wrappers for the Web Notifications API.

Types

GetNotificationOptions

external interface GetNotificationOptions

Notification

open external class Notification : EventTarget

Exposes the JavaScript Notification to Kotlin

NotificationAction

external interface NotificationAction

NotificationDirection

external interface NotificationDirection

NotificationEvent

open external class NotificationEvent : ExtendableEvent

Exposes the JavaScript NotificationEvent to Kotlin

NotificationEventInit

external interface NotificationEventInit : 
    ExtendableEventInit

NotificationOptions

external interface NotificationOptions

NotificationPermission

external interface NotificationPermission

Functions

GetNotificationOptions

fun GetNotificationOptions(
    tag: String? = ""
): GetNotificationOptions

NotificationAction

fun NotificationAction(
    action: String?,
    title: String?,
    icon: String? = null
): NotificationAction

NotificationEventInit

fun NotificationEventInit(
    notification: Notification?,
    action: String? = "",
    bubbles: Boolean? = false,
    cancelable: Boolean? = false,
    composed: Boolean? = false
): NotificationEventInit

NotificationOptions

fun NotificationOptions(
    dir: NotificationDirection? = NotificationDirection.AUTO,
    lang: String? = "",
    body: String? = "",
    tag: String? = "",
    image: String? = null,
    icon: String? = null,
    badge: String? = null,
    sound: String? = null,
    vibrate: dynamic = null,
    timestamp: Number? = null,
    renotify: Boolean? = false,
    silent: Boolean? = false,
    noscreen: Boolean? = false,
    requireInteraction: Boolean? = false,
    sticky: Boolean? = false,
    data: Any? = null,
    actions: Array<NotificationAction>? = arrayOf()
): NotificationOptions

Companion Object Properties

AUTO

val NotificationDirection.Companion.AUTO: NotificationDirection

DEFAULT

val NotificationPermission.Companion.DEFAULT: NotificationPermission

DENIED

val NotificationPermission.Companion.DENIED: NotificationPermission

GRANTED

val NotificationPermission.Companion.GRANTED: NotificationPermission

LTR

val NotificationDirection.Companion.LTR: NotificationDirection

RTL

val NotificationDirection.Companion.RTL: NotificationDirection