import type { Offer, ProductVariant } from './types/offer.types'; import { ApplePayEntryPoint } from './constants'; export declare const APPLE_PAY_EXCLUDED_VARIANTS: readonly ProductVariant[]; export declare class ApplePayButton extends HTMLElement { #private; static readonly tag = "teg-apple-pay-button"; static define(): void; /** * Creates and configures an ApplePayButton when the entry point allows it. * * - `DUAL_OFFER_BANNER` (or omitted): always-on after offer exclusions — * no homepage/Safari gate here. Safari/Apple is enforced later by * `isApplePayAvailable()` on mount. * - `FREE_TRIAL_BANNER`: same always-on-after-exclusions gate as Dual; distinct * TEDL `entry_point` string (`free_trial_banner`) for wallet impression attribution. * - `FREE_TRIAL_POPUP`: same always-on-after-exclusions gate. Distinct TEDL * `entry_point` (`free_trial_popup`). * - `PAYWALL`: always-on after offer exclusions + Safari/Apple placement * eligibility. No Amplitude experiment / `$exposure`. * - `REGWALL`: inert — always returns null. * * `BYPASS_APPLE_PAY_CHECKS` skips placement eligibility here and device checks * in `isApplePayAvailable()` on mount (QA on non-Apple browsers). * * @param offer - The offer to display in the Apple Pay flow. * @param country - The user's country code. * @param entryPoint - Where the button is being rendered (e.g. paywall, banner). */ static createIfEnabled(offer: Offer | undefined, country: string, entryPoint?: ApplePayEntryPoint): ApplePayButton | null; get offer(): Offer | null; set offer(value: Offer | null); get country(): string; set country(value: string); get entryPoint(): ApplePayEntryPoint | ''; set entryPoint(value: ApplePayEntryPoint); /** * Awaitable contract for the component's current render lifecycle. * * - If called **after** the element has been appended to the DOM, resolves * once `connectedCallback` finishes — whether Apple Pay rendered * successfully or was hidden (unavailable / suppressed by session). * - If called **before** the element is appended (or if it has never been * connected), resolves immediately to `undefined`. It does **not** wait * for a future connection, so always `await whenReady()` after `appendChild`: * * ```ts * container.appendChild(btn); // browser fires connectedCallback * await btn.whenReady(); // waits for render to finish * if (btn.style.display !== 'none') { /* available *\/ } * ``` */ whenReady(): Promise; connectedCallback(): Promise; /** * Resets all render state when the element is removed from the DOM. * * A shared library component cannot assume it won't be moved in the DOM * (e.g. lazy panels, SPA route changes). Resetting on disconnect means * reattach always triggers a fresh `#run()` — new session check, new payment * options fetch, fresh event listeners — preventing stale data from persisting * and eliminating the implicit reliance on the DOM as a render-state flag. */ disconnectedCallback(): void; }