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,
listener: EventListenerOrEventListenerObject,
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,
listener: EventListenerOrEventListenerObject,
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 dir: NotificationDirection
[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]§Methods
§
addEventListener<K extends keyof NotificationEventMap>(
[src]type: K,
listener: (this: Notification, ev: NotificationEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
removeEventListener<K extends keyof NotificationEventMap>(
[src]type: K,
listener: (this: Notification, ev: NotificationEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void