import { PURCHASE_TYPE, Product, Transaction } from '@capgo/native-purchases'; export type { Product as NativeProduct, Transaction as NativeTransaction, } from '@capgo/native-purchases'; export type { PURCHASE_TYPE as NativePurchaseType } from '@capgo/native-purchases'; /** * True when running inside a Capacitor iOS or Android app. * * Resolved through the shell-installed native bridge (`shared/native/platform`) * instead of a static Capacitor import, so this module stays loadable in * web-only bundles where Capacitor is never installed. */ export declare function isNativeIAPAvailable(): boolean; /** * Fetch product info from the App Store / Play Store for the given identifiers. * Returns an empty array on web or if the store lookup fails. */ export declare function getNativeProducts(productIdentifiers: string[], productType?: PURCHASE_TYPE): Promise; /** * Initiate a native purchase for the given product identifier. * * The returned Transaction contains the receipt (iOS legacy), jwsRepresentation * (iOS StoreKit 2) or purchaseToken (Android) — send these to the backend for * server-side validation before granting entitlements. Throws if the user cancels * or the purchase fails. */ export declare function purchaseNativeProduct(productIdentifier: string, options?: { planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; appAccountToken?: string; isConsumable?: boolean; /** Set false to defer acknowledgment until backend validation completes. */ autoAcknowledgePurchases?: boolean; }): Promise; /** * Manually acknowledge/finish a transaction after server-side validation. * Only needed when purchaseNativeProduct was called with autoAcknowledgePurchases: false. * * @param purchaseToken purchaseToken (Android) or transactionId (iOS) */ export declare function acknowledgeNativePurchase(purchaseToken: string): Promise; /** Restore previously completed purchases (required to be reachable in the UI by App Store). */ export declare function restoreNativePurchases(): Promise; /** Return all purchases recorded for the current user on this device. */ export declare function getNativePurchases(options?: { productType?: PURCHASE_TYPE; appAccountToken?: string; onlyCurrentEntitlements?: boolean; }): Promise; /** * Register the StoreKit 2 transaction listener so background renewals, restores * and interrupted purchases are observed when the app launches or resumes. Safe * no-op on web. Call once after the billing context is known. * * Background transactions are reconciled authoritatively server-side via Apple * App Store Server Notifications / Google RTDN; this listener lets the UI react * (e.g. refresh entitlements) without polling. */ export declare function installNativeIAP(onTransaction?: (transaction: Transaction) => void): Promise; //# sourceMappingURL=purchases.d.ts.map