NotificationManager
API reference uses a reviewed source snapshot. Source links open the published source; unverified line locations are omitted.
Defined in: notifications.ts:311
Records user-visible notifications and tracks live progress handles.
Extends
Section titled “Extends”EventDispatcher<NotificationEvents>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NotificationManager(
database):NotificationManager
Defined in: notifications.ts:316
Parameters
Section titled “Parameters”database
Section titled “database”clearAllNotifications
Section titled “clearAllNotifications”() => Promise<void>
clearNotification
Section titled “clearNotification”(id) => Promise<void>
listNotifications
Section titled “listNotifications”() => Promise<AppDatabaseNotificationRecord[]>
markNotificationRead
Section titled “markNotificationRead”(id) => Promise<void>
upsertNotification
Section titled “upsertNotification”(record) => Promise<void>
Returns
Section titled “Returns”NotificationManager
Overrides
Section titled “Overrides”Properties
Section titled “Properties”activeProgress
Section titled “activeProgress”activeProgress:
NotificationProgressSnapshot[] =[]
Defined in: notifications.ts:313
records
Section titled “records”records:
AppDatabaseNotificationRecord[] =[]
Defined in: notifications.ts:312
Methods
Section titled “Methods”cancel()
Section titled “cancel()”cancel(
id):void
Defined in: notifications.ts:448
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear(
id):Promise<void>
Defined in: notifications.ts:462
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
clearAll()
Section titled “clearAll()”clearAll():
Promise<void>
Defined in: notifications.ts:468
Returns
Section titled “Returns”Promise<void>
createProgress()
Section titled “createProgress()”createProgress(
options):NotificationProgressHandle
Defined in: notifications.ts:390
Create a mutable progress handle for a long-running task.
Parameters
Section titled “Parameters”options
Section titled “options”Progress metadata shown to the user.
Returns
Section titled “Returns”The new progress handle.
dispatch()
Section titled “dispatch()”dispatch<
T>(eventName, …args):boolean
Defined in: events.ts:105
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”emit()
Section titled “emit()”emit<
T>(eventName, …args):boolean
Defined in: events.ts:98
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”finishProgress()
Section titled “finishProgress()”finishProgress(
snapshot):void
Defined in: notifications.ts:482
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”void
list()
Section titled “list()”list():
AppDatabaseNotificationRecord[]
Defined in: notifications.ts:343
Return the current persisted notification history.
Returns
Section titled “Returns”AppDatabaseNotificationRecord[]
loadPersisted()
Section titled “loadPersisted()”loadPersisted():
Promise<void>
Defined in: notifications.ts:333
Load persisted notification history for the current vault.
Returns
Section titled “Returns”Promise<void>
markRead()
Section titled “markRead()”markRead(
id):Promise<void>
Defined in: notifications.ts:452
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
notify()
Section titled “notify()”notify(
options):AppDatabaseNotificationRecord
Defined in: notifications.ts:354
Record a notification and optionally persist it to history.
Parameters
Section titled “Parameters”options
Section titled “options”string | NotifyOptions
Notification payload or a shorthand message string.
Returns
Section titled “Returns”AppDatabaseNotificationRecord
The recorded notification snapshot.
off<
T>(eventName,listener,context?,once?):void
Defined in: events.ts:78
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”offref()
Section titled “offref()”offref<
T>(ref):void
Defined in: events.ts:87
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”EventRef<NotificationEvents, T>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”on<
T>(eventName,listener,context?):EventRef<NotificationEvents,T,any>
Defined in: events.ts:48
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<NotificationEvents, T, any>
Inherited from
Section titled “Inherited from”once()
Section titled “once()”once<
T>(eventName,listener,context?):EventRef<NotificationEvents,T,any>
Defined in: events.ts:63
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”(…args) => void
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<NotificationEvents, T, any>
Inherited from
Section titled “Inherited from”trigger()
Section titled “trigger()”trigger<
T>(eventName, …args):boolean
Defined in: events.ts:91
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”tryTrigger()
Section titled “tryTrigger()”tryTrigger<
T>(evt, …args):void
Defined in: events.ts:112
Type Parameters
Section titled “Type Parameters”T extends keyof NotificationEvents
Parameters
Section titled “Parameters”EventRef<NotificationEvents, T>
…ArgumentMap<NotificationEvents>[Extract<T, keyof NotificationEvents>]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”updateProgress()
Section titled “updateProgress()”updateProgress(
snapshot):void
Defined in: notifications.ts:474
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”void
withProgress()
Section titled “withProgress()”withProgress<
T>(options,task):Promise<T>
Defined in: notifications.ts:408
Run a task with a managed progress handle.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”options
Section titled “options”Progress metadata shown to the user.
(progress, token) => T | Promise<T>
Task that receives the progress handle and cancellation token.
Returns
Section titled “Returns”Promise<T>
The task result.