awesome-cordova-plugins/src/plugins/appversion.ts

56 lines
1.2 KiB
TypeScript
Raw Normal View History

2016-02-17 17:25:03 +08:00
import {Plugin, Cordova} from './plugin';
/**
* @name AppVersion
* @description
2016-02-17 17:25:03 +08:00
* Reads the version of your app from the target build settings.
*
2016-03-07 05:19:50 +08:00
* 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).
2016-02-17 17:25:03 +08:00
*
* ```shell
2016-03-05 05:42:21 +08:00
* cordova plugin add cordova-plugin-app-version
2016-02-17 17:25:03 +08:00
* ````
*
* @usage
* ```js
* AppVersion.getAppName();
* AppVersion.getPackageName();
* AppVersion.getVersionCode();
* AppVersion.getVersionNumber();
* ```
*/
@Plugin({
2016-03-05 05:42:21 +08:00
plugin: 'cordova-plugin-app-version',
2016-02-17 17:25:03 +08:00
pluginRef: 'cordova.getAppVersion'
})
export class AppVersion {
/**
* Returns the name of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getAppName(): Promise<any> { return }
2016-02-17 17:25:03 +08:00
/**
* Returns the package name of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getPackageName(): Promise<any> { return }
2016-02-17 17:25:03 +08:00
/**
* Returns the build identifier of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getVersionCode(): Promise<any> { return }
2016-02-17 17:25:03 +08:00
/**
* Returns the version of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getVersionNumber(): Promise<any> { return }
2016-02-17 17:25:03 +08:00
}