import { EventEmitter } from 'events';
export type WatchChangeType = 'added' | 'modified' | 'deleted';
export interface FileChange {
    path: string;
    type: WatchChangeType;
}
export interface FileChangeEvent {
    changes: FileChange[];
    timestamp: number;
}
export interface FileWatcherOptions {
    projectPath: string;
    debounceMs?: number;
}
/**
 * File watcher for ADK agent projects
 *
 * Watches the following patterns:
 * - src/**\/*
 * - agent.config.ts
 * - package.json
 * - agent.json
 */
export declare class FileWatcher extends EventEmitter {
    private projectPath;
    private watchers;
    private fileStates;
    private debounceMs;
    private debounceTimer;
    private pendingChanges;
    private pendingRootMtimeCheck;
    constructor(options: FileWatcherOptions);
    /**
     * Start watching files
     */
    start(): void;
    /**
     * Initialize state for all files in a directory (recursive)
     */
    private initializeDirectoryState;
    /**
     * Watch the project-root config files (package.json, agent.json,
     * agent.config.ts) via a single non-recursive directory watcher, filtered by
     * name. Events for anything else in the root (temp files, node_modules
     * shuffles) are ignored. Directory watches report renames by NAME, so atomic
     * saves keep working — and a root file created later is picked up too.
     */
    private watchRootFiles;
    /**
     * Coalesce root mtime sweeps: mark one pending and piggyback on the next
     * debounce tick. Multiple rapid root events (both halves of an atomic save,
     * node_modules churn) collapse into a single stat sweep.
     */
    private scheduleRootMtimeCheck;
    private checkRootFilesByMtime;
    /**
     * Watch a directory recursively
     */
    private watchDirectory;
    /**
     * Handle file change events - accumulates changes for batch emission
     */
    private handleFileChange;
    /**
     * Emit all pending changes as a single event
     */
    private emitPendingChanges;
    /**
     * Scan a directory for added, deleted, or silently-replaced files compared
     * to tracked state. Used on Linux where fs.watch reports directory-level
     * events, and on macOS to recover atomic saves whose rename target never
     * got its own event (modification detected by mtime, see handleFileChange).
     */
    private scanDirectoryForChanges;
    /**
     * Schedule a debounced emission of pending changes
     */
    private scheduleDebouncedEmit;
    /**
     * Update internal file state tracking. Stores the file's mtime (not the
     * observation time) so scanDirectoryForChanges can detect files replaced
     * behind the watcher's back by comparing against the current mtime.
     */
    private updateFileState;
    /**
     * Stop watching all files
     */
    stop(): void;
    /**
     * Type-safe event listener
     */
    on(event: 'change', listener: (event: FileChangeEvent) => void): this;
    /**
     * Type-safe event emitter
     */
    emit(event: 'change', data: FileChangeEvent): boolean;
}
//# sourceMappingURL=watcher.d.ts.map