import { EmitterSubscription } from 'react-native'; export declare enum BillingResponse { BILLING_UNAVAILABLE = "BILLING_UNAVAILABLE", DEVELOPER_ERROR = "DEVELOPER_ERROR", ERROR = "ERROR", FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED", ITEM_ALREADY_OWNED = "ITEM_ALREADY_OWNED", ITEM_NOT_OWNED = "ITEM_NOT_OWNED", ITEM_UNAVAILABLE = "ITEM_UNAVAILABLE", OK = "OK", SERVICE_DISCONNECTED = "SERVICE_DISCONNECTED", SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", USER_CANCELED = "USER_CANCELED", UNKNOWN_BILLING_RESPONSE = "UNKNOWN_BILLING_RESPONSE" } /** * Use this function to connect to the play store. The connection attempt was successful if the promise resolves to BillingResponse.OK. Make sure you subscribe to disconnect events using subscribeToDisconnect before calling this function. */ export declare const connect: () => Promise; /** * Disconnects from the play store. You probably want to call this when you dismiss your subscriptions screen. */ export declare const disconnect: () => Promise; /** * This function is used to listen to disconnect events. * @param callback You might try to reconnect using the connect function in this callback. */ export declare const subscribeToDisconnect: (callback: () => void) => EmitterSubscription; /** * It's not clear from the docs when this function is supposed to be called. */ export declare const isReady: () => Promise; export declare type Feature = 'SUBSCRIPTIONS' | 'SUBSCRIPTIONS_UPDATE'; /** * It's probably a good idea to call this function to make sure the user's phone supports subscriptions. */ export declare const isFeatureSupported: (feature: Feature) => Promise; export interface SkuDetails { description: string; freeTrialPeriod: string; introductoryPrice: string; introductoryPriceAmountMicros: string; introductoryPriceCycles: string; introductoryPricePeriod: string; price: string; priceAmountMicros: string; priceCurrencyCode: string; sku: string; subscriptionPeriod: string; title: string; type: string; } /** * Use this function to get details for the given SKUs. Getting the SKUs in the first place is your responsibility. */ export declare const querySkuDetails: (skus: string[]) => Promise; export interface LaunchBillingFlowParams { sku: string; oldSku?: string; accountId?: string; } /** * This launches the sequence of dialogues that are shown to the user to complete a purchase. Make sure you call subscribeToPurchasesUpdated before you call this function. */ export declare const launchBillingFlow: (params: LaunchBillingFlowParams) => Promise; export interface PurchasesData { billingResponse: BillingResponse; purchases: null | Array<{ orderId: string; originalJson: string; packageName: string; purchaseTime: string; purchaseToken: string; signature: string; sku: string; isAutoRenewing: boolean; }>; } export declare const subscribeToPurchasesUpdated: (callback: (update: PurchasesData) => void) => EmitterSubscription; /** * Google recommends calling this on app launch and when returning from background to catch up with subscription status changes that may have happened while the app wasn't active. */ export declare const queryPurchases: () => Promise;