use std::collections::{BTreeMap, HashMap};
use std::path::PathBuf;
use std::time::Instant;
use crate::extraction::index::ScopeIgnore;
use super::backend::WatchHandle;
use super::types::{
DegradedCallback, PendingInfo, SyncCompleteCallback, SyncErrorCallback, SyncFn,
};
pub struct FileWatcher {
pub(super) recursive_watcher: Option<Box<dyn WatchHandle>>,
pub(super) dir_watchers: HashMap<PathBuf, Box<dyn WatchHandle>>,
pub(super) dir_cap_warned: bool,
pub(super) inotify_limit_warned: bool,
pub(super) degraded_reason: Option<String>,
pub(super) lock_retry_count: usize,
pub(super) inert: bool,
pub(super) scheduled_at: Option<Instant>,
pub(super) scheduled_delay_ms: Option<u64>,
pub(super) pending_files: BTreeMap<String, PendingInfo>,
pub(super) sync_started_ms: i64,
pub(super) syncing: bool,
pub(super) stopped: bool,
pub(super) ready: bool,
pub(super) ignore_matcher: Option<ScopeIgnore>,
pub(super) project_root: PathBuf,
pub(super) debounce_ms: u64,
pub(super) sync_fn: SyncFn,
pub(super) on_sync_complete: Option<SyncCompleteCallback>,
pub(super) on_sync_error: Option<SyncErrorCallback>,
pub(super) on_degraded: Option<DegradedCallback>,
pub(super) inert_for_tests: bool,
}