diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index d1febb0d1e..c9f64ffec5 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -59,26 +59,12 @@ export class ActionSheet { addCancelButtonWithLabel?: string, addDestructiveButtonWithLabel?: string, position?: 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((res, rej) => {}); - } + }): Promise { return } /** * Hide the ActionSheet. */ @Cordova() - static hide() { - // 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((res, rej) => {}); - } + static hide(): Promise { return } } diff --git a/src/plugins/appavailability.ts b/src/plugins/appavailability.ts index 38480b990b..f832779663 100644 --- a/src/plugins/appavailability.ts +++ b/src/plugins/appavailability.ts @@ -38,13 +38,6 @@ export class AppAvailability { * @returns {Promise} */ @Cordova() - static check(app : string) : Promise { - // 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((res, rej) => {}); - } + static check(app: string): Promise { return } } diff --git a/src/plugins/apprate.ts b/src/plugins/apprate.ts index b7ac883301..e82ff5e471 100644 --- a/src/plugins/apprate.ts +++ b/src/plugins/apprate.ts @@ -45,9 +45,7 @@ export class AppRate { * @type {{}} */ @CordovaProperty - static get preferences() { - return window.AppRate.preferences; - } + static get preferences() { return window.AppRate.preferences; } /** * Prompts the user for rating @@ -55,6 +53,6 @@ export class AppRate { * @param {boolean} immediately Show the rating prompt immediately. */ @Cordova() - static promptForRating(immediately: boolean) : void {}; + static promptForRating(immediately: boolean): void {}; } diff --git a/src/plugins/appversion.ts b/src/plugins/appversion.ts index 01c3f00d42..829021d68f 100644 --- a/src/plugins/appversion.ts +++ b/src/plugins/appversion.ts @@ -27,55 +27,27 @@ export class AppVersion { * @returns {Promise} */ @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((res, rej) => {}); - } + static getAppName(): Promise { return } /** * Returns the package name of the app * @returns {Promise} */ @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((res, rej) => {}); - } + static getPackageName(): Promise { return } /** * Returns the build identifier of the app * @returns {Promise} */ @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((res, rej) => {}); - } + static getVersionCode(): Promise { return } /** * Returns the version of the app * @returns {Promise} */ @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((res, rej) => {}); - } + static getVersionNumber(): Promise { return } } diff --git a/src/plugins/badge.ts b/src/plugins/badge.ts index b4fc2d51ad..de7f9fa76e 100644 --- a/src/plugins/badge.ts +++ b/src/plugins/badge.ts @@ -26,14 +26,7 @@ export class Badge { * Clear the badge of the app icon. */ @Cordova() - static clear() { - // 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((res, rej) => {}); - } + static clear(): Promise { return } /** * Set the badge of the app icon. @@ -41,28 +34,14 @@ export class Badge { * @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((res, rej) => {}); - } + static set(number: number): Promise { return } /** * 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((res, rej) => {}); - } + static get(): Promise { return } /** * Increase the badge number. @@ -70,14 +49,7 @@ export class Badge { * @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((res, rej) => {}); - } + static increase(number: number): Promise { return } /** * Decrease the badge number. @@ -85,39 +57,18 @@ export class Badge { * @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((res, rej) => {}); - } + static decrease(number: number): Promise { return } /** * 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((res, rej) => {}); - } + static hasPermission(): Promise { return } /** * Register permission to set badge notifications * @returns {Promise} */ @Cordova() - static registerPermission() { - // 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((res, rej) => {}); - } + static registerPermission(): Promise { return } }