Skip to content

Commit

Permalink
Added missing types on updates in 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jul 18, 2019
1 parent 4b7cd41 commit 8dd7ad9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
13 changes: 12 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ export function buyProduct(sku: string) : Promise<ProductPurchase>;
* Request a purchase
*
* @param {string} sku The product's sku/ID
* @param {boolean} andDangerouslyFinishTransactionAutomatically You should set this to false and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.
* @returns {Promise<string>}
*/
export function requestPurchase(sku: string) : Promise<string>;
export function requestPurchase(sku: string, andDangerouslyFinishTransactionAutomatically?: boolean) : Promise<string>;

/**
* Create a subscription to a sku
Expand Down Expand Up @@ -186,6 +187,16 @@ export function buyProductWithQuantityIOS(sku: string, quantity: number) : Promi
*/
export function requestPurchaseWithQuantityIOS(sku: string, quantity: number) : Promise<string>;

/**
* Finish Transaction (iOS only)
* Similar to `consumePurchaseAndroid`. Tells StoreKit that you have delivered the purchase to the user and StoreKit can now let go of the transaction.
* Call this after you have persisted the purchased state to your server or local data in your app.
* `react-native-iap` will continue to deliver the purchase updated events with the successful purchase until you finish the transaction. **Even after the app has relaunched.**
* @param {string} transactionId The transactionId of the function that you would like to finish.
* @returns {null}
*/
export function finishTransactionIOS(transactionId: string): void;

/**
* Clear Transaction (iOS only)
* Finish remaining transactions. Related to issue #257
Expand Down
6 changes: 5 additions & 1 deletion index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ declare module.exports: {
getPurchaseHistory(): Promise<Purchase[]>,
getAvailablePurchases(): Promise<Purchase[]>,
buyProduct: string => Promise<ProductPurchase>,
requestPurchase: string => Promise<string>,
requestPurchase(
sku: string,
andDangerouslyFinishTransactionAutomatically: boolean,
): Promise<string>,
buySubscription(
sku: string,
oldSku?: string,
Expand All @@ -91,6 +94,7 @@ declare module.exports: {
sku: string,
quantity: number,
): Promise<string>,
finishTransactionIOS(transactionId: string): void,
clearTransactionIOS(): void,
clearProductsIOS(): void,
acknowledgePurchaseAndroid(token: string, developerPayload?: string): Promise<PurchaseResult>,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-iap",
"version": "3.3.1",
"version": "3.3.2",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 8dd7ad9

Please sign in to comment.