mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore(): new plugin cleanup
This commit is contained in:
+39
-16
@@ -3,10 +3,10 @@ import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* 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
|
||||
@@ -18,41 +18,64 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-appversion',
|
||||
plugin: 'cordova-plugin-app-version',
|
||||
pluginRef: 'cordova.getAppVersion'
|
||||
})
|
||||
export class AppVersion {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise}
|
||||
*/
|
||||
@Cordova
|
||||
static getAppName () : string {
|
||||
return;
|
||||
@Cordova()
|
||||
static getAppName () {
|
||||
// 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 {Promise}
|
||||
*/
|
||||
@Cordova
|
||||
static getPackageName () : string {
|
||||
return;
|
||||
@Cordova()
|
||||
static getPackageName () {
|
||||
// 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 {Promise}
|
||||
*/
|
||||
@Cordova
|
||||
static getVersionCode () : string {
|
||||
return;
|
||||
@Cordova()
|
||||
static getVersionCode () {
|
||||
// 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 {Promise}
|
||||
*/
|
||||
@Cordova
|
||||
static getVersionNumber () : string {
|
||||
return;
|
||||
@Cordova()
|
||||
static getVersionNumber() {
|
||||
// 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) => {});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user