Skip to content

vue-mvvm / toast / ToastService

ToastService ​

Service for showing toasts.

Constructors ​

Constructor ​

ts
new ToastService(): ToastService;

Returns ​

ToastService

Methods ​

initToast() ​

ts
initToast<Options, Instance, Arguments>(
   cls, 
   options, ...
args): Promise<Instance>;

Initializes and registers a new toast.

Type Parameters ​

Options ​

Options extends ToastOptions

Instance ​

Instance extends ToastControl<Options>

Arguments ​

Arguments extends any[]

Parameters ​

cls ​

ToastControlConstructor<Options, Instance, Arguments>

The constructor for the toast.

options ​

Options

The options for the toast.

args ​

...Arguments

Additional arguments for the constructor.

Returns ​

Promise<Instance>

A promise that resolves to the toast instance.


showInfo() ​

ts
showInfo(options): Promise<InfoToastControl>;

Shows an informational toast.

Parameters ​

options ​

InfoToastOptions

The options for the toast.

Returns ​

Promise<InfoToastControl>

A promise that resolves to the InfoToastControl instance.

Throws ​

InfoComponentNotFoundError if no info toast component is registered.


showProgress() ​

ts
showProgress(options): Promise<ProgressToastControl>;

Shows a progress toast.

Parameters ​

options ​

ProgressToastOptions

The options for the toast.

Returns ​

Promise<ProgressToastControl>

A promise that resolves to the ProgressToastControl instance.

Throws ​

ProgressComponentNotFoundError if no progress toast component is registered.