Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Notification

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

interface Notification extends EventTarget {
readonly body: string;
readonly data: any;
readonly dir: NotificationDirection;
readonly icon: 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 tag: string;
readonly title: string;
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;
close(): 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;
}
var Notification: {
prototype: Notification;
readonly permission: NotificationPermission;
new (title: string, options?: NotificationOptions): Notification;
requestPermission(deprecatedCallback?: NotificationPermissionCallback): Promise<NotificationPermission>;
}
;

§Extends

§Properties

§
readonly body: string
[src]
§
readonly data: any
[src]
§
readonly icon: string
[src]
§
readonly lang: string
[src]
§
onclick: ((this: Notification, ev: Event) => any) | null
[src]
§
onclose: ((this: Notification, ev: Event) => any) | null
[src]
§
onerror: ((this: Notification, ev: Event) => any) | null
[src]
§
onshow: ((this: Notification, ev: Event) => any) | null
[src]
§
readonly tag: string
[src]
§
readonly title: string
[src]

§Methods

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