mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-21 17:36:27 +08:00
chore(): new plugin cleanup
This commit is contained in:
parent
5ad72de3d3
commit
98fbe6c7ce
22
src/index.ts
22
src/index.ts
@ -7,12 +7,16 @@ const DEVICE_READY_TIMEOUT = 2000;
|
|||||||
declare var window;
|
declare var window;
|
||||||
|
|
||||||
import {ActionSheet} from './plugins/actionsheet';
|
import {ActionSheet} from './plugins/actionsheet';
|
||||||
|
import {AppRate} from './plugins/apprate';
|
||||||
|
import {AppVersion} from './plugins/appversion';
|
||||||
import {BarcodeScanner} from './plugins/barcodescanner';
|
import {BarcodeScanner} from './plugins/barcodescanner';
|
||||||
|
import {Badge} from './plugins/badge';
|
||||||
import {BLE} from './plugins/ble';
|
import {BLE} from './plugins/ble';
|
||||||
import {Camera} from './plugins/camera';
|
import {Camera} from './plugins/camera';
|
||||||
import {Calendar} from './plugins/calendar';
|
import {Calendar} from './plugins/calendar';
|
||||||
import {Clipboard} from './plugins/clipboard';
|
import {Clipboard} from './plugins/clipboard';
|
||||||
import {Contacts} from './plugins/contacts';
|
import {Contacts} from './plugins/contacts';
|
||||||
|
import {DatePicker} from './plugins/datepicker';
|
||||||
import {Device} from './plugins/device';
|
import {Device} from './plugins/device';
|
||||||
import {Facebook} from './plugins/facebook';
|
import {Facebook} from './plugins/facebook';
|
||||||
import {Geolocation} from './plugins/geolocation';
|
import {Geolocation} from './plugins/geolocation';
|
||||||
@ -20,42 +24,48 @@ import {Push} from './plugins/push';
|
|||||||
import {StatusBar} from './plugins/statusbar';
|
import {StatusBar} from './plugins/statusbar';
|
||||||
import {Toast} from './plugins/toast';
|
import {Toast} from './plugins/toast';
|
||||||
import {TouchID} from './plugins/touchid';
|
import {TouchID} from './plugins/touchid';
|
||||||
import {DatePicker} from './plugins/datepicker';
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ActionSheet,
|
ActionSheet,
|
||||||
|
AppRate,
|
||||||
|
AppVersion,
|
||||||
BarcodeScanner,
|
BarcodeScanner,
|
||||||
|
Badge,
|
||||||
BLE,
|
BLE,
|
||||||
Camera,
|
Camera,
|
||||||
Calendar,
|
Calendar,
|
||||||
Clipboard,
|
Clipboard,
|
||||||
Contacts,
|
Contacts,
|
||||||
|
DatePicker,
|
||||||
Device,
|
Device,
|
||||||
Facebook,
|
Facebook,
|
||||||
Geolocation,
|
Geolocation,
|
||||||
Push,
|
Push,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
Toast,
|
Toast,
|
||||||
TouchID,
|
TouchID
|
||||||
DatePicker
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window export to use outside of a module loading system
|
// Window export to use outside of a module loading system
|
||||||
window['IonicNative'] = {
|
window['IonicNative'] = {
|
||||||
ActionSheet: ActionSheet,
|
ActionSheet: ActionSheet,
|
||||||
BarcodeScanner,
|
AppRate: AppRate,
|
||||||
|
AppVersion: AppVersion,
|
||||||
|
BarcodeScanner: BarcodeScanner,
|
||||||
|
Badge: Badge,
|
||||||
BLE: BLE,
|
BLE: BLE,
|
||||||
Camera: Camera,
|
Camera: Camera,
|
||||||
Calendar: Calendar,
|
Calendar: Calendar,
|
||||||
|
Clipboard: Clipboard,
|
||||||
Contacts: Contacts,
|
Contacts: Contacts,
|
||||||
|
DatePicker: DatePicker,
|
||||||
Device: Device,
|
Device: Device,
|
||||||
Facebook: Facebook,
|
Facebook: Facebook,
|
||||||
Geolocation: Geolocation,
|
Geolocation: Geolocation,
|
||||||
Push: Push,
|
Push: Push,
|
||||||
StatusBar: StatusBar,
|
StatusBar: StatusBar,
|
||||||
Toast: Toast,
|
Toast: Toast,
|
||||||
TouchID: TouchID,
|
TouchID: TouchID
|
||||||
DatePicker: DatePicker
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// To help developers using cordova, we listen for the device ready event and
|
// To help developers using cordova, we listen for the device ready event and
|
||||||
|
@ -5,10 +5,10 @@ declare var window;
|
|||||||
/**
|
/**
|
||||||
* The AppRate plugin makes it easy to prompt the user to rate your app, either now, later, or never.
|
* 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 [cordova-plugin-apprate docs](https://github.com/pushandplay/cordova-plugin-apprate).
|
* Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the [AppRate plugin docs](https://github.com/pushandplay/cordova-plugin-apprate).
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* ionic plugin add https://github.com/pushandplay/cordova-plugin-apprate.git
|
* cordova plugin add https://github.com/pushandplay/cordova-plugin-apprate.git
|
||||||
* ````
|
* ````
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
@ -17,11 +17,11 @@ declare var window;
|
|||||||
* AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
|
* AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
|
||||||
* AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/';
|
* AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/';
|
||||||
* AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name=<the Package Family Name of the application>';
|
* AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name=<the Package Family Name of the application>';
|
||||||
* AppRate.prompt();
|
* AppRate.promptForRating();
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-apprate',
|
plugin: 'https://github.com/pushandplay/cordova-plugin-apprate.git',
|
||||||
pluginRef: 'AppRate'
|
pluginRef: 'AppRate'
|
||||||
})
|
})
|
||||||
export class AppRate {
|
export class AppRate {
|
||||||
@ -51,8 +51,10 @@ export class AppRate {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompts the user for rating
|
* Prompts the user for rating
|
||||||
|
*
|
||||||
|
* @param {boolean} immediately Show the rating prompt immediately.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static prompt () : void {};
|
static promptForRating(immediately: boolean) : void {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
/**
|
/**
|
||||||
* Reads the version of your app from the target build settings.
|
* Reads the version of your app from the target build settings.
|
||||||
*
|
*
|
||||||
* Requires Cordova plugin: cordova-plugin-appversion. For more info, please see the [cordova-plugin-version docs](ttps://github.com/whiteoctober/cordova-plugin-app-version).
|
* Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](ttps://github.com/whiteoctober/cordova-plugin-app-version).
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* ionic plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git
|
* cordova plugin add cordova-plugin-app-version
|
||||||
* ````
|
* ````
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
@ -18,41 +18,64 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-appversion',
|
plugin: 'cordova-plugin-app-version',
|
||||||
pluginRef: 'cordova.getAppVersion'
|
pluginRef: 'cordova.getAppVersion'
|
||||||
})
|
})
|
||||||
export class AppVersion {
|
export class AppVersion {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the app
|
* Returns the name of the app
|
||||||
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
@Cordova
|
@Cordova()
|
||||||
static getAppName () : string {
|
static getAppName () {
|
||||||
return;
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the package name of the app
|
* Returns the package name of the app
|
||||||
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
@Cordova
|
@Cordova()
|
||||||
static getPackageName () : string {
|
static getPackageName () {
|
||||||
return;
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the build identifier of the app
|
* Returns the build identifier of the app
|
||||||
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
@Cordova
|
@Cordova()
|
||||||
static getVersionCode () : string {
|
static getVersionCode () {
|
||||||
return;
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the version of the app
|
* Returns the version of the app
|
||||||
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
@Cordova
|
@Cordova()
|
||||||
static getVersionNumber () : string {
|
static getVersionNumber() {
|
||||||
return;
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,17 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
/**
|
/**
|
||||||
* 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.
|
* 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 [cordova-plugin-badge docs](https://github.com/katzer/cordova-plugin-badge).
|
* Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge).
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* ionic plugin add https://github.com/katzer/cordova-plugin-badge.git
|
* cordova plugin add cordova-plugin-badge
|
||||||
* ````
|
* ```
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```js
|
* ```js
|
||||||
* Badge.setBadge(10);
|
* Badge.set(10);
|
||||||
* Badge.increaseBadge();
|
* Badge.increase();
|
||||||
* Badge.clearBadge();
|
* Badge.clear();
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
@ -23,45 +23,101 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
export class Badge {
|
export class Badge {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine permission to set badge notifications
|
* Clear the badge of the app icon.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static hasPermission () : boolean {
|
static clear() {
|
||||||
return;
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<boolean>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the badge of the app icon.
|
||||||
|
* @param {number} number The new badge number.
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static set(number: number) {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the badge of the app icon.
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static get() {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increase the badge number.
|
||||||
|
* @param {number} count Count to add to the current badge number
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static increase(number: number) {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrease the badge number.
|
||||||
|
* @param {number} count Count to subtract from the current badge number
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static decrease(number: number) {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the app has permission to show badges.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static hasPermission() {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<boolean>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register permission to set badge notifications
|
* Register permission to set badge notifications
|
||||||
* @returns {Promise<T>}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static registerPermission () : Promise<any> {
|
static registerPermission() {
|
||||||
return new Promise((res,rej) => {});
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<any>((res, rej) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the badge number
|
|
||||||
* @param number
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
static setBadge (number : number) : void {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears the badge number
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
static clearBadge () : void {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Increases the badge number
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
static increaseBadge () : void {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decreases the badge number
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
static decreaseBadge () : void {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,10 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
* Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.
|
* Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.
|
||||||
*
|
*
|
||||||
* Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard
|
* Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard
|
||||||
|
* For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git).
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* ionic plugin add https://github.com/VersoSolutions/CordovaClipboard.git
|
* cordova plugin add https://github.com/VersoSolutions/CordovaClipboard.git
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
@ -25,7 +26,7 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'com.verso.cordova.clipboard',
|
plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git',
|
||||||
pluginRef: 'cordova.plugins.clipboard'
|
pluginRef: 'cordova.plugins.clipboard'
|
||||||
})
|
})
|
||||||
export class Clipboard {
|
export class Clipboard {
|
||||||
|
@ -29,7 +29,7 @@ export class DatePicker {
|
|||||||
* @param options
|
* @param options
|
||||||
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
|
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
|
||||||
*/
|
*/
|
||||||
@Cordova
|
@Cordova()
|
||||||
static show(options? : {
|
static show(options? : {
|
||||||
mode : string,
|
mode : string,
|
||||||
date : string,
|
date : string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user