import type { CustomVariableValue } from "./variables.js"; import type { StateValue } from "./state.js"; type EqualityOperator = "=" | "!="; type ArrayOperator = "in" | "not in"; export type ComparisonOperator = ">=" | ">" | "<=" | "<" | "="; export declare const RuleKey: { readonly SelectedPackageCondition: "selected_package_condition"; readonly IntroOfferCondition: "intro_offer_condition"; readonly PromoOfferCondition: "promo_offer_condition"; readonly VariableCondition: "variable_condition"; readonly StateCondition: "state_condition"; readonly WindowWidthCondition: "window_width_condition"; readonly WindowHeightCondition: "window_height_condition"; readonly WindowAspectRatioCondition: "window_aspect_ratio_condition"; }; type IntroOfferCondition = { type: "intro_offer"; }; type MultipleIntroOffersCondition = { type: "multiple_intro_offers"; }; type SelectedCondition = { type: "selected"; }; type HoverCondition = { type: "hover"; }; type FocusCondition = { type: "focus"; }; type ErrorCondition = { type: "error"; }; type PromoOfferCondition = { type: "promo_offer"; }; type SelectedPackageCondition = { type: typeof RuleKey.SelectedPackageCondition; operator: ArrayOperator; packages: string[]; }; type IntroductoryOfferCondition = { type: typeof RuleKey.IntroOfferCondition; operator: EqualityOperator; value: boolean; }; type PromotionalOfferCondition = { type: typeof RuleKey.PromoOfferCondition; operator: EqualityOperator; value: boolean; }; type VariableCondition = { type: typeof RuleKey.VariableCondition; operator: EqualityOperator; variable: string; value: CustomVariableValue | string | number | boolean; }; type StateCondition = { type: typeof RuleKey.StateCondition; operator: EqualityOperator; name: string; value: StateValue; }; /** * Compares the paywall's own box (CSS px, matching iOS points and Android dp) * or its aspect ratio (width รท height). Never matches before the paywall is * measured. */ export type WindowSizeCondition = { type: typeof RuleKey.WindowWidthCondition | typeof RuleKey.WindowHeightCondition | typeof RuleKey.WindowAspectRatioCondition; operator: ComparisonOperator; value: number; }; export type OverrideCondition = IntroOfferCondition | MultipleIntroOffersCondition | SelectedCondition | HoverCondition | FocusCondition | ErrorCondition | PromoOfferCondition | IntroductoryOfferCondition | PromotionalOfferCondition | SelectedPackageCondition | VariableCondition | StateCondition | WindowSizeCondition; /** * The reserved properties of an override that should not be included in the override properties */ type ReservedProperty = "id" | "type" | "overrides" | "stack" | "components" | "items" | "pages" | "tabs" | "field_id" | "option_id" | "keyboard_type" | "capitalize" | "validation" | "validation_error_lid" | "validation_error_lids"; type OverrideProperties = Partial>; type Override = { conditions: OverrideCondition[]; properties: OverrideProperties; }; export type Overrides = Override[]; export {};