/**
 * @fileoverview Image Watcher - Detects new image files in session working directories
 *
 * Watches session working directories for new image files (screenshots, generated images)
 * and emits events to trigger automatic popup display in the web UI.
 *
 * Uses chokidar for reliable cross-platform file watching with awaitWriteFinish
 * to ensure files are fully written before emitting detection events.
 */
import { EventEmitter } from 'node:events';
/**
 * Watches session working directories for new image files.
 *
 * Follows the SubagentWatcher pattern: extends EventEmitter, manages
 * file watchers in Maps, emits typed events.
 *
 * @example
 * ```typescript
 * const watcher = new ImageWatcher();
 * watcher.on('image:detected', (event) => {
 *   console.log(`New image in session ${event.sessionId}: ${event.fileName}`);
 * });
 * watcher.watchSession('session-123', '/path/to/working/dir');
 * ```
 */
export declare class ImageWatcher extends EventEmitter {
    /** Map of sessionId -> FSWatcher for per-session directory watching */
    private sessionWatchers;
    /** Map of sessionId -> working directory path */
    private sessionDirs;
    /** Per-file debouncer for rapid image creation */
    private fileDeb;
    /** Track which session owns each debounced file (for cleanup) */
    private fileToSession;
    /** Per-session burst tracking: sessionId -> { count, windowStart } */
    private burstTrackers;
    /** Whether the watcher is currently running */
    private _isRunning;
    constructor();
    /**
     * Check if the watcher is currently running
     */
    isRunning(): boolean;
    /**
     * Start the image watcher.
     * After calling start(), use watchSession() to add directories to monitor.
     */
    start(): void;
    /**
     * Stop the image watcher and clean up all resources.
     */
    stop(): void;
    /**
     * Start watching a session's working directory for new images.
     *
     * @param sessionId - Codeman session ID
     * @param workingDir - Path to the session's working directory
     */
    watchSession(sessionId: string, workingDir: string): void;
    /**
     * Stop watching a session's working directory.
     *
     * @param sessionId - Codeman session ID to stop watching
     */
    unwatchSession(sessionId: string): void;
    /**
     * Get list of currently watched session IDs.
     */
    getWatchedSessions(): string[];
    /**
     * Handle a new file being detected.
     * Verifies it's a previewable image/document and emits the detection event.
     */
    private handleNewFile;
    /**
     * Emit the image:detected event with file metadata.
     */
    private emitImageDetected;
    /**
     * Emit the attachment:detected event with file metadata.
     */
    private emitAttachmentDetected;
    private getAttachmentType;
}
export declare const imageWatcher: ImageWatcher;
//# sourceMappingURL=image-watcher.d.ts.map