Create a new FileSystemWatcher.
Watch configuration.
OptionalchangeSource?: "chokidar" | "parcel"The local change source (D125); usePolling: true forces chokidar.
OptionaldebounceMs?: numberDebounce delay in milliseconds for file change events.
Glob patterns to ignore.
OptionalindexCheckOnStart?: booleanIndex check at start (D197).
OptionalmoveDetection?: { bufferMs: number; enabled: boolean }Move detection configuration for correlating unlink+add as file moves.
Buffer time in ms for holding unlink events before treating as deletes. Default: 2000.
Enable move correlation. Default: true.
Glob patterns or watch path objects to watch.
OptionalpollIntervalMs?: numberPolling interval in milliseconds.
OptionalreconcileIntervalMs?: numberPeriodic reconciliation interval (D111); 0 disables it.
OptionalrespectGitignore?: booleanWhether to respect .gitignore files when processing.
OptionalstabilityThresholdMs?: numberTime in milliseconds a file must be stable before processing.
OptionalusePolling?: booleanWhether to use polling instead of native watchers.
The event queue.
The document processor.
The logger instance.
Optional health/fatal error options.
What the index check at start reads (D197); undefined before start.
The running watcher's inventory (D99), undefined before start.
Whether the initial filesystem scan is complete.
Whether a rebuild must exit for a restart (D196): the running source, or one this watcher stopped (its watches stay live), cannot release its watches in-process (parcel on Windows).
Get the system health tracker.
A classified event from the change source (chokidar), with the stats it read, if any.
Optionalstats: StatsThe inventory's file paths (absolute, as the source reported them): matched files only, never directories or filtered files (D83). No filesystem I/O; empty before start.
The source finished its initial set for a root; the scan completes when every root has.
A raw parcel batch (D149): into the FIFO, classified from the disk and applied in order.
Re-arm the periodic reconcile timers with the live interval: a reload
that changed only watch.reconcileIntervalMs needs no rebuild (D111).
The source re-created a root's subscription after an error (D131).
A root is reachable again (D109).
A root is unreachable (D109), or reachable but unwatched (D156).
Optionaloptions: RootUnavailableOptionsStart watching the filesystem and processing events. With parcel the roots are subscribed first, then walked in the background (D58).
Stop the filesystem watcher.
Filesystem watcher. A change source only reports events (D120); this class filters them, keeps the inventory (D99) and maps them to the processing queue.