Class: Toast
Defined in: packages/blockly/core/toast.ts:55
Class that allows for showing and dismissing temporary notifications.
Methods index
| Method | Description |
|---|---|
| show | Shows a toast notification. |
| createDom | Creates the DOM representation of a toast. |
| hide | Dismiss a toast, e.g. in response to a user action. |
Constructors
Constructor
new Toast(): Toast;
Returns
Toast
Methods
show()
static show(workspace, options): void;
Defined in: packages/blockly/core/toast.ts:65
Shows a toast notification.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace to show the toast on. |
options | ToastOptions | Configuration options for the toast message, duration, etc. |
Returns
void
createDom()
protected static createDom(workspace, options): HTMLDivElement;
Defined in: packages/blockly/core/toast.ts:89
Creates the DOM representation of a toast.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace to inject the toast notification onto. |
options | ToastOptions | Configuration options for the toast. |
Returns
HTMLDivElement
The root DOM element of the toast.
hide()
static hide(workspace, id?): void;
Defined in: packages/blockly/core/toast.ts:182
Dismiss a toast, e.g. in response to a user action.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace to dismiss a toast in. |
id? | string | The toast ID, or undefined to clear any toast. |
Returns
void