/**
 * File Watcher Service
 *
 * Provides robust cross-platform file watching using Chokidar library.
 * Handles file watching with debouncing, error recovery, and graceful fallbacks.
 */
import { EventEmitter } from "events";
import type { Logger } from "../types/index.js";
export interface FileWatchEvent {
    type: "change" | "create" | "delete" | "rename";
    path: string;
    timestamp: number;
    size?: number;
}
export interface FileWatcherConfig {
    stabilityThreshold: number;
    pollInterval: number;
    maxRetries: number;
    fallbackPolling: boolean;
    ignoreTempFiles: boolean;
}
export interface FileWatcherStatus {
    isActive: boolean;
    path: string;
    method: "native" | "polling" | "failed";
    errorCount: number;
    lastError?: string;
    lastEvent?: FileWatchEvent;
}
export declare class FileWatcherService extends EventEmitter {
    private watchers;
    private globalWatcher;
    private defaultConfig;
    private logger?;
    constructor(logger?: Logger, config?: Partial<FileWatcherConfig>);
    /**
     * Start watching a file
     * Maps to FR-010: Handle file deletion, creation, and modification
     */
    watchFile(path: string, callback: (event: FileWatchEvent) => void): Promise<void>;
    /**
     * Stop watching a file
     * Resource cleanup
     */
    unwatchFile(path: string): Promise<void>;
    /**
     * Get watcher status
     * Maps to FR-012: Handle watcher initialization failures
     */
    getWatcherStatus(path: string): FileWatcherStatus | null;
    /**
     * Get all watcher statuses
     * For monitoring and debugging
     */
    getAllWatcherStatuses(): FileWatcherStatus[];
    /**
     * Cleanup all watchers
     */
    cleanup(): Promise<void>;
    private initializeWatcher;
    private setupGlobalWatcherEvents;
    private handleFileEvent;
}
//# sourceMappingURL=fileWatcher.d.ts.map