@vicinae/api 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/alert.d.ts +15 -0
- package/dist/api/alert.js +15 -0
- package/package.json +1 -1
package/dist/api/alert.d.ts
CHANGED
|
@@ -23,6 +23,21 @@ export declare namespace Alert {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
+
* Display a confirmation dialog with a cancel and confirm options.
|
|
27
|
+
* The action is canceled if the cancel button is pressed or if the alert is dismissed for any reason.
|
|
28
|
+
*
|
|
29
|
+
* @remarks Calling this function when another alert is currently pending will result in the pending alert
|
|
30
|
+
* to be automatically canceled, replacing it with the new one.
|
|
31
|
+
*
|
|
32
|
+
* @returns - whether the action was confirmed.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* if (await confirmAlert({ title: 'Are you sure?', description: 'This can't be undone' })) {
|
|
37
|
+
* performDangerousAction();
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
26
41
|
* @category Alert
|
|
27
42
|
*/
|
|
28
43
|
export declare const confirmAlert: (options: Alert.Options) => Promise<boolean>;
|
package/dist/api/alert.js
CHANGED
|
@@ -22,6 +22,21 @@ const styleMap = {
|
|
|
22
22
|
[Alert.ActionStyle.Cancel]: ui_1.ConfirmAlertActionStyle.Cancel,
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
+
* Display a confirmation dialog with a cancel and confirm options.
|
|
26
|
+
* The action is canceled if the cancel button is pressed or if the alert is dismissed for any reason.
|
|
27
|
+
*
|
|
28
|
+
* @remarks Calling this function when another alert is currently pending will result in the pending alert
|
|
29
|
+
* to be automatically canceled, replacing it with the new one.
|
|
30
|
+
*
|
|
31
|
+
* @returns - whether the action was confirmed.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* if (await confirmAlert({ title: 'Are you sure?', description: 'This can't be undone' })) {
|
|
36
|
+
* performDangerousAction();
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
25
40
|
* @category Alert
|
|
26
41
|
*/
|
|
27
42
|
const confirmAlert = async (options) => {
|