mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-02 10:57:28 +08:00
alert promise changed to promise<void>
This commit is contained in:
@ -12,8 +12,8 @@ function createAlertDialog(options: dialogs.DialogOptions): android.app.AlertDia
|
||||
return alert;
|
||||
}
|
||||
|
||||
export function alert(arg: any): promises.Promise<any> {
|
||||
var d = promises.defer<any>();
|
||||
export function alert(arg: any): promises.Promise<void> {
|
||||
var d = promises.defer<void>();
|
||||
try {
|
||||
var options = typeof arg === "string" ? { message: arg, title: "Alert", buttonName: "OK" } : arg
|
||||
|
||||
|
||||
4
ui/dialogs/dialogs.d.ts
vendored
4
ui/dialogs/dialogs.d.ts
vendored
@ -4,13 +4,13 @@
|
||||
* The alert() method displays an alert box with a specified message.
|
||||
* @param message Specifies the text to display in the alert box.
|
||||
*/
|
||||
function alert(message: string): promises.Promise<any>;
|
||||
function alert(message: string): promises.Promise<void>;
|
||||
|
||||
/**
|
||||
* The alert() method displays an alert box with a specified options.
|
||||
* @param options Specifies the options for the alert box.
|
||||
*/
|
||||
function alert(options: AlertOptions): promises.Promise<any>;
|
||||
function alert(options: AlertOptions): promises.Promise<void>;
|
||||
|
||||
/**
|
||||
* The confirm() method displays a dialog box with a specified message.
|
||||
|
||||
@ -29,8 +29,8 @@ function createDelegate(callback) {
|
||||
return new delegateType;
|
||||
}
|
||||
|
||||
export function alert(arg: any): promises.Promise<any> {
|
||||
var d = promises.defer<any>();
|
||||
export function alert(arg: any): promises.Promise<void> {
|
||||
var d = promises.defer<void>();
|
||||
try {
|
||||
var options = typeof arg === STRING ? { message: arg, title: ALERT, buttonName: OK } : arg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user