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)
This commit is contained in:
Adam Duren 2021-04-05 16:29:27 -05:00 committed by GitHub
parent 158bf637cd
commit 8dcb6be4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 })