Skip to main content

reporting.alerts

Send notifications and confirmations to users.

confirm()

confirm(message, options): void

Display an confirmation dialog for a user. Run a function when the user confirms or cancels.

Parameters

ParameterTypeDescription
messagestringThe textual message displayed to the user in the alert.
optionsobject
options.cancelText?stringThe textual content of the "cancel" button. Defaults to "Cancel" if not provided.
options.confirmText?stringThe textual content of the "confirm" button. Defaults to "Confirm" if not provided.
options.onCancel?() => voidFunction that runs if the "cancel" button is clicked.
options.onConfirm() => voidFunction that runs if the "confirm" button is clicked.

Returns

void


notify()

notify(message, options?): void

Display an alert for a user.

Parameters

ParameterTypeDescription
messagestringThe textual message displayed to the user in the alert.
options?object
options.level?AlertLevelHow the alert should be displayed to the user. Defaults to info if not provided.

Returns

void