MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / confirm

Function confirm

packages/core/ui/dialogs/index.android.ts:153–175  ·  view source on GitHub ↗
(arg: any)

Source from the content-addressed store, hash-verified

151}
152
153export function confirm(arg: any): Promise<boolean> {
154 return new Promise<boolean>((resolve, reject) => {
155 try {
156 const options = !isDialogOptions(arg)
157 ? {
158 title: DialogStrings.CONFIRM,
159 okButtonText: DialogStrings.OK,
160 cancelButtonText: DialogStrings.CANCEL,
161 message: arg + '',
162 }
163 : arg;
164 const alert = createAlertDialog(options);
165
166 addButtonsToAlertDialog(alert, options, function (result) {
167 resolve(result);
168 });
169
170 showDialog(alert);
171 } catch (ex) {
172 reject(ex);
173 }
174 });
175}
176
177export function prompt(...args): Promise<PromptResult> {
178 let options: PromptOptions;

Callers

nothing calls this directly

Calls 5

isDialogOptionsFunction · 0.90
createAlertDialogFunction · 0.85
addButtonsToAlertDialogFunction · 0.85
showDialogFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected