Skip to main content
Module

x/evt/lib/index.ts>dom.Notification

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.Notification
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.11/lib/index.ts";
const { Notification } = dom;

This Notifications API interface is used to configure and display desktop notifications to the user.

Properties

readonly
actions: ReadonlyArray<NotificationAction>
readonly
badge: string
readonly
body: string
readonly
data: any
readonly
dir: NotificationDirection
readonly
icon: string
readonly
image: string
readonly
lang: string
onclick: ((this: Notification, ev: Event) => any) | null
onclose: ((this: Notification, ev: Event) => any) | null
onerror: ((this: Notification, ev: Event) => any) | null
onshow: ((this: Notification, ev: Event) => any) | null
readonly
renotify: boolean
readonly
requireInteraction: boolean
readonly
silent: boolean
readonly
tag: string
readonly
timestamp: number
readonly
title: string
readonly
vibrate: ReadonlyArray<number>

Methods

close(): void
addEventListener<K extends keyof NotificationEventMap>(
type: K,
listener: (this: Notification, ev: NotificationEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof NotificationEventMap>(
type: K,
listener: (this: Notification, ev: NotificationEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void