Skip to content

NotificationManager

Defined in: notifications.ts:311

Records user-visible notifications and tracks live progress handles.

new NotificationManager(database): NotificationManager

Defined in: notifications.ts:316

NotificationManager

EventDispatcher.constructor

activeProgress: NotificationProgressSnapshot[] = []

Defined in: notifications.ts:313


records: AppDatabaseNotificationRecord[] = []

Defined in: notifications.ts:312

cancel(id): void

Defined in: notifications.ts:448

string

void


clear(id): Promise<void>

Defined in: notifications.ts:462

string

Promise<void>


clearAll(): Promise<void>

Defined in: notifications.ts:468

Promise<void>


createProgress(options): NotificationProgressHandle

Defined in: notifications.ts:390

Create a mutable progress handle for a long-running task.

NotificationProgressOptions

Progress metadata shown to the user.

NotificationProgressHandle

The new progress handle.


dispatch<T>(eventName, …args): boolean

Defined in: events.ts:105

T extends keyof NotificationEvents

T

ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]

boolean

EventDispatcher.dispatch


emit<T>(eventName, …args): boolean

Defined in: events.ts:98

T extends keyof NotificationEvents

T

ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]

boolean

EventDispatcher.emit


finishProgress(snapshot): void

Defined in: notifications.ts:482

NotificationProgressSnapshot

void


list(): AppDatabaseNotificationRecord[]

Defined in: notifications.ts:343

Return the current persisted notification history.

AppDatabaseNotificationRecord[]


loadPersisted(): Promise<void>

Defined in: notifications.ts:333

Load persisted notification history for the current vault.

Promise<void>


markRead(id): Promise<void>

Defined in: notifications.ts:452

string

Promise<void>


notify(options): AppDatabaseNotificationRecord

Defined in: notifications.ts:354

Record a notification and optionally persist it to history.

string | NotifyOptions

Notification payload or a shorthand message string.

AppDatabaseNotificationRecord

The recorded notification snapshot.


off<T>(eventName, listener, context?, once?): void

Defined in: events.ts:78

T extends keyof NotificationEvents

T

(…args) => void

any

boolean

void

EventDispatcher.off


offref<T>(ref): void

Defined in: events.ts:87

T extends keyof NotificationEvents

EventRef<NotificationEvents, T>

void

EventDispatcher.offref


on<T>(eventName, listener, context?): EventRef<NotificationEvents, T, any>

Defined in: events.ts:48

T extends keyof NotificationEvents

T

(…args) => void

any

EventRef<NotificationEvents, T, any>

EventDispatcher.on


once<T>(eventName, listener, context?): EventRef<NotificationEvents, T, any>

Defined in: events.ts:63

T extends keyof NotificationEvents

T

(…args) => void

any

EventRef<NotificationEvents, T, any>

EventDispatcher.once


trigger<T>(eventName, …args): boolean

Defined in: events.ts:91

T extends keyof NotificationEvents

T

ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]

boolean

EventDispatcher.trigger


tryTrigger<T>(evt, …args): void

Defined in: events.ts:112

T extends keyof NotificationEvents

EventRef<NotificationEvents, T>

ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]

void

EventDispatcher.tryTrigger


updateProgress(snapshot): void

Defined in: notifications.ts:474

NotificationProgressSnapshot

void


withProgress<T>(options, task): Promise<T>

Defined in: notifications.ts:408

Run a task with a managed progress handle.

T

NotificationProgressOptions

Progress metadata shown to the user.

(progress, token) => T | Promise<T>

Task that receives the progress handle and cancellation token.

Promise<T>

The task result.