import type { Message, MessageResponse } from './types.js'; /** * Shared communication module for Flutter WebView bridge. * * @remarks * This module manages the message bridge between the web page and Flutter app. * It handles callbacks for async messages and event listeners for action notifications. * Only one message listener is created regardless of how many plugins are used. */ export declare const communication: { /** Whether the bridge is initialized and ready */ readonly isReady: boolean; /** Whether running inside Flutter WebView */ readonly isWebView: boolean; /** * Initialize or reinitialize the communication bridge. * Automatically called on first import if running in Flutter WebView. * Call this manually after destroy() to reactivate the bridge. */ init(): void; /** * Send an async message to Flutter and wait for response. * @param message - The message to send * @returns Promise resolving to the response */ sendAsync>(message: Message): Promise>; /** * Send a fire-and-forget message to Flutter. * @param message - The message to send */ sendVoid(message: Message): void; /** * Add an event listener for a specific event/action from Flutter. * @param event - The event name to listen for * @param listener - The callback function */ on(event: string, listener: (...args: any[]) => void): void; /** * Remove a specific event listener. * @param event - The event name * @param listener - The callback function to remove */ off(event: string, listener: (...args: any[]) => void): void; /** * Remove all event listeners for specific event(s). * @param events - Comma-separated list of event names */ offMany(events: string): void; /** * Clean up all resources to prevent memory leaks. * Call this when the bridge is no longer needed. */ destroy(): void; }; //# sourceMappingURL=base.d.ts.map