diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index c9f64ffec..205db5830 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -7,8 +7,11 @@ import {Plugin, Cordova} from './plugin'; * * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet). * - * @usage + * ```shell + * cordova plugin add cordova-plugin-actionsheet + * ``` * + * @usage * ```ts * import {ActionSheet} from 'ionic-native'; * diff --git a/src/plugins/appavailability.ts b/src/plugins/appavailability.ts index f83277966..453f8b8d0 100644 --- a/src/plugins/appavailability.ts +++ b/src/plugins/appavailability.ts @@ -1,12 +1,14 @@ import {Plugin, Cordova} from './plugin'; /** + * @name AppAvailability + * @description * This plugin allows you to check if an app is installed on the user's device. It requires an URI Scheme (e.g. twitter://) on iOS or a Package Name (e.g com.twitter.android) on Android. * * Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability). * * ``` - * cordova plugin add https://github.com/ohh2ahh/AppAvailability.git + * cordova plugin add cordova-plugin-appavailability * ``` * * @usage @@ -27,7 +29,7 @@ import {Plugin, Cordova} from './plugin'; * ``` */ @Plugin({ - plugin: 'https://github.com/ohh2ahh/AppAvailability.git', + plugin: 'cordova-plugin-appavailability', pluginRef: 'appAvailability' }) export class AppAvailability { diff --git a/src/plugins/apprate.ts b/src/plugins/apprate.ts index e82ff5e47..5b56fac79 100644 --- a/src/plugins/apprate.ts +++ b/src/plugins/apprate.ts @@ -3,12 +3,14 @@ import {Plugin, Cordova, CordovaProperty} from './plugin'; declare var window; /** + * @name AppRate + * @description * The AppRate plugin makes it easy to prompt the user to rate your app, either now, later, or never. * * Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the [AppRate plugin docs](https://github.com/pushandplay/cordova-plugin-apprate). * - * ``` - * cordova plugin add https://github.com/pushandplay/cordova-plugin-apprate.git + * ```shell + * cordova plugin add cordova-plugin-apprate * ```` * * @usage @@ -21,8 +23,9 @@ declare var window; * ``` */ @Plugin({ - plugin: 'https://github.com/pushandplay/cordova-plugin-apprate.git', - pluginRef: 'AppRate' + plugin: 'cordova-plugin-apprate', + pluginRef: 'AppRate', + repo: 'https://github.com/pushandplay/cordova-plugin-apprate' }) export class AppRate { diff --git a/src/plugins/appversion.ts b/src/plugins/appversion.ts index 829021d68..d7c09be69 100644 --- a/src/plugins/appversion.ts +++ b/src/plugins/appversion.ts @@ -1,11 +1,13 @@ import {Plugin, Cordova} from './plugin'; /** + * @name AppVersion + * @description * Reads the version of your app from the target build settings. * * Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](https://github.com/whiteoctober/cordova-plugin-app-version). * - * ``` + * ```shell * cordova plugin add cordova-plugin-app-version * ```` * diff --git a/src/plugins/badge.ts b/src/plugins/badge.ts index de7f9fa76..010df3d26 100644 --- a/src/plugins/badge.ts +++ b/src/plugins/badge.ts @@ -1,11 +1,13 @@ import {Plugin, Cordova} from './plugin'; /** + * @name Badge + * @description * The essential purpose of badge numbers is to enable an application to inform its users that it has something for them — for example, unread messages — when the application isn’t running in the foreground. * * Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge). * - * ``` + * ```shell * cordova plugin add cordova-plugin-badge * ``` * diff --git a/src/plugins/barcodescanner.ts b/src/plugins/barcodescanner.ts index 635373003..e0585df4b 100644 --- a/src/plugins/barcodescanner.ts +++ b/src/plugins/barcodescanner.ts @@ -7,6 +7,10 @@ import {Plugin, Cordova} from './plugin'; * * Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). * + * ```shell + * cordova plugin add phonegap-plugin-barcodescanner + * ``` + * * @usage * ```js * BarcodeScanner.scan().then((barcodeData) => { diff --git a/src/plugins/batterystatus.ts b/src/plugins/batterystatus.ts index 510eed59c..a8eb62fa4 100644 --- a/src/plugins/batterystatus.ts +++ b/src/plugins/batterystatus.ts @@ -3,10 +3,10 @@ import {Observable} from "rxjs/Observable"; /** * @name Battery Status - * + * @description * Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status). * - * ``` + * ```shell * cordova plugin add cordova-plugin-batterystatus * ``` * diff --git a/src/plugins/calendar.ts b/src/plugins/calendar.ts index c581c9636..e0a906694 100644 --- a/src/plugins/calendar.ts +++ b/src/plugins/calendar.ts @@ -23,6 +23,11 @@ export interface Calendar { * * Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin). * + * ```shell + * cordova plugin add cordova-plugin-calendar + * ``` + * + * */ @Plugin({ plugin: 'cordova-plugin-calendar', diff --git a/src/plugins/camera.ts b/src/plugins/camera.ts index 29dc1059b..a6812c15c 100644 --- a/src/plugins/camera.ts +++ b/src/plugins/camera.ts @@ -91,6 +91,10 @@ export interface CameraPopoverOptions { * * Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). * + * ```shell + * cordova plugin add cordova-plugin-camera + * ``` + * * @usage * ```js * Camera.getPicture(options).then((imageData) => { diff --git a/src/plugins/clipboard.ts b/src/plugins/clipboard.ts index a66902717..d52c59990 100644 --- a/src/plugins/clipboard.ts +++ b/src/plugins/clipboard.ts @@ -1,12 +1,14 @@ import {Plugin, Cordova} from './plugin'; /** + * @name Clipboard + * @description * Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8. * * Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard * For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git). * - * ``` + * ```shell * cordova plugin add https://github.com/VersoSolutions/CordovaClipboard.git * ``` * diff --git a/src/plugins/datepicker.ts b/src/plugins/datepicker.ts index 3e9bd91ea..51b883a91 100644 --- a/src/plugins/datepicker.ts +++ b/src/plugins/datepicker.ts @@ -64,6 +64,8 @@ export interface datePickerOptions { } /** + * @name DatePicker + * @description * The DatePicker plugin allows the user to fetch date or time using native dialogs. * * Platforms supported: iOS, Android, Windows @@ -72,7 +74,7 @@ export interface datePickerOptions { * * Install the plugin by running the following command: * ```shell - * cordova plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git + * cordova plugin add cordova-plugin-datepicker * ``` * * @usage @@ -88,7 +90,7 @@ export interface datePickerOptions { * */ @Plugin({ - plugin: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git', + plugin: 'cordova-plugin-datepicker', pluginRef: 'datePicker' }) export class DatePicker { diff --git a/src/plugins/device.ts b/src/plugins/device.ts index c1b9f7a6c..f83a48f12 100644 --- a/src/plugins/device.ts +++ b/src/plugins/device.ts @@ -31,6 +31,10 @@ export interface Device { * @description * Access information about the underlying device and platform. * + * ```shell + * cordova plugin add cordova-plugin-device + * ``` + * * @usage * ```js * let info = Device.getDevice(); diff --git a/src/plugins/devicemotion.ts b/src/plugins/devicemotion.ts index 69795f420..ac117e76b 100644 --- a/src/plugins/devicemotion.ts +++ b/src/plugins/devicemotion.ts @@ -35,10 +35,12 @@ export interface accelerometerOptions { } /** + * @name DeviceMotion + * @description * Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion). * * ```shell - * cordova plugin add https://github.com/apache/cordova-plugin-device-motion.git + * cordova plugin add cordova-plugin-device-motion * ```` * * @usage @@ -61,8 +63,9 @@ export interface accelerometerOptions { * ``` */ @Plugin({ - plugin: 'https://github.com/apache/cordova-plugin-device-motion.git', - pluginRef: 'navigator.accelerometer' + plugin: 'cordova-plugin-device-motion', + pluginRef: 'navigator.accelerometer', + repo: 'https://github.com/apache/cordova-plugin-device-motion' }) export class DeviceMotion { diff --git a/src/plugins/deviceorientation.ts b/src/plugins/deviceorientation.ts index c11d16ba9..07226cb23 100644 --- a/src/plugins/deviceorientation.ts +++ b/src/plugins/deviceorientation.ts @@ -40,10 +40,12 @@ export interface CompassOptions { } /** + * @name DeviceOrientation + * @description * Requires Cordova plugin: `cordova-plugin-device-orientation`. For more info, please see the [Device Orientation docs](https://github.com/apache/cordova-plugin-device-orientation). * - * ``` - * cordova plugin add https://github.com/apache/cordova-plugin-device-orientation.git + * ```shell + * cordova plugin add cordova-plugin-device-orientation * ```` * * @usage @@ -64,8 +66,9 @@ export interface CompassOptions { * ``` */ @Plugin({ - plugin: 'https://github.com/apache/cordova-plugin-device-orientation', - pluginRef: 'navigator.compass' + plugin: 'cordova-plugin-device-orientation', + pluginRef: 'navigator.compass', + repo: 'https://github.com/apache/cordova-plugin-device-orientation' }) export class DeviceOrientation { diff --git a/src/plugins/dialogs.ts b/src/plugins/dialogs.ts index 0395295a0..b3674fa32 100644 --- a/src/plugins/dialogs.ts +++ b/src/plugins/dialogs.ts @@ -18,16 +18,22 @@ export interface promptCallback { /** * @name Dialogs * @description + * This plugin gives you ability to access and customize the device native dialogs. * * Requires Cordova plugin: `cordova-plugin-dialogs`. For more info, please see the [Dialogs plugin docs](https://github.com/apache/cordova-plugin-dialogs). * + * ```shell + * cordova plugin add cordova-plugin-dialogs + * ``` + * * @usage * ```js * ``` */ @Plugin({ - plugin: 'https://github.com/apache/cordova-plugin-dialogs.git', - pluginRef: 'navigator.notification' + plugin: 'cordova-plugin-dialogs', + pluginRef: 'navigator.notification', + repo: 'https://github.com/apache/cordova-plugin-dialogs.git' }) export class Dialogs { diff --git a/src/plugins/flashlight.ts b/src/plugins/flashlight.ts index 9a0ffa3c1..c2f925ac0 100644 --- a/src/plugins/flashlight.ts +++ b/src/plugins/flashlight.ts @@ -6,13 +6,18 @@ import {Plugin, Cordova} from './plugin'; * * Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin). * + * ```shell + * cordova plugin add cordova-plugin-flashlight + * ``` + * * @usage * ```js * ``` */ @Plugin({ - plugin: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git', - pluginRef: 'window.plugins.flashlight' + plugin: 'cordova-plugin-flashlight', + pluginRef: 'window.plugins.flashlight', + repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git' }) export class Flashlight { diff --git a/src/plugins/geolocation.ts b/src/plugins/geolocation.ts index 1c8d02d96..1251a0504 100644 --- a/src/plugins/geolocation.ts +++ b/src/plugins/geolocation.ts @@ -99,6 +99,10 @@ export interface GeolocationOptions { * * This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation. * + * ```shell + * cordova plugin add cordova-plugin-geolocation + * ``` + * * @usage * * ```ts diff --git a/src/plugins/imagepicker.ts b/src/plugins/imagepicker.ts index c7c108149..3fd2f3526 100644 --- a/src/plugins/imagepicker.ts +++ b/src/plugins/imagepicker.ts @@ -25,6 +25,10 @@ export interface ImagePickerOptions { * Requires Cordova plugin: `cordova-plugin-image-picker`. * For more info, please see the https://github.com/wymsee/cordova-imagePicker * + * ```shell + * cordova plugin add cordova-plugin-image-picker + * ``` + * * @usage * ```js * ImagePicker.getPictures(options).then((results) => { diff --git a/src/plugins/launchnavigator.ts b/src/plugins/launchnavigator.ts index eebc55bd4..0d2af1a39 100644 --- a/src/plugins/launchnavigator.ts +++ b/src/plugins/launchnavigator.ts @@ -47,11 +47,12 @@ export interface launchNavigatorOptions { } /** - * + * @name LaunchNavigator + * @description * Requires Cordova plugin: uk.co.workingedge.phonegap.plugin.launchnavigator. For more info, please see the [LaunchNavigator plugin docs](https://github.com/dpa99c/phonegap-launch-navigator). * - * ``` - * cordova plugin add https://github.com/dpa99c/phonegap-launch-navigator.git + * ```shell + * cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator * ``` * * @usage @@ -64,8 +65,9 @@ export interface launchNavigatorOptions { * ``` */ @Plugin({ - plugin: 'https://github.com/dpa99c/phonegap-launch-navigator.git', - pluginRef: 'launchnavigator' + plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator', + pluginRef: 'launchnavigator', + repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git' }) export class LaunchNavigator { diff --git a/src/plugins/localnotifications.ts b/src/plugins/localnotifications.ts index 13643116a..3e269fef9 100644 --- a/src/plugins/localnotifications.ts +++ b/src/plugins/localnotifications.ts @@ -1,8 +1,14 @@ import {Plugin, Cordova} from './plugin'; /** * @name Local Notifications + * @description + * This plugin allows you to display local notifications on the device * - * Usage: + * ```shell + * cordova plugin add cordova-plugin-local-notifications + * ``` + * + * @usage * ```ts * // Schedule a single notification * LocalNotifications.schedule({ diff --git a/src/plugins/plugin.ts b/src/plugins/plugin.ts index 3459cdc63..6756e23db 100644 --- a/src/plugins/plugin.ts +++ b/src/plugins/plugin.ts @@ -134,6 +134,20 @@ export const wrap = function(pluginObj:any, methodName:string, opts:any = {}) { /** * Class decorator specifying Plugin metadata. Required for all plugins. + * + * @usage + * ```ts + * @Plugin({ + * name: 'MyPlugin', + * plugin: 'cordova-plugin-myplugin', + * pluginRef: 'window.myplugin' + * }) + * export class MyPlugin { + * + * // Plugin wrappers, properties, and functions go here ... + * + * } + * ``` */ export function Plugin(config) { return function(cls) { diff --git a/src/plugins/push.ts b/src/plugins/push.ts index 920bf7119..29222a42d 100644 --- a/src/plugins/push.ts +++ b/src/plugins/push.ts @@ -252,6 +252,9 @@ declare var PushNotification: { * * Requires Cordova plugin: `phonegap-plugin-push`. For more info, please see the [Push plugin docs](https://github.com/phonegap/phonegap-plugin-push). * + * ```shell + * cordova plugin add phonegap-plugin-push + * ``` * * For TypeScript users, see the [Push plugin docs about using TypeScript for custom notifications](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md). */ diff --git a/src/plugins/sms.ts b/src/plugins/sms.ts index e33796ed2..c47332b46 100644 --- a/src/plugins/sms.ts +++ b/src/plugins/sms.ts @@ -21,17 +21,20 @@ export interface smsOptionsAndroid { } /** - * + * @name SMS + * @description * * Requires Cordova plugin: cordova-plugin-sms. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin). * - * ``` + * ```shell * cordova plugin add https://github.com/cordova-sms/cordova-sms-plugin.git * ``` * * @usage - * ```js + * ```ts * + * // Send a text message using default options + * SMS.send('6476245170','Hello world!'); * * ``` */ diff --git a/src/plugins/statusbar.ts b/src/plugins/statusbar.ts index bb938ec43..2dace01f2 100644 --- a/src/plugins/statusbar.ts +++ b/src/plugins/statusbar.ts @@ -3,10 +3,23 @@ import {Plugin, Cordova, CordovaProperty} from './plugin'; declare var window; /** - * + * @name StatusBar + * @description * Manage the appearance of the native status bar. * * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar). + * + * ```shell + * cordova plugin add cordova-plugin-statusbar + * ``` + * + * @usage + * ```ts + * StatuBar.overlaysWebView(true); + * + * StatusBar.styleDefault(); + * ``` + * */ @Plugin({ plugin: 'cordova-plugin-statusbar', diff --git a/src/plugins/toast.ts b/src/plugins/toast.ts index a64443498..494e264d6 100644 --- a/src/plugins/toast.ts +++ b/src/plugins/toast.ts @@ -8,9 +8,24 @@ export interface ToastOptions { addPixelsY?: number; } /** + * @name Toast + * @description * This plugin allows you to show a native Toast (a little text popup) on iOS, Android and WP8. It's great for showing a non intrusive native notification which is guaranteed always in the viewport of the browser. * * Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin). + * + * ```shell + * cordova plugin add cordova-plugin-x-toast + * ``` + * + * @usage + * ```ts + * Toast.show("I'm a toast", 5000, "center").subscribe( + * toast => { + * console.log(toast); + * } + * ); + * ``` */ @Plugin({ plugin: 'cordova-plugin-x-toast',