@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
35 lines (34 loc) • 1.69 kB
TypeScript
import type { Action } from "../types/components/button";
import type { ReservedAttribute } from "../types/components/input-text";
import type { ComponentInteractionData } from "../types/paywall-component-interaction";
import type { UIConfig } from "../types/ui-config";
import type { PackageInfo, VariableDictionary } from "../types/variables";
import type { WalletButtonRender } from "../types/wallet";
import { type Readable, type Writable } from "svelte/store";
type PaywallContext = Readonly<{
defaultPackageId?: string;
selectedPackageId: Writable<string | undefined>;
/**
* PackageId -> package-specific variables
* */
variablesPerPackage: Readable<Record<string, VariableDictionary> | undefined>;
/**
* Global variables which should always be active
* Like custom variables
* */
baseVariables: Readable<VariableDictionary | undefined>;
infoPerPackage: Readable<Record<string, PackageInfo> | undefined>;
onPurchase: (actionId?: string) => void;
emitComponentInteraction: (data: ComponentInteractionData) => void;
onNavigateToUrl?: (url: string) => void;
onInputChanged?: (fieldId: string, value: string, actionId?: string) => void;
onReservedAttributeChanged?: (reservedAttribute: ReservedAttribute, value: string) => void;
walletButtonRender?: WalletButtonRender;
onWalletButtonReady?: (walletButtonAvailable?: boolean) => void;
onButtonAction: (action: Action, actionId?: string) => void;
uiConfig: UIConfig;
hideBackButtons: boolean;
}>;
export declare function setPaywallContext(context: PaywallContext): void;
export declare function getPaywallContext(): PaywallContext;
export {};