Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

wb.notifications

WorkbookNotifications

Workbook-level notifications sub-API. Provides toast/notification operations without requiring apps to import from `@mog/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

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

Show a notification. Returns the notification ID.

info

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

Show an info notification. Returns the notification ID.

success

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

Show a success notification. Returns the notification ID.

warning

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

Show a warning notification. Returns the notification ID.

error

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

Show an error notification. Returns the notification ID.

dismiss

void
dismiss(id: string): void;
ParameterTypeRequired
idstringrequired

Dismiss a notification by ID

dismissAll

void
dismissAll(): void;

Dismiss all notifications