alert
caution
This is outdated, feel free to contribute to the docs and update this page. Otherwise it'll get updated in a few weeks.
View code source alert is an invocable that creates an alert. There are three approaches you can use to create one.
Usage
import alert from "42/ui/invocables/alert.js"
const approach1: boolean = await alert(string, object)
const approach2: boolean = await alert(object)
const approach3: boolean = await alert(object)
Approach 1
First argument is a string, and second argument is an object
| Property | Type | Description | Default |
|---|---|---|---|
| message | String | Message to be displayed in alert | "" |
Approach 2
First argument is error-like
| Property | Type | Description | Default |
|---|---|---|---|
| message | Error-like | Message to be displayed in alert | |
| options | Object | See below for properties |
Options
This is an extension of the dialog options | Name | Type | Description | agree | String | text for the "Ok" button | beforeAgree | String/Plan/HTMLElement | Content to be rendered to the left of the "Ok" button | afterAgree | String/Plan/HTMLElement | Content to be rendered to the right of the "Ok button
Approach 3
First argument is an object (not error-like)
| Property | Type | Description |
|---|---|---|
| message | String | Message to be displayed in alert |
Returns
true