(arg: any)
| 107 | } |
| 108 | |
| 109 | export function confirm(arg: any): Promise<boolean> { |
| 110 | return new Promise<boolean>((resolve, reject) => { |
| 111 | try { |
| 112 | const options = !isDialogOptions(arg) |
| 113 | ? { |
| 114 | title: DialogStrings.CONFIRM, |
| 115 | okButtonText: DialogStrings.OK, |
| 116 | cancelButtonText: DialogStrings.CANCEL, |
| 117 | message: arg + '', |
| 118 | } |
| 119 | : arg; |
| 120 | const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert); |
| 121 | |
| 122 | addButtonsToAlertController(alertController, options, (r) => { |
| 123 | resolve(r); |
| 124 | }); |
| 125 | |
| 126 | showUIAlertController(alertController); |
| 127 | } catch (ex) { |
| 128 | reject(ex); |
| 129 | } |
| 130 | }); |
| 131 | } |
| 132 | |
| 133 | export function prompt(...args): Promise<PromptResult> { |
| 134 | let options: PromptOptions; |
nothing calls this directly
no test coverage detected