Skip to content

Commit

Permalink
fix(in-app-purchase-2): fix typings for refresh (#3632)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
adamduren authored Apr 5, 2021
1 parent 158bf63 commit 8dcb6be
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/@ionic-native/plugins/in-app-purchase-2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit 8dcb6be

Please sign in to comment.