Interface: IToastService
services.IToastService
Service for displaying toast notifications.
Table of contents
Methods
Methods
dismiss
▸ dismiss(toastId?
): void
Dismisses a toast notification by its ID.
Parameters
Name | Type |
---|---|
toastId? | string |
Returns
void
Defined in
src/services/toastService.ts:254
error
▸ error\<TData
>(content
, options?
): string
Shows an error toast notification.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
content | ToastContent \<TData > |
options? | ToastOptions \<TData > |
Returns
string
Defined in
src/services/toastService.ts:245
info
▸ info\<TData
>(content
, options?
): string
Shows an info toast notification.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
content | ToastContent \<TData > |
options? | ToastOptions \<TData > |
Returns
string
Defined in
src/services/toastService.ts:233
isActive
▸ isActive(toastId
): boolean
Checks if a toast notification is currently active.
Parameters
Name | Type |
---|---|
toastId | string |
Returns
boolean
Defined in
src/services/toastService.ts:257
promise
▸ promise\<TData
, TError
, TPending
>(promise
, «destructured»
, options?
): Promise
\<TData
>
Shows a toast that will be automatically dismissed when the promise resolves.
Type parameters
Name | Type |
---|---|
TData | unknown |
TError | unknown |
TPending | unknown |
Parameters
Name | Type |
---|---|
promise | Promise \<TData > | () => Promise \<TData > |
«destructured» | ToastPromiseParams \<TData , TError , TPending > |
options? | ToastOptions \<{}> |
Returns
Promise
\<TData
>
A promise resolving to the type TData.
Defined in
src/services/toastService.ts:220
show
▸ show\<TData
>(content
, options?
): string
Shows a toast notification with content and options.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
content | ToastContent \<TData > |
options? | ToastOptions \<TData > |
Returns
string
A string representing the toast ID.
Defined in
src/services/toastService.ts:211
success
▸ success\<TData
>(content
, options?
): string
Shows a success toast notification.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
content | ToastContent \<TData > |
options? | ToastOptions \<TData > |
Returns
string
Defined in
src/services/toastService.ts:227
update
▸ update\<TData
>(toastId
, options
): void
Updates an existing toast notification by its ID.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
toastId | string |
options | UpdateOptions \<TData > |
Returns
void
Defined in
src/services/toastService.ts:251
warn
▸ warn\<TData
>(content
, options?
): string
Shows a warning toast notification.
Type parameters
Name | Type |
---|---|
TData | unknown |
Parameters
Name | Type |
---|---|
content | ToastContent \<TData > |
options? | ToastOptions \<TData > |
Returns
string