From 8dcb6be4ea76f650c16e38c573f18a8f56d16911 Mon Sep 17 00:00:00 2001 From: Adam Duren Date: Mon, 5 Apr 2021 16:29:27 -0500 Subject: [PATCH] fix(in-app-purchase-2): fix typings for refresh (#3632) Fixes the typings for the return value of `refresh` as described [here](https://github.com/j3k0/cordova-plugin-purchase/blob/dd6bf6f/doc/api.md#return-value-3) --- src/@ionic-native/plugins/in-app-purchase-2/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/in-app-purchase-2/index.ts b/src/@ionic-native/plugins/in-app-purchase-2/index.ts index f7d7c0761..9ed945236 100644 --- a/src/@ionic-native/plugins/in-app-purchase-2/index.ts +++ b/src/@ionic-native/plugins/in-app-purchase-2/index.ts @@ -7,6 +7,13 @@ export interface IAPProductOptions { type: string; } +export interface IRefeshResult { + cancelled(fn: () => void): void; + failed(fn: () => void): void; + completed(fn: () => void): void; + finished(fn: () => void): void; +} + export type IAPProducts = IAPProduct[] & { /** * Get product by ID @@ -865,7 +872,9 @@ export class InAppPurchase2 extends IonicNativePlugin { * and in the callback `product.finish()` should be called. */ @Cordova({ sync: true }) - refresh(): void {} + refresh(): IRefeshResult { + return; + } /** Lightweight method like refresh but do not relogin user */ @Cordova({ sync: true })