Skip to main content

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

NameType
toastId?string

Returns

void

Defined in

src/services/toastService.ts:254


error

error\<TData>(content, options?): string

Shows an error toast notification.

Type parameters

NameType
TDataunknown

Parameters

NameType
contentToastContent\<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

NameType
TDataunknown

Parameters

NameType
contentToastContent\<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

NameType
toastIdstring

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

NameType
TDataunknown
TErrorunknown
TPendingunknown

Parameters

NameType
promisePromise\<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

NameType
TDataunknown

Parameters

NameType
contentToastContent\<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

NameType
TDataunknown

Parameters

NameType
contentToastContent\<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

NameType
TDataunknown

Parameters

NameType
toastIdstring
optionsUpdateOptions\<TData>

Returns

void

Defined in

src/services/toastService.ts:251


warn

warn\<TData>(content, options?): string

Shows a warning toast notification.

Type parameters

NameType
TDataunknown

Parameters

NameType
contentToastContent\<TData>
options?ToastOptions\<TData>

Returns

string

Defined in

src/services/toastService.ts:239