mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 11:29:30 +08:00
Merge pull request #6945 from jacqueskang/ionic-popup-confirm
Use IonicPopupConfirmPromise as return type of IonicPopupService.confirm()
This commit is contained in:
+10
-4
@@ -84,13 +84,19 @@ class IonicTestController {
|
||||
|
||||
private testActionSheet(): void {
|
||||
var closeActionSheetFn: ()=>void = this.$ionicActionSheet.show({
|
||||
buttons: [],
|
||||
buttons: [{ text: 'A button' }],
|
||||
titleText: "titleText",
|
||||
cancelText: "cancelText",
|
||||
destructiveText: "destructiveText",
|
||||
cancel: ()=>{ console.log("cancel"); },
|
||||
buttonClicked: ()=>{ console.log("buttonClicked"); },
|
||||
destructiveButtonClicked: ()=>{ console.log("destructiveButtonClicked"); },
|
||||
buttonClicked: (index)=>{
|
||||
console.log("buttonClicked");
|
||||
return index === 0;
|
||||
},
|
||||
destructiveButtonClicked: ()=>{
|
||||
console.log("destructiveButtonClicked");
|
||||
return false;
|
||||
},
|
||||
cancelOnStateChange: true,
|
||||
cssClass: "cssClass"
|
||||
});
|
||||
@@ -249,7 +255,7 @@ class IonicTestController {
|
||||
okType: "okType",
|
||||
cancelText: "Cancel",
|
||||
cancelType: "cancelType"
|
||||
}).then(() => console.log("popover shown"))
|
||||
}).then((result) => console.log(result === true ? "confirmed": "cancelled"))
|
||||
this.$ionicPopup.confirm({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
|
||||
Vendored
+10
-4
@@ -102,14 +102,17 @@ declare module ionic {
|
||||
interface IonicActionSheetService {
|
||||
show(options: IonicActionSheetOptions): ()=>void;
|
||||
}
|
||||
interface IonicActionSheetButton {
|
||||
text: string;
|
||||
}
|
||||
interface IonicActionSheetOptions {
|
||||
buttons?: Array<any>;
|
||||
buttons?: Array<IonicActionSheetButton>;
|
||||
titleText?: string;
|
||||
cancelText?: string;
|
||||
destructiveText?: string;
|
||||
cancel?: ()=>any;
|
||||
buttonClicked?: (index: any)=>any;
|
||||
destructiveButtonClicked?: ()=>any;
|
||||
buttonClicked?: (index: number)=>boolean;
|
||||
destructiveButtonClicked?: ()=>boolean;
|
||||
cancelOnStateChange?: boolean;
|
||||
cssClass?: string;
|
||||
}
|
||||
@@ -246,10 +249,13 @@ declare module ionic {
|
||||
interface IonicPopupService {
|
||||
show(options: IonicPopupFullOptions): IonicPopupPromise;
|
||||
alert(options: IonicPopupAlertOptions): IonicPopupPromise;
|
||||
confirm(options: IonicPopupConfirmOptions): IonicPopupPromise;
|
||||
confirm(options: IonicPopupConfirmOptions): IonicPopupConfirmPromise;
|
||||
prompt(options: IonicPopupPromptOptions): IonicPopupPromise;
|
||||
}
|
||||
|
||||
interface IonicPopupConfirmPromise extends ng.IPromise<boolean> {
|
||||
close(value?: boolean): void;
|
||||
}
|
||||
interface IonicPopupPromise extends ng.IPromise<any> {
|
||||
close(value?: any): any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user