Alert
Last updated
Last updated
When the user takes an important action (for example when irreversibly deleting something), you can ask for confirmation by using confirmAlert
.
Creates and shows a confirmation Alert with the given options.
A Promise that resolves to a boolean when the user triggers one of the actions. It will be true
for the primary Action, false
for the dismiss Action.
The options to create an Alert.
title*
The title of an alert. Displayed below the icon.
string
dismissAction
The Action to dismiss the alert. There usually shouldn't be any side effects when the user takes this action.
message
An additional message for an Alert. Useful to show more information, e.g. a confirmation message for a destructive action.
string
rememberUserChoice
If set to true, the Alert will also display a Do not show this message again
checkbox. When checked, the answer is persisted and directly returned to the extension the next time the alert should be shown, without the user actually seeing the alert.
boolean
The options to create an Alert Action.
title*
The title of the action.
string
onAction
A callback called when the action is triggered.
() => void
Defines the visual style of an Action of the Alert.
Use Alert.ActionStyle.Default for confirmations of a positive action. Use Alert.ActionStyle.Destructive for confirmations of a destructive action (eg. deleting a file).
Default
Destructive
Cancel