import { Config, Product, Purchase, Order, PlanChange } from './types'; export interface GetProductsResponse { ok: boolean; products: Product[]; } export interface PostCheckoutSessionResponse { ok: boolean; url: string; accessToken: string; } export interface GetPurchasesResponse { ok: boolean; purchases: Purchase[]; newAccessToken?: string; } export interface ChangePlanResponse { ok: boolean; purchase: Purchase; newAccessToken?: string; } export declare class IapticStripe { static readonly VERSION = "1.0.0"; private readonly iapticUrl; private readonly appName; private readonly apiKey; private readonly refreshScheduler; constructor(config: Config); private authorizationHeader; getProducts(): Promise; refreshProducts(): Promise; getAccessToken(): string | undefined; order(params: Order): Promise; /** * Get purchases status. * * By default, it will use the access token stored in the browser's localStorage. You can * pass an optional access token to get the purchases for a specific user. * * @param accessToken Optional access token for the user */ getPurchases(accessToken?: string): Promise; /** * Redirects to Stripe Customer Portal for subscription management */ redirectToCustomerPortal(params: { returnUrl?: string; accessToken?: string; }): Promise; /** * Changes the subscription plan * * @param {PlanChange} planChange - Plan change request * * @returns {Promise} Updated purchase details */ changePlan(planChange: PlanChange): Promise; clearStoredData(): void; private _storeAccessToken; private _getStoredAccessToken; private _getCachedProducts; private _setCachedProducts; }