Skip to content

@serenity-is/corelib / confirm

Variable: confirm()

const confirm: (message, onYes, options?) => Partial<Dialog> = confirmDialog

Defined in: src/compat/dialogs-compat.ts:15

Legacy Q.confirm alias.

Displays a confirmation dialog with Yes / No (and optional Cancel) buttons.

Parameters

message

RenderableContent

Text or renderable content shown in the dialog body.

onYes

() => void

Callback invoked when the Yes button is clicked.

options?

ConfirmDialogOptions

Additional ConfirmDialogOptions.

Returns

Partial<Dialog>

A Dialog handle (partial when falling back to the native confirm()), whose result is "yes", "no", or "cancel".

Remarks

Falls back to the native confirm() when neither Bootstrap modal nor jQuery UI dialog is available.

Example

confirmDialog("Are you sure you want to delete?", () => {
  // do something when yes is clicked
});

Deprecated

Use confirmDialog instead.

See

confirmDialog