Dialog class

A static class for showing stock dialogs such as an alert or prompt.

Methods

alert(message, options)

Alerts a message to the user with a user-friendly interface. Calling this method sends a request to application to show the alert dialog.

prompt(message, options)

Prompts the user for a string value with a user-friendly interface. Calling this method sends a request to application to show the dialog.

Method Details

alert(message, options)

Alerts a message to the user with a user-friendly interface. Calling this method sends a request to application to show the alert dialog.

static alert(message: string, options?: IAlertOptions): Promise<void>;

Parameters

message

string

The message to alert

options
IAlertOptions

Returns

!Promise:class<void>

Remarks

There might be a delay until the dialog is approved and shown by the application, for example, if there is another dialog currently being shown. The returned promise resolves when the dialog is successfully shown and closed. The promise rejects if the application rejects the request for any reason.

prompt(message, options)

Prompts the user for a string value with a user-friendly interface. Calling this method sends a request to application to show the dialog.

static prompt(message: string, options?: IPromptOptions): Promise<string | undefined>;

Parameters

message

string

The message for prompt dialog

options
IPromptOptions

Returns

!Promise:class<string | undefined>

The input string or undefined if the dialog was canceled

Remarks

There might be a delay until the dialog is approved and shown by the application, for example, if there is another dialog currently being shown. The returned promise resolves when the dialog is successfully shown and closed. The promise rejects if the application rejects the request for any reason.