interface RescanDeps

The fs calls rescanDirectoryForDelta makes — injectable so a platform-specific readdir/stat disagreement can be reproduced deterministically. Production uses the real fs.

import * as FileWatcher from './file-watcher.ts';

import { readdir, stat } from 'node:fs/promises';

const deps: FileWatcher.RescanDeps = { readdir, stat }; // the production default; tests inject fakes

Properties

readdir: readdir

Lists the directory tree. Its dirent types are unreliable on Windows — see isMissing.

stat: stat

Resolves a path (follows symlinks). Used to drop entries that are genuinely gone.

Usage

import { type RescanDeps } from "lib/setup/file-watcher.ts";