From c43331705147edcf1a0de80a5fdf5f57613c8b9a Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 18 Sep 2018 12:14:28 -0500 Subject: [PATCH] fix(build): Fix TypeScript bug, wrong type exported for wrap fn --- src/@ionic-native/core/decorators/common.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index 5cedbbe78..8d44879c7 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -412,6 +412,10 @@ export function cordovaWarn(pluginName: string, method?: string): void { } } +// Fixes a bug in TypeScript 2.9.2 where the ...args is being converted into args: {} and +// causing compilation issues +export type WrapFn = (...args: any[]) => any; + /** * @private */ @@ -419,7 +423,7 @@ export const wrap = ( pluginObj: any, methodName: string, opts: CordovaOptions = {} -) => { +): WrapFn => { return (...args: any[]) => { if (opts.sync) { // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is