import { FlowInstance, FlowEventType, FlowEventCallback, FlowCompletionData, NavigationData, ButtonClickedData, BaseFlowConfig, Environment, ErrorData } from '../types.js'; /** * Flow class implementation for handling iframe flows and events */ export declare class Flow implements FlowInstance { private containerId; protected config: BaseFlowConfig; protected partnerName: string; protected environment: Environment; protected branchOverride?: string | undefined; protected iframe: HTMLIFrameElement | null; protected container: HTMLElement | null; private eventListeners; protected keepAliveInterval: number | null; private messageHandler; constructor(containerId: string, config: BaseFlowConfig, partnerName: string, environment: Environment, branchOverride?: string | undefined); /** * Initialize the flow by creating and injecting the iframe */ initialize(): Promise; /** * Construct the specific flow URL - can be overridden by subclasses */ protected constructFlowUrl(baseUrl: string): string; /** * Create flow URL using partner name and environment */ protected createFlowUrl(): string; private setupEventListeners; /** * Emit events to registered listeners */ protected emit(event: 'completed', data: FlowCompletionData): void; protected emit(event: 'loaded'): void; protected emit(event: 'exit'): void; protected emit(event: 'buttonClicked', data: ButtonClickedData): void; protected emit(event: 'navigated', data: NavigationData): void; protected emit(event: 'authenticationSucceeded'): void; protected emit(event: 'authenticationFailed'): void; protected emit(event: 'error', data: ErrorData): void; protected emit(event: 'onboardingCompleted'): void; protected emit(event: 'onboardingRequired'): void; /** * Register an event listener */ on(event: 'completed', callback: (data: FlowCompletionData) => void): void; on(event: 'exit', callback: () => void): void; on(event: 'buttonClicked', callback: (data: ButtonClickedData) => void): void; on(event: 'navigated', callback: (payload: NavigationData) => void): void; on(event: 'authenticationSucceeded', callback: () => void): void; on(event: 'authenticationFailed', callback: () => void): void; on(event: 'error', callback: (data: ErrorData) => void): void; on(event: 'loaded', callback: () => void): void; on(event: 'onboardingCompleted', callback: () => void): void; on(event: 'onboardingRequired', callback: () => void): void; /** * Remove an event listener */ off(event: FlowEventType, callback: FlowEventCallback): void; /** * Close the flow and clean up resources */ close(): void; }