@zturnlibs/ztron-api


notification

Interfaces

NotificationOptions

Defined in: notification.ts:7

Properties

body?

optional body?: string

Defined in: notification.ts:9

title

title: string

Defined in: notification.ts:8

Variables

notification

const notification: object

Defined in: notification.ts:32

Type Declaration

isPermissionGranted

isPermissionGranted: () => Promise<boolean>

Whether the OS has authorized notifications for this app.

Returns

Promise<boolean>

requestPermission

requestPermission: () => Promise<boolean>

Prompts the user for notification authorization (resolves the grant).

Returns

Promise<boolean>

send

send: (options) => Promise<void> = sendNotification

Sends a native notification (title + optional body).

Parameters
options

NotificationOptions

Returns

Promise<void>

Functions

isPermissionGranted()

isPermissionGranted(): Promise<boolean>

Defined in: notification.ts:23

Whether the OS has authorized notifications for this app.

Returns

Promise<boolean>


requestPermission()

requestPermission(): Promise<boolean>

Defined in: notification.ts:28

Prompts the user for notification authorization (resolves the grant).

Returns

Promise<boolean>


sendNotification()

sendNotification(options): Promise<void>

Defined in: notification.ts:13

Sends a native notification (title + optional body).

Parameters

options

NotificationOptions

Returns

Promise<void>