basalt / notifications/src / Notifier
Class: Notifier
Defined in: notifications/src/notifier.ts:50
Constructors
Constructor
> new Notifier(options): Notifier
Defined in: notifications/src/notifier.ts:56
Parameters
options
Returns
Notifier
Methods
deliver()
> deliver(delivery): Promise<void>
Defined in: notifications/src/notifier.ts:142
Sends a rendered delivery through its channel driver — what a queue worker calls. Throws on failure so the queue can retry.
Parameters
delivery
Returns
Promise<void>
notify()
> notify<T>(recipient, definition, ...rest): Promise<DeliveryReport>
Defined in: notifications/src/notifier.ts:76
Renders and sends (or enqueues) a notification on every resolved channel. Channel failures are isolated — one failing channel never blocks the others; the report tells what happened.
Type Parameters
T
T
Parameters
recipient
definition
NotificationDefinition<T>
rest
...T extends void ? [] : [T]
Returns
Promise<DeliveryReport>
notifyMany()
> notifyMany<T>(recipients, definition, ...rest): Promise<DeliveryReport[]>
Defined in: notifications/src/notifier.ts:126
Type Parameters
T
T
Parameters
recipients
definition
NotificationDefinition<T>
rest
...T extends void ? [] : [T]
Returns
Promise<DeliveryReport[]>
useQueue()
> useQueue(dispatch): this
Defined in: notifications/src/notifier.ts:66
Routes deliveries through a dispatcher (typically a @basaltkit/queue job whose handler calls notifier.deliver) instead of sending inline.
Parameters
dispatch
(delivery) => Promise<void>
Returns
this