chore(): remove unnecessary name option from Plugin decorator

At least for now, we get the name of the plugin from the class.
This commit is contained in:
Tim Lancina 2016-03-04 14:04:38 -06:00
parent fc54fefde5
commit 5ad72de3d3
18 changed files with 2 additions and 23 deletions

View File

@ -9,7 +9,6 @@ Let's take a look at the existing plugin wrapper for Geolocation to see what goe
``` ```
@Plugin({ @Plugin({
name: 'Geolocation',
plugin: 'cordova-plugin-geolocation', plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation' pluginRef: 'navigator.geolocation'
}) })
@ -49,7 +48,6 @@ For example, the `@Plugin` decorator adds information about the plugin to our Ge
``` ```
@Plugin({ @Plugin({
name: 'Geolocation',
plugin: 'cordova-plugin-geolocation', plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation' pluginRef: 'navigator.geolocation'
}) })
@ -58,9 +56,7 @@ export class Geolocation {
} }
``` ```
Here, `name` refers to the name of the plugin, which is used by Ionic Native for logging messages. Here, `plugin` is the name of the plugin package on npm and used when calling `cordova plugin add`.
`plugin` is the name of the plugin package on npm and used when calling `cordova plugin add`, also used for logging purposes.
`pluginRef` refers to the where on `window` the underlying Cordova plugin is normally exposed. For example, in the case of the Cordova Geolocation plugin, normally you would make calls like `window.navigator.geolocation.getCurrentPosition({}, success, error)`, so the `pluginRef` in this case is `navigator.geolocation`. `pluginRef` refers to the where on `window` the underlying Cordova plugin is normally exposed. For example, in the case of the Cordova Geolocation plugin, normally you would make calls like `window.navigator.geolocation.getCurrentPosition({}, success, error)`, so the `pluginRef` in this case is `navigator.geolocation`.

View File

@ -25,7 +25,6 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
name: 'ActionSheet',
plugin: 'cordova-plugin-actionsheet', plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet', pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet' repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet'
@ -46,7 +45,7 @@ export class ActionSheet {
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text | * | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
* | position |`number[]` | On an iPad, set the X,Y position | * | position |`number[]` | On an iPad, set the X,Y position |
* *
* @param {options} Options See table above * @param {options} Options See table above
* @returns {Promise} Returns a Promise that resolves with the index of the * @returns {Promise} Returns a Promise that resolves with the index of the
* button pressed (1 based, so 1, 2, 3, etc.) * button pressed (1 based, so 1, 2, 3, etc.)
*/ */

View File

@ -21,7 +21,6 @@ declare var window;
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'AppRate',
plugin: 'cordova-plugin-apprate', plugin: 'cordova-plugin-apprate',
pluginRef: 'AppRate' pluginRef: 'AppRate'
}) })

View File

@ -18,7 +18,6 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'AppVersion',
plugin: 'cordova-plugin-appversion', plugin: 'cordova-plugin-appversion',
pluginRef: 'cordova.getAppVersion' pluginRef: 'cordova.getAppVersion'
}) })

View File

@ -17,7 +17,6 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'Badge',
plugin: 'cordova-plugin-badge', plugin: 'cordova-plugin-badge',
pluginRef: 'cordova.plugins.notification.badge' pluginRef: 'cordova.plugins.notification.badge'
}) })

View File

@ -17,7 +17,6 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'BarcodeScanner',
plugin: 'phonegap-plugin-barcodescanner', plugin: 'phonegap-plugin-barcodescanner',
pluginRef: 'cordova.plugins.barcodeScanner', pluginRef: 'cordova.plugins.barcodeScanner',
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner' repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner'

View File

