UNPKG

@spicysparks/react-native-iap

Version:
66 lines 2.81 kB
import type { Product, ProductPurchase, Sku } from '../types'; import type { PaymentDiscountSk2, ProductSk2, ProductStatus, RefundRequestStatus, TransactionSk2 } from '../types/appleSk2'; import type { NativeModuleProps } from './common'; type getItems = (skus: Sku[]) => Promise<ProductSk2[]>; type getAvailableItems = (alsoPublishToEventListener?: boolean, onlyIncludeActiveItems?: boolean) => Promise<TransactionSk2[]>; export type BuyProduct = (sku: Sku, andDangerouslyFinishTransactionAutomaticallyIOS: boolean, applicationUsername: string | undefined, quantity: number, withOffer: Record<keyof PaymentDiscountSk2, string> | undefined) => Promise<TransactionSk2>; type clearTransaction = () => Promise<void>; type clearProducts = () => Promise<void>; type promotedProduct = () => Promise<Product | null>; type buyPromotedProduct = () => Promise<void>; type finishTransaction = (transactionIdentifier: string) => Promise<boolean>; type getPendingTransactions = () => Promise<ProductPurchase[]>; type presentCodeRedemptionSheet = () => Promise<null>; type showManageSubscriptions = () => Promise<null>; export interface IosModulePropsSk2 extends NativeModuleProps { isAvailable(): number; latestTransaction(sku: string): Promise<TransactionSk2>; currentEntitlement(sku: string): Promise<TransactionSk2>; subscriptionStatus(sku: string): Promise<ProductStatus[]>; isEligibleForIntroOffer(groupID: string): Promise<Boolean>; sync(): Promise<null>; getItems: getItems; getAvailableItems: getAvailableItems; buyProduct: BuyProduct; clearTransaction: clearTransaction; clearProducts: clearProducts; promotedProduct: promotedProduct; buyPromotedProduct: buyPromotedProduct; finishTransaction: finishTransaction; getPendingTransactions: getPendingTransactions; presentCodeRedemptionSheet: presentCodeRedemptionSheet; showManageSubscriptions: showManageSubscriptions; disable: () => Promise<null>; beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>; } /** * Sync state with Appstore (iOS only) * https://developer.apple.com/documentation/storekit/appstore/3791906-sync */ export declare const sync: () => Promise<null>; /** * */ export declare const isEligibleForIntroOffer: (groupID: string) => Promise<Boolean>; /** * */ export declare const subscriptionStatus: (sku: string) => Promise<ProductStatus[]>; /** * */ export declare const currentEntitlement: (sku: string) => Promise<TransactionSk2>; /** * */ export declare const latestTransaction: (sku: string) => Promise<TransactionSk2>; /** * */ export declare const beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>; /** * */ export declare const showManageSubscriptions: () => Promise<null>; export {}; //# sourceMappingURL=iosSk2.d.ts.map