ToastManager
Defined in: src/core/toast.ts:49
Process-wide store of active toasts; <ToastHost> subscribes to render them. Prefer the toast façade.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ToastManager():
ToastManager
Returns
Section titled “Returns”ToastManager
Accessors
Section titled “Accessors”maxVisible
Section titled “maxVisible”Get Signature
Section titled “Get Signature”get maxVisible():
number
Defined in: src/core/toast.ts:69
Cap on simultaneously-visible toasts. A burst beyond the cap queues; each queued toast is promoted (and its auto-dismiss countdown started) only when a visible slot frees up, so a flood can’t bury the screen. Default: unlimited.
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set maxVisible(
n):void
Defined in: src/core/toast.ts:72
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
pendingCount
Section titled “pendingCount”Get Signature
Section titled “Get Signature”get pendingCount():
number
Defined in: src/core/toast.ts:85
Number of toasts queued behind the maxVisible cap.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: src/core/toast.ts:134
Remove all toasts, visible and queued.
Returns
Section titled “Returns”void
dismiss()
Section titled “dismiss()”dismiss(
id):void
Defined in: src/core/toast.ts:121
Remove the toast with id (visible or still queued).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
getToasts()
Section titled “getToasts()”getToasts(): readonly
Toast[]
Defined in: src/core/toast.ts:80
Current visible toasts, oldest first. Stable reference between changes.
Returns
Section titled “Returns”readonly Toast[]
notify()
Section titled “notify()”notify(
opts):number
Defined in: src/core/toast.ts:98
Raise a toast; returns its id for later dismiss.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
subscribe()
Section titled “subscribe()”subscribe(
cb): () =>void
Defined in: src/core/toast.ts:90
Subscribe to changes; returns an unsubscribe function.
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”() => void
getInstance()
Section titled “getInstance()”
staticgetInstance():ToastManager
Defined in: src/core/toast.ts:52
The shared singleton instance.
Returns
Section titled “Returns”ToastManager