import { EventEmitter } from '../../stencil-public-runtime'; export interface WidgetConfig { installmentsCount: number; price: number; currency: string; promotionUrl?: string; locale?: string; } export interface PriceUpdateEvent { price: number; currency: string; } export interface AnalyticsEvent { eventName: string; eventData: { price: number; currency: string; installmentsCount: number; installmentPrice: string; timestamp: number; }; } export declare class AmwalWidget { /** * Widget configuration including price, installments, and URL */ config: WidgetConfig; /** * Enable or disable the widget */ isActive: boolean; /** * Show green border for special offers (subtle enhancement) */ showGreenBorder: boolean; /** * The language of the plugin. Supported languages are Arabic ("ar") and English ("en") */ locale?: string; /** * Enable debug mode for additional console logs */ debug: boolean; /** * Custom text for the promotional message. When provided, this will replace the default installment text. */ customText?: string; /** * Show monthly payment amount (clean display) */ showMonthlyPayment: boolean; /** * Show savings compared to credit card interest (subtle) */ showSavings: boolean; /** * Estimated credit card monthly interest rate for savings calculation */ creditCardInterestRate: number; /** * Show subtle social proof */ showSocialProof: boolean; /** * Custom social proof text */ socialProofText: string; /** * Show subtle popular choice badge */ showPopularBadge: boolean; /** * Enable analytics tracking */ enableAnalytics: boolean; /** * Layout theme for the modal */ layoutTheme: 'mobile' | 'desktop'; isVisible: boolean; showModal: boolean; isLoading: boolean; promotionClick: EventEmitter; priceUpdate: EventEmitter; analyticsEvent: EventEmitter; /** * Translation function to handle localization * @private */ private t; /** * Check if current locale is RTL */ private get isRTL(); /** * Get text direction attribute */ private get textDirection(); /** * Lifecycle method called when component is disconnected */ disconnectedCallback(): void; /** * Lifecycle method that is called once when the component is first created */ componentWillLoad(): Promise; /** * Lifecycle method to update translations when locale changes */ updateLocale(newValue: string): Promise; /** * Watch for config changes and update visibility */ onConfigChange(): void; /** * Update widget visibility based on config */ private updateVisibility; /** * Method to programmatically update the widget config */ updateConfig(newConfig: Partial): Promise; /** * Get installment price formatted as string */ private getInstallmentPrice; /** * Format currency with proper RTL support */ private formatCurrency; /** * Calculate monthly payment display text with RTL support */ private renderMonthlyPayment; /** * Calculate potential savings compared to credit card with RTL support */ private calculateSavings; /** * Track analytics events (optional) */ private trackEvent; /** * Reference to the modal element in the body */ private modalElement; /** * Clean click handler */ private handleClick; /** * Create modal element and append to document body */ private createModalInBody; /** * Remove modal from document body */ private removeModalFromBody; private handleModalClose; /** * Get the promotion URL with fallback to default if not provided * @returns The promotion URL to use for the modal */ private getPromotionUrl; /** * Render the Amwal logo */ private renderAmwalLogo; /** * Render installment text with proper RTL support */ private renderInstallmentText; render(): any; }