/**
 * Google Chat Initializer
 *
 * Handles automatic Google Chat adapter reconnection on backend restart.
 * Loads saved credentials from `~/.crewly/google-chat-credentials.json`
 * and reinitializes the adapter (including Pub/Sub pull loop).
 *
 * Follows the same pattern as `slack-initializer.ts` and
 * `whatsapp-initializer.ts`.
 *
 * @module services/messaging/google-chat-initializer
 */
import { GoogleChatMessengerAdapter } from './adapters/google-chat-messenger.adapter.js';
import type { MessageQueueService } from './message-queue.service.js';
import type { IncomingMessage } from './messenger-adapter.interface.js';
/**
 * Result of initialization attempt
 */
export interface GoogleChatInitResult {
    /** Whether initialization was attempted */
    attempted: boolean;
    /** Whether initialization succeeded */
    success: boolean;
    /** Error message if failed */
    error?: string;
}
/**
 * Options for Google Chat initialization
 */
export interface GoogleChatInitOptions {
    /** Optional MessageQueueService for enqueuing incoming Pub/Sub messages */
    messageQueueService?: MessageQueueService;
}
/**
 * Create the incoming message callback for Google Chat Pub/Sub mode.
 *
 * This is the single shared callback used by both `messenger.routes.ts`
 * (manual connect) and the auto-reconnect flow in this module. It enqueues
 * incoming Pub/Sub messages into the MessageQueueService, registers thread
 * mappings in the terminal gateway, and stores conversation history in
 * the thread store.
 *
 * @param queueService - The message queue service to enqueue into
 * @param adapter - The Google Chat adapter for sending replies
 * @returns Callback function for incoming messages
 */
export declare function createIncomingCallback(queueService: MessageQueueService, adapter: GoogleChatMessengerAdapter): (msg: IncomingMessage) => void;
/**
 * Initialize Google Chat integration from saved credentials.
 *
 * Designed to be called during backend startup. Checks for a saved
 * credentials file and reinitializes the adapter if found. For Pub/Sub
 * mode, also restarts the pull loop with the incoming message callback.
 *
 * @param options - Optional initialization options
 * @returns Result object indicating success or failure
 */
export declare function initializeGoogleChatIfConfigured(options?: GoogleChatInitOptions): Promise<GoogleChatInitResult>;
//# sourceMappingURL=google-chat-initializer.d.ts.map