@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
47 lines (46 loc) • 2.4 kB
TypeScript
import type { CompleteWorkflowNavigateArgs } from "../../types/components/button";
import type { ColorScheme } from "../../types/colors";
import type { InitialInputSelections } from "../../stores/inputValidation";
import type { OnComponentInteraction } from "../../types/paywall-component-interaction";
import type { VariableDictionary } from "../../types/variables";
import type { WalletButtonRender } from "../../types/wallet";
import type { UIConfig } from "../../types/ui-config";
import type { ReservedAttribute } from "../../types/components/input-text";
import type { WorkflowNavData, WorkflowStepChangeEvent } from "../../types/workflow-nav";
interface Props {
workflow: WorkflowNavData;
uiConfig: UIConfig;
selectedLocale?: string;
globalVariables?: VariableDictionary;
variablesPerPackage?: Record<string, VariableDictionary>;
maxContentWidth?: string;
initialInputSelections?: InitialInputSelections;
containerId?: string;
walletButtonRender?: WalletButtonRender;
safeAreaFallbackColor?: ColorScheme | null;
onPurchaseClicked?: (packageId: string, actionId: string) => void | Promise<void>;
onActionTriggered?: (actionId: 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.
*/
onSensitiveInputChanged?: (fieldId: string, value: string) => void;
onReservedAttributeChanged?: (reservedAttribute: ReservedAttribute, value: string) => void;
onCompleteWorkflowNavigate?: (args: CompleteWorkflowNavigateArgs) => void | Promise<void>;
onNavigateToUrlClicked?: (url: string) => void;
onRestorePurchasesClicked?: () => void;
onVisitCustomerCenterClicked?: () => void;
onComponentInteraction?: OnComponentInteraction;
onClose?: () => void;
onExitBack?: () => void;
/**
* Called whenever the current workflow step changes — on initial load,
* forward navigation, back navigation, and when leaving a step (close,
* purchase, error). Used by the host to fire workflow lifecycle events.
*/
onStepChanged?: (event: WorkflowStepChangeEvent) => void;
}
declare const Workflow: import("svelte").Component<Props, {}, "">;
type Workflow = ReturnType<typeof Workflow>;
export default Workflow;