import type { ProductQueryType, RequestPurchaseProps, AlternativeBillingModeAndroid, BillingProgramAndroid, UserChoiceBillingDetails, VerifyPurchaseProps, VerifyPurchaseResult, VerifyPurchaseWithProviderProps, VerifyPurchaseWithProviderResult, PurchaseOptions } from '../types'; import type { ActiveSubscription, Product, Purchase, PurchaseError, ProductSubscription } from '../types'; import type { MutationFinishTransactionArgs } from '../types'; type UseIap = { connected: boolean; products: Product[]; subscriptions: ProductSubscription[]; availablePurchases: Purchase[]; promotedProductIOS?: Product; activeSubscriptions: ActiveSubscription[]; finishTransaction: (args: MutationFinishTransactionArgs) => Promise; getAvailablePurchases: (options?: PurchaseOptions) => Promise; fetchProducts: (params: { skus: string[]; type?: ProductQueryType | null; }) => Promise; requestPurchase: (params: RequestPurchaseProps) => Promise; /** * @deprecated Use `verifyPurchase` instead. This function will be removed in a future version. */ validateReceipt: (options: VerifyPurchaseProps) => Promise; /** Verify purchase with the configured providers */ verifyPurchase: (options: VerifyPurchaseProps) => Promise; /** Verify purchase with a specific provider (e.g., IAPKit) */ verifyPurchaseWithProvider: (options: VerifyPurchaseWithProviderProps) => Promise; restorePurchases: (options?: PurchaseOptions) => Promise; getPromotedProductIOS: () => Promise; requestPurchaseOnPromotedProductIOS: () => Promise; getActiveSubscriptions: (subscriptionIds?: string[]) => Promise; hasActiveSubscriptions: (subscriptionIds?: string[]) => Promise; /** * Manually retry the store connection. * Useful when the initial auto-connect fails (e.g., Play Store not ready at mount time). * Updates the `connected` state on success. */ reconnect: () => Promise; checkAlternativeBillingAvailabilityAndroid?: () => Promise; showAlternativeBillingDialogAndroid?: () => Promise; createAlternativeBillingTokenAndroid?: (sku?: string) => Promise; }; export interface UseIapOptions { onPurchaseSuccess?: (purchase: Purchase) => void; onPurchaseError?: (error: PurchaseError) => void; /** Callback for non-purchase errors (fetchProducts, getAvailablePurchases, etc.) */ onError?: (error: Error) => void; onPromotedProductIOS?: (product: Product) => void; onUserChoiceBillingAndroid?: (details: UserChoiceBillingDetails) => void; /** * Fires when an active subscription enters a billing-issue state * (StoreKit 2 Message.billingIssue on iOS 18+, Purchase.isSuspended on * Play Billing 8.1+). Not invoked on Meta Horizon. * * Recommended: call deepLinkToSubscriptions on the returned purchase so * the user can update their payment method in the platform subscription * center. */ onSubscriptionBillingIssue?: (purchase: Purchase) => void; /** * @deprecated Use enableBillingProgramAndroid instead. * - 'user-choice' → 'user-choice-billing' * - 'alternative-only' → 'external-offer' */ alternativeBillingModeAndroid?: AlternativeBillingModeAndroid; /** * Enable a specific billing program for Android (8.2.0+) * Use 'user-choice-billing' for User Choice Billing (7.0+). * Use 'external-offer' for External Offer program. * Use 'external-payments' for Developer Provided Billing (Japan only, 8.3.0+). */ enableBillingProgramAndroid?: BillingProgramAndroid; } /** * React Hook for managing In-App Purchases. * See documentation at https://react-native-iap.hyo.dev/docs/hooks/useIAP */ export declare function useIAP(options?: UseIapOptions): UseIap; export {}; //# sourceMappingURL=useIAP.d.ts.map