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, WalletPurchasePrepare, WalletPurchaseStart } from "../types/wallet"; import type { PaywallOffering, PaywallPackage, PaywallWorkflow } from "@revenuecat/workflow-web-components-sdk"; import { type Readable, type Writable } from "svelte/store"; import type { BridgeCustomValues, BridgeInputs } from "../components/web-view/build-paywall-context"; type PaywallContext = Readonly<{ defaultPackageId?: string; selectedPackageId: Writable; /** * PackageId -> package-specific variables * */ variablesPerPackage: Readable | undefined>; /** * Global variables which should always be active * Like custom variables * */ baseVariables: Readable; infoPerPackage: Readable | undefined>; /** Host-supplied offering for the web_view bridge. */ offering?: PaywallOffering | null; /** Host-mapped packages (SDK shape) for the web_view bridge. */ contextPackages?: PaywallPackage[]; /** Paywall-tree package ids in display order. */ packageIdsInDisplayOrder?: string[]; workflow?: PaywallWorkflow; isPreview?: boolean; selectedLocale?: string; typedCustom?: BridgeCustomValues; bridgeInputs?: Writable; onPurchase: (actionId?: string) => void; /** Opens a custom checkout URL in place of purchasing. */ onCustomWebCheckout?: (url: string) => void; emitComponentInteraction: (data: ComponentInteractionData) => void; onNavigateToUrl?: (url: string) => void; onInputChanged?: (fieldId: string, value: string, actionId?: string) => void; /** * Called for sensitive inputs (keyboard_type: "password") instead of * onInputChanged, so hosts can keep the value in memory only and never * persist, log, or forward it. */ onSensitiveInputChanged?: (fieldId: string, value: string) => void; onReservedAttributeChanged?: (reservedAttribute: ReservedAttribute, value: string) => void; walletButtonRender?: WalletButtonRender; onWalletButtonReady?: (walletButtonAvailable?: boolean) => void; prepareWalletPurchase?: WalletPurchasePrepare; onWalletPurchaseClicked?: WalletPurchaseStart; onButtonAction: (action: Action, actionId?: string) => void; /** Forwarded on custom checkout URLs. */ appUserId?: string; isSandbox?: boolean; rcSource?: string; uiConfig: UIConfig; hideBackButtons: boolean; }>; export declare function setPaywallContext(context: PaywallContext): void; export declare function getPaywallContext(): PaywallContext; export {};