Skip to content

wb.notifications

WorkbookNotifications

Workbook-level notifications sub-API. Provides toast/notification operations without requiring apps to import from `@mog-sdk/kernel/services/notifications`.

9 methods

getAll

Notification[]
getAll(): Notification[];

Get all active notifications

subscribe

CallableDisposable
subscribe(listener: (notifications: Notification[]) => void): CallableDisposable;
ParameterTypeRequired
listener(notifications: Notification[]) => voidrequired

Subscribe to notification changes. Returns CallableDisposable — call directly or .dispose() to unsubscribe.

notify

NotificationId
notify(message: string, options?: NotificationOptions): NotificationId;
ParameterTypeRequired
messagestringrequired
optionsNotificationOptionsoptional

Show a notification. Returns the notification ID.

info

NotificationId
info(message: string, options?: Omit<NotificationOptions, 'type'>): NotificationId;
ParameterTypeRequired
messagestringrequired
optionsOmit<NotificationOptions, 'type'>optional

Show an info notification. Returns the notification ID.

success

NotificationId
success(message: string, options?: Omit<NotificationOptions, 'type'>): NotificationId;
ParameterTypeRequired
messagestringrequired
optionsOmit<NotificationOptions, 'type'>optional

Show a success notification. Returns the notification ID.

warning

NotificationId
warning(message: string, options?: Omit<NotificationOptions, 'type'>): NotificationId;
ParameterTypeRequired
messagestringrequired
optionsOmit<NotificationOptions, 'type'>optional

Show a warning notification. Returns the notification ID.

error

NotificationId
error(message: string, options?: Omit<NotificationOptions, 'type'>): NotificationId;
ParameterTypeRequired
messagestringrequired
optionsOmit<NotificationOptions, 'type'>optional

Show an error notification. Returns the notification ID.

dismiss

void
dismiss(id: NotificationId): void;
ParameterTypeRequired
idNotificationIdrequired

Dismiss a notification by ID

dismissAll

void
dismissAll(): void;

Dismiss all notifications