docs(actionsheet): update

This commit is contained in:
Tim Lancina 2016-02-18 12:01:27 -06:00
parent 7985cf03a6
commit 8562195533
4 changed files with 90 additions and 38 deletions

View File

@ -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?: {

View File

@ -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);

View File

@ -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"}
{"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"}

View File

@ -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<any>((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<any>((res, rej) => {});
};
}
}