Skip to content

Commit 8dcb6be

Browse files
authored
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)
1 parent 158bf63 commit 8dcb6be

File tree

1 file changed

+10
-1
lines changed
  • src/@ionic-native/plugins/in-app-purchase-2

1 file changed

+10
-1
lines changed

src/@ionic-native/plugins/in-app-purchase-2/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ export interface IAPProductOptions {
77
type: string;
88
}
99

10+
export interface IRefeshResult {
11+
cancelled(fn: () => void): void;
12+
failed(fn: () => void): void;
13+
completed(fn: () => void): void;
14+
finished(fn: () => void): void;
15+
}
16+
1017
export type IAPProducts = IAPProduct[] & {
1118
/**
1219
* Get product by ID
@@ -865,7 +872,9 @@ export class InAppPurchase2 extends IonicNativePlugin {
865872
* and in the callback `product.finish()` should be called.
866873
*/
867874
@Cordova({ sync: true })
868-
refresh(): void {}
875+
refresh(): IRefeshResult {
876+
return;
877+
}
869878

870879
/** Lightweight method like refresh but do not relogin user */
871880
@Cordova({ sync: true })

0 commit comments

Comments
 (0)