N

toasts

namespace toasts

Functions

F

error(cause: unknown): ToastHandle<K extends keyof Messages>(key: K, ...args: MessageArgs<K, [error: unknown, options?: ToastShorthandOptions]>): ToastHandle

Shows an error toast with an X icon, titled "Something went wrong" in the user's language, with the error's own message as its text, and logs the error.

Returns

A ToastHandle for controlling the shown toast.

F

info<K extends keyof Messages>(key: K, ...args: MessageArgs<K, [options?: ToastShorthandOptions]>): ToastHandle

Shows an info toast titled by a message key, with an info icon.

Returns

A ToastHandle for controlling the shown toast.

Shows a toast, generating an id when one is not supplied.

Returns

A ToastHandle for controlling the shown toast.

F

success<K extends keyof Messages>(key: K, ...args: MessageArgs<K, [options?: ToastShorthandOptions]>): ToastHandle

Shows a success toast titled by a message key, with a check icon.

Returns

A ToastHandle for controlling the shown toast.

F

warning<K extends keyof Messages>(key: K, ...args: MessageArgs<K, [options?: ToastShorthandOptions]>): ToastHandle

Shows a warning toast titled by a message key, with a warning icon.

Returns

A ToastHandle for controlling the shown toast.

Types

The arguments after a key, as format(key, vars) takes them: the key's placeholder values when it has placeholders, none when it has none, then Tail.

The toast options a shorthand takes after its key and vars.

A handle returned when showing a toast, used to update or close it.

Options accepted when showing a toast.