import { Stripe, StripeElements, StripeCheckout } from '@stripe/stripe-js'; import type { IStripeService, StripeServiceState, CheckoutSessionOptions } from './interfaces'; /** * Core Stripe Service * Manages Stripe.js initialization and Elements instance only * Does NOT manage specific element types (Card, Payment, etc.) */ declare class StripeServiceClass implements IStripeService { private store; private changeListeners; /** * Get the reactive state object * Components can use this directly in render() for automatic reactivity */ get state(): StripeServiceState; /** * Register a callback for when a specific state property changes * @param key - The state property to watch * @param callback - Function to call when the property changes * @returns Unsubscribe function */ onChange(key: K, callback: (newValue: StripeServiceState[K]) => void): () => void; /** * Initialize Stripe.js client with Payment Intent mode * @param publishableKey - Your Stripe publishable API key * @param options - Optional configuration */ initialize(publishableKey: string, options?: { stripeAccount?: string; applicationName?: string; }): Promise; /** * Initialize Stripe.js client with Checkout Session mode * @param publishableKey - Your Stripe publishable API key * @param checkoutSessionClientSecret - The client secret from Checkout Session * @param options - Optional configuration */ initializeWithCheckoutSession(publishableKey: string, checkoutSessionClientSecret: string, options?: { stripeAccount?: string; applicationName?: string; } & CheckoutSessionOptions): Promise; /** * Get the current Stripe instance */ getStripe(): Stripe | undefined; /** * Get the current Elements instance */ getElements(): StripeElements | undefined; /** * Get the current Checkout instance (for Checkout Session mode) */ getCheckout(): StripeCheckout | undefined; /** * Reset the service to initial state * Useful for testing and cleanup */ reset(): void; /** * Dispose of all listeners and reset state * Should be called in test cleanup */ dispose(): void; } /** * Singleton instance of StripeService (for backward compatibility) * New code should use ServiceFactory for better testability * * @deprecated Use ServiceFactory.createStripeService() for better DI support */ export declare const StripeService: StripeServiceClass; /** * Export class for DI usage */ export { StripeServiceClass };