@revenuecat/purchases-ui-js 4.7.4 → 4.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/variables.d.ts +14 -1
- package/package.json +1 -1
|
@@ -70,9 +70,22 @@ export type CustomVariables = {
|
|
|
70
70
|
[key: CustomVariableName]: CustomVariableValue;
|
|
71
71
|
};
|
|
72
72
|
type CustomVariableName = string & {};
|
|
73
|
+
/**
|
|
74
|
+
* Variables that carry values entered by the end user in input components on
|
|
75
|
+
* earlier funnel screens. The funnel runtime captures each input's value and
|
|
76
|
+
* injects it into the paywall's variables (via `globalVariables`) keyed by the
|
|
77
|
+
* input component's `field_id`. Reference them in paywall text as:
|
|
78
|
+
* ```
|
|
79
|
+
* Welcome back, {{ input.first_name }}!
|
|
80
|
+
* ```
|
|
81
|
+
* No prefix stripping is applied — the dictionary is keyed by the full
|
|
82
|
+
* `input.<field_id>` token, so substitution works the same as built-in
|
|
83
|
+
* variables.
|
|
84
|
+
*/
|
|
85
|
+
export type InputVariableName = `input.${string}`;
|
|
73
86
|
export declare function mergeCustomVariables(customVariables: CustomVariables, uiConfig: UIConfig | undefined): VariableDictionary;
|
|
74
87
|
type BuiltinVariableName = "product.price" | "product.price_per_period" | "product.price_per_period_abbreviated" | "product.price_per_day" | "product.price_per_week" | "product.price_per_month" | "product.price_per_year" | "product.period" | "product.period_abbreviated" | "product.periodly" | "product.period_in_days" | "product.period_in_weeks" | "product.period_in_months" | "product.period_in_years" | "product.period_with_unit" | "product.currency_code" | "product.currency_symbol" | "product.offer_price" | "product.offer_price_per_day" | "product.offer_price_per_week" | "product.offer_price_per_month" | "product.offer_price_per_year" | "product.offer_period" | "product.offer_period_abbreviated" | "product.offer_period_in_days" | "product.offer_period_in_weeks" | "product.offer_period_in_months" | "product.offer_period_in_years" | "product.offer_period_with_unit" | "product.offer_end_date" | "product.secondary_offer_price" | "product.secondary_offer_period" | "product.secondary_offer_period_abbreviated" | "product.relative_discount" | "product.store_product_name" | "success.redemption_url" | "success.package_identifier" | "success.product_identifier" | "success.product_title" | "success.product_description" | "success.price" | "success.currency_code" | "success.customer_email" | "success.is_subscription" | "success.is_trial";
|
|
75
|
-
export type VariableDictionary = Partial<Record<BuiltinVariableName | CustomVariableName, string>>;
|
|
88
|
+
export type VariableDictionary = Partial<Record<BuiltinVariableName | InputVariableName | CustomVariableName, string>>;
|
|
76
89
|
export type VariablesDictionary = Record<PackageIdentifier, VariableDictionary>;
|
|
77
90
|
export interface PackageInfo {
|
|
78
91
|
hasIntroOffer?: boolean;
|