@ -160,7 +160,6 @@ import {Observable} from 'rxjs/Observable';
* *
*/ */
@Plugin({ @Plugin({
name: 'BLE',
plugin: 'cordova-plugin-ble-central', plugin: 'cordova-plugin-ble-central',
pluginRef: 'ble', pluginRef: 'ble',
repo: 'https://github.com/don/cordova-plugin-ble-central' repo: 'https://github.com/don/cordova-plugin-ble-central'

View File

@ -25,7 +25,6 @@ export interface Calendar {
* *
*/ */
@Plugin({ @Plugin({
name: 'Calendar',
plugin: 'cordova-plugin-calendar', plugin: 'cordova-plugin-calendar',
pluginRef: 'plugins.calendar', pluginRef: 'plugins.calendar',
repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin' repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin'

View File

@ -102,7 +102,6 @@ export interface CameraPopoverOptions {
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'Camera',
plugin: 'cordova-plugin-camera', plugin: 'cordova-plugin-camera',
pluginRef: 'navigator.camera', pluginRef: 'navigator.camera',
repo: 'https://github.com/apache/cordova-plugin-camera' repo: 'https://github.com/apache/cordova-plugin-camera'

View File

@ -25,7 +25,6 @@ import {Plugin, Cordova} from './plugin';
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'Clipboard',
plugin: 'com.verso.cordova.clipboard', plugin: 'com.verso.cordova.clipboard',
pluginRef: 'cordova.plugins.clipboard' pluginRef: 'cordova.plugins.clipboard'
}) })

View File

@ -207,7 +207,6 @@ declare var Contact: {
* *
*/ */
@Plugin({ @Plugin({
name: 'Contacts',
plugin: 'cordova-plugin-contacts', plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts', pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts' repo: 'https://github.com/apache/cordova-plugin-contacts'

View File

@ -19,7 +19,6 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
name: 'DatePicker',
plugin: 'cordova-plugin-datepicker', plugin: 'cordova-plugin-datepicker',
pluginRef: 'plugins.datePicker' pluginRef: 'plugins.datePicker'
}) })

View File

@ -70,7 +70,6 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
name: 'Facebook',
plugin: 'cordova-plugin-facebook4', plugin: 'cordova-plugin-facebook4',
pluginRef: 'facebookConnectPlugin', pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4' repo: 'https://github.com/jeduan/cordova-plugin-facebook4'

View File

@ -115,7 +115,6 @@ export interface GeolocationOptions {
* ``` * ```
*/ */
@Plugin({ @Plugin({
name: 'Geolocation',
plugin: 'cordova-plugin-geolocation', plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation' pluginRef: 'navigator.geolocation'
}) })

View File

@ -256,7 +256,6 @@ declare var PushNotification: {
* 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). * 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).
*/ */
@Plugin({ @Plugin({
name: 'Push',
plugin: 'phonegap-plugin-push', plugin: 'phonegap-plugin-push',
pluginRef: 'PushNotification', pluginRef: 'PushNotification',
repo: 'https://github.com/phonegap/phonegap-plugin-push' repo: 'https://github.com/phonegap/phonegap-plugin-push'

View File

@ -9,7 +9,6 @@ declare var window;
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar). * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
*/ */
@Plugin({ @Plugin({
name: 'StatusBar',
plugin: 'cordova-plugin-statusbar', plugin: 'cordova-plugin-statusbar',
pluginRef: 'StatusBar', pluginRef: 'StatusBar',
repo: 'https://github.com/apache/cordova-plugin-statusbar' repo: 'https://github.com/apache/cordova-plugin-statusbar'

View File

@ -13,7 +13,6 @@ export interface ToastOptions {
* Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin). * Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin).
*/ */
@Plugin({ @Plugin({
name: 'Toast',
plugin: 'cordova-plugin-x-toast', plugin: 'cordova-plugin-x-toast',
pluginRef: 'plugins.toast', pluginRef: 'plugins.toast',
repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin' repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin'

View File

@ -22,7 +22,6 @@ import {Plugin, Cordova} from './plugin';
* *
*/ */
@Plugin({ @Plugin({
name: 'TouchID',
plugin: 'cordova-plugin-touch-id', plugin: 'cordova-plugin-touch-id',
pluginRef: 'plugins.touchid', pluginRef: 'plugins.touchid',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-touch-id' repo: 'https://github.com/EddyVerbruggen/cordova-plugin-touch-id'