diff --git a/dist/plugins/actionsheet.d.ts b/dist/plugins/actionsheet.d.ts index fbef2aa8..4109872e 100644 --- a/dist/plugins/actionsheet.d.ts +++ b/dist/plugins/actionsheet.d.ts @@ -1,20 +1,38 @@ /** * The ActionSheet plugin shows a native list of options the user can choose from. + * + * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). + * + * @usage + * + * ``` + * import {ActionSheet} from 'ionic-native'; + * + * let buttonLabels = ['Share via Facebook', 'Share via Twitter']; + * ActionSheet.show({ + * 'title': 'What do you want with this image?', + * 'buttonLabels': buttonLabels, + * 'addCancelButtonWithLabel': 'Cancel', + * 'addDestructiveButtonWithLabel' : 'Delete' + * }).then(buttonIndex => { + * console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]); + * }); + * ``` + * */ export declare class ActionSheet { /** * Show the ActionSheet. - * @param {options} - * Available options: - * buttonLabels: string[] - * title: string - * androidTheme (Android only): number 1-5 - * androidEnableCancelButton (Android only): boolean, default false - * winphoneEnableCancelButton (WP only): boolean, default false - * addCancelButtonWithLabel: string - * addDestructiveButtonWithLabel: string - * position: [x, y] (iPad pass in [x, y] coords of popover) - * @returns {Promise} returns a promise that resolves with the index of the + * @param {options} options + * `buttonLabels`: string[] + * `title`: string + * `androidTheme` (Android only): number 1-5 + * `androidEnableCancelButton` (Android only): boolean, default false + * `winphoneEnableCancelButton` (WP only): boolean, default false + * `addCancelButtonWithLabel`: string + * `addDestructiveButtonWithLabel`: string + * `position`: [x, y] (iPad pass in [x, y] coords of popover) + * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ static show(options?: { diff --git a/dist/plugins/actionsheet.js b/dist/plugins/actionsheet.js index efc1c627..7595060a 100644 --- a/dist/plugins/actionsheet.js +++ b/dist/plugins/actionsheet.js @@ -7,23 +7,41 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var plugin_1 = require('./plugin'); /** * The ActionSheet plugin shows a native list of options the user can choose from. + * + * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). + * + * @usage + * + * ``` + * import {ActionSheet} from 'ionic-native'; + * + * let buttonLabels = ['Share via Facebook', 'Share via Twitter']; + * ActionSheet.show({ + * 'title': 'What do you want with this image?', + * 'buttonLabels': buttonLabels, + * 'addCancelButtonWithLabel': 'Cancel', + * 'addDestructiveButtonWithLabel' : 'Delete' + * }).then(buttonIndex => { + * console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]); + * }); + * ``` + * */ var ActionSheet = (function () { function ActionSheet() { } /** * Show the ActionSheet. - * @param {options} - * Available options: - * buttonLabels: string[] - * title: string - * androidTheme (Android only): number 1-5 - * androidEnableCancelButton (Android only): boolean, default false - * winphoneEnableCancelButton (WP only): boolean, default false - * addCancelButtonWithLabel: string - * addDestructiveButtonWithLabel: string - * position: [x, y] (iPad pass in [x, y] coords of popover) - * @returns {Promise} returns a promise that resolves with the index of the + * @param {options} options + * `buttonLabels`: string[] + * `title`: string + * `androidTheme` (Android only): number 1-5 + * `androidEnableCancelButton` (Android only): boolean, default false + * `winphoneEnableCancelButton` (WP only): boolean, default false + * `addCancelButtonWithLabel`: string + * `addDestructiveButtonWithLabel`: string + * `position`: [x, y] (iPad pass in [x, y] coords of popover) + * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ ActionSheet.show = function (options) { @@ -34,7 +52,6 @@ var ActionSheet = (function () { // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise(function (res, rej) { }); }; - ; /** * Hide the ActionSheet. */ @@ -46,7 +63,6 @@ var ActionSheet = (function () { // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise(function (res, rej) { }); }; - ; __decorate([ plugin_1.Cordova() ], ActionSheet, "show", null); diff --git a/dist/plugins/actionsheet.js.map b/dist/plugins/actionsheet.js.map index 4374bf18..32dfc1ee 100644 --- a/dist/plugins/actionsheet.js.map +++ b/dist/plugins/actionsheet.js.map @@ -1 +1 @@ -{"version":3,"file":"actionsheet.js","sourceRoot":"","sources":["../../src/plugins/actionsheet.ts"],"names":["ActionSheet","ActionSheet.constructor","ActionSheet.show","ActionSheet.hide"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;GAEG;AACH;IAAAA;IAuDAC,CAACA;IA/CCD;;;;;;;;;;;;;;OAcGA;IAEIA,gBAAIA,GADXA,UACYA,OASXA;QACCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;;IAGDF;;OAEGA;IAEIA,gBAAIA,GADXA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;;IA/BDH;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAgBVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAOVA;IAtDHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,qBAAqBA;YAChCA,IAAIA,EAAEA,8DAA8DA;SACrEA,CAACA;oBAkDDA;IAADA,kBAACA;AAADA,CAACA,AAvDD,IAuDC;AAjDY,mBAAW,cAiDvB,CAAA"} \ No newline at end of file +{"version":3,"file":"actionsheet.js","sourceRoot":"","sources":["../../src/plugins/actionsheet.ts"],"names":["ActionSheet","ActionSheet.constructor","ActionSheet.show","ActionSheet.hide"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAAAA;IAsDAC,CAACA;IA9CCD;;;;;;;;;;;;;OAaGA;IAEIA,gBAAIA,GADXA,UACYA,OASXA;QACCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAGDF;;OAEGA;IAEIA,gBAAIA,GADXA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IA/BDH;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAgBVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAOVA;IArDHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,qBAAqBA;YAChCA,IAAIA,EAAEA,8DAA8DA;SACrEA,CAACA;oBAiDDA;IAADA,kBAACA;AAADA,CAACA,AAtDD,IAsDC;AAhDY,mBAAW,cAgDvB,CAAA"} \ No newline at end of file diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index 3c85e64d..eaa5224c 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -2,6 +2,25 @@ import {Plugin, Cordova} from './plugin'; /** * The ActionSheet plugin shows a native list of options the user can choose from. + * + * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). + * + * @usage + * + * ``` + * import {ActionSheet} from 'ionic-native'; + * + * let buttonLabels = ['Share via Facebook', 'Share via Twitter']; + * ActionSheet.show({ + * 'title': 'What do you want with this image?', + * 'buttonLabels': buttonLabels, + * 'addCancelButtonWithLabel': 'Cancel', + * 'addDestructiveButtonWithLabel' : 'Delete' + * }).then(buttonIndex => { + * console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]); + * }); + * ``` + * */ @Plugin({ name: 'ActionSheet', @@ -13,17 +32,16 @@ export class ActionSheet { /** * Show the ActionSheet. - * @param {options} - * Available options: - * buttonLabels: string[] - * title: string - * androidTheme (Android only): number 1-5 - * androidEnableCancelButton (Android only): boolean, default false - * winphoneEnableCancelButton (WP only): boolean, default false - * addCancelButtonWithLabel: string - * addDestructiveButtonWithLabel: string - * position: [x, y] (iPad pass in [x, y] coords of popover) - * @returns {Promise} returns a promise that resolves with the index of the + * @param {options} options + * `buttonLabels`: string[] + * `title`: string + * `androidTheme` (Android only): number 1-5 + * `androidEnableCancelButton` (Android only): boolean, default false + * `winphoneEnableCancelButton` (WP only): boolean, default false + * `addCancelButtonWithLabel`: string + * `addDestructiveButtonWithLabel`: string + * `position`: [x, y] (iPad pass in [x, y] coords of popover) + * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ @Cordova() @@ -43,7 +61,7 @@ export class ActionSheet { // for it to know the return type from a decorator. // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise((res, rej) => {}); - }; + } /** @@ -57,5 +75,5 @@ export class ActionSheet { // for it to know the return type from a decorator. // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise((res, rej) => {}); - }; + } }