showConfirmDialogAsync()
Displays a confirmation dialog with the specified text and buttons.
showConfirmDialogAsync(
config:
| MessageDialogOptions
| DeferredString
| string
| StringConvertible[],
confirmText?: StringConvertible,
cancelText?: StringConvertible,
otherText?: StringConvertible,
): Promise<boolean | 0>;
Notes
- Use fmt to translate content if necessary; this method doesn’t localize strings by default.
Parameters
- config — An instance of MessageDialogOptions; or a callback function to set options for the dialog to be displayed; or one or more messages to be displayed
- confirmText — The text for the confirm button (if a single message was provided instead of an options object or callback)
- cancelText — The text for the cancel button (if a single message was provided instead of an options object or callback)
- otherText — The text for an alternative button (if a single message was provided instead of an options object or callback)
Return value
A promise that resolves to true if the confirm button was clicked, false if cancelled, or the number 0 if the alternative option is selected (if any).
Errors
This method throws an error if the modal dialog controller can’t be initialized (i.e. there’s no modal factory or confirm dialog builder).
Related
class AppContext
A singleton class that represents the global application state.
