import { SequenceView } from '@fanfare-io/fanfare-sdk-core/experiences'; import { Stripe, StripeConstructor, StripeElementStyle } from '@stripe/stripe-js'; /** How a granted win settles, as the granted views carry it. */ type GrantedSettlement = Extract["settlement"]; /** * The wire block a checkout-capable view carries, reached through the adapter's declared * dependency on `fanfare-sdk-core` rather than the contracts package: core re-exports the contract * types so adapter modules never resolve `@fanfare-io/fanfare-sdk-contracts` directly. Core names * the shape only within the arms that carry it, so it is read back off one of them. */ type PaymentProviderConfig = NonNullable["paymentProvider"]>; declare global { interface Window { Stripe?: StripeConstructor; } } export interface StripeClientConfig { publishableKey: string; stripeAccount?: string; } /** * Loads Stripe.js once per page. A failure is never retained: a memoized rejection would strand * every subsequent payer on the page, not just the one whose load failed. Retry is the caller's * decision — this module never schedules one. */ export declare function loadStripeJs(): Promise; /** * One Stripe client per (publishable key, connected account). A construction that rejects drops * its cache entry for the same reason the loader does. */ export declare function getStripe(config: StripeClientConfig): Promise; /** * Re-serializes a theme color into the spelling a CSS color parser produces. * * Custom properties are untyped, so a theme color arrives from `getComputedStyle` as whatever token * stream the stylesheet declared — and a minifier is free to rewrite `oklch(0.63 0.24 25)` as * `oklch(63% .24 25)`. Stripe's element options go through a stricter parser than CSS's: a spelling * every browser accepts can still be rejected there, and the rejection is silent — the element * mounts a frame that never renders its input. The invariant this restores is that colors reach * Stripe in the serialization its parser accepts. * * `null` means the value is not a color the parser recognizes, and the caller must omit the key * rather than guess: assigning an unparsable value leaves `fillStyle` on its previous one, so * emitting the read-back would emit some other color entirely. Where no parser exists — server * rendering, or a DOM without canvas — the value passes through: the mismatch only arises where a * real browser serializes computed styles. */ export declare function normalizeCssColor(value: string): string | null; /** * Maps the SDK theme's resolved custom properties onto the Card Element's `style` option. Stripe's * `Appearance` API governs the Elements group Payment Element consumes and does not reach the * legacy Card Element, so `style` is the only theming path — there is deliberately no second one. * * Property names are the values of `THEME_CSS_VARS` (the adapter's `theme/theme.types.ts`), spelled * literally here because this file must stay identical across adapters. `--ff-color-primary` and * `--ff-color-background` have no Card Element equivalent: the element's background is the host * page's, supplied by the panel around the iframe. * * Every color is re-serialized on the way out; a color the parser rejects is omitted, which leaves * Stripe on its own default for that slot. The font stack is not a color and is forwarded as read. */ export declare function deriveStripeCardStyle(root: HTMLElement): StripeElementStyle; /** * The one binding between a view's wire configuration and a Stripe client. * * `null` means no usable Stripe client configuration reached this view. On a checkout-capable arm * that has exactly one cause — the configuration read failed — because the processor discriminator * is the settlement's `processor`/`mode` pair (granted) or `checkoutMode` (enterable), never the * presence of this block. The condition is transient and retryable. */ export declare function resolveStripeClientConfig(source: PaymentProviderConfig | undefined): StripeClientConfig | null; /** Test-only seam over every memo this module holds. Never exported from an adapter's public entry. */ export declare function resetStripeClientCache(): void; export {};