Skip to content

Upgrading chokidar 5 to 6

Breaking5.0.0 → 6.0.0Breaking3Platform1Deprecated3New2Changed4Fixed25Other3

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • After you call close(), you can no longer add paths to that watcher; create a new one.
  • Invalid option values now fail immediately when the watcher is created instead of being silently accepted.
  • The object returned by getWatched() no longer inherits from Object.prototype, so check keys with Object.hasOwn() instead of hasOwnProperty().
  • You must run Node.js version 22.22 or newer to use this version.
Top 5 of 6 that need code or config changes

Node.js requirement changed in 6.0.0: >= 20.19.0 → >= 22.22.

Breaking3
Makes close() terminal: add() now throws once closing has started, so a new watcher must be constructed instead.
close()add()
Validates options in the constructor, throwing TypeError for invalid backend, atomic, depth, awaitWriteFinish, and polling intervals.
backendatomicdepthawaitWriteFinish
Makes getWatched() return a null-prototype object so a directory named __proto__ is listed; use Object.hasOwn() on the result.
getWatched()Object.hasOwn()hasOwnProperty()
Platform1
Requires Node.js 22.22 or later.
Deprecated2
Deprecates usePolling: true as an alias for backend: 'polling'.
usePollingbackend
Renames interval and binaryInterval to pollingInterval and pollingBinaryInterval, keeping the old names as deprecated aliases.
intervalbinaryIntervalpollingIntervalpollingBinaryInterval

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: function allocateSharedResourceGeneration(): number
  • added: function attachSharedSubscriber<Subscriber>(resource: SharedResourceState<Subscriber>, subscriber: Subscriber): boolean
  • added: function backendNow(): number
  • added: function createSharedResourceState<Subscriber>(resource: BackendResourceKey, subscribers?: Iterable<Subscriber>): SharedResourceState<Subscriber>
  • added: function detachSharedSubscriber<Subscriber>(resource: SharedResourceState<Subscriber>, subscriber: Subscriber): 'remaining' | 'last' | undefined
  • added: function failNativeWatch(path: string, error: Error & { code: string }): Promise<boolean>
  • added: function failRecursiveWatch(path: string, error: unknown): boolean
  • added: function invalidateSharedResource<Subscriber>(resource: SharedResourceState<Subscriber>): readonly Subscriber[] | undefined
  • added: function isMissingObservation(observation: PollObservation): observation is MissingPollObservation
  • added: function nativeResourceCountForTests(): number
  • added: function selectBackend(options: Pick<ChokidarOptions, 'backend' | 'depth'>): BackendCapabilities
  • added: function setFsWatchListener(path: string, fullPath: string, options: Partial<FSWInstanceOptions>, handlers: BackendHandlers, signal: AbortSignal): BackendSubscription | undefined
  • added: function setNativeWatchFactoryForTests(factory?: NativeWatchFactory): void
  • added: function setPollingListener(path: Path, fullPath: Path, options: PollingSubscriptionOptions, scheduler: Scheduler, handlers: BackendHandlers, initialStats: Stats | undefined, signal: AbortSignal): BackendSubscription | undefined
  • added: function setRecursiveWatchFactoryForTests(factory?: RecursiveWatchFactory): void
  • added: function subscribeRecursiveNative(path: string, persistent: boolean, handlers: Omit<RecursiveNativeSubscriber, 'watchedPath' | 'persistent'>, signal: AbortSignal): RecursiveSubscriptionResult
  • added: type BackendCapabilities = Readonly<{ kind: BackendStrategy; polling: boolean; recursive: boolean; perDirectory: boolean }>
  • added: type FsWatchContainer = SharedResourceState<NativeSubscriber> & { watcher: NativeFsWatcher; sequence: number }
  • added: type NativeWatchFactory = (path: string, options: { persistent: boolean | undefined }, listener: WatchListener<string>) => NativeFsWatcher
  • added: type RecursiveSubscriptionResult = { kind: 'subscribed'; subscription: BackendSubscription } | { kind: 'unsupported' } | { kind: 'failed'; error: unknown }
  • added: type RecursiveWatchFactory = (path: string, options: { persistent: boolean; recursive: true }, listener: WatchListener<string>) => NativeFsWatcher
  • added: type SharedResourceState<Subscriber> = { readonly resource: BackendResourceKey; readonly generation: number; readonly subscribers: Set<Subscriber>; closed: boolean }
  • removed: class NodeFsHandler
  • removed: const EMPTY_FN: () => void
  • removed: const EVENTS: { readonly ALL: 'all'; readonly READY: 'ready'; readonly ADD: 'add'; readonly CHANGE: 'change'; readonly ADD_DIR: 'addDir'; readonly UNLINK: 'unlink'; readonly…
  • removed: const IDENTITY_FN: (val: unknown) => unknown
  • removed: const STR_CLOSE = 'close'
  • removed: const STR_DATA = 'data'
  • removed: const STR_END = 'end'
  • removed: const isFreeBSD: boolean
  • removed: const isIBMi: boolean
  • removed: const isLinux: boolean
  • removed: const isMacos: boolean
  • removed: const isWindows: boolean
  • removed: constructor NodeFsHandler(fsW: FSWatcher)
  • removed: interface WatchHandlers
  • removed: method NodeFsHandler._addToNodeFs(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string): Promise<string | false | undefined>
  • removed: method NodeFsHandler._handleDir(dir: string, stats: Stats, initialAdd: boolean, depth: number, target: string | undefined, wh: WatchHelper, realpath: string): Promise<(() => void) | undefined>
  • removed: method NodeFsHandler._handleFile(file: Path, stats: Stats, initialAdd: boolean): (() => void) | undefined
  • removed: method NodeFsHandler._handleRead(directory: string, initialAdd: boolean, wh: WatchHelper, target: Path | undefined, dir: Path, depth: number, throttler: Throttler): Promise<unknown> | undefined
  • removed: method NodeFsHandler._handleSymlink(entry: EntryInfo, directory: string, path: Path, item: string): Promise<boolean | undefined>
  • removed: method NodeFsHandler._watchWithNodeFs(path: string, listener: (path: string, newStats?: any) => void | Promise<void>): (() => void) | undefined
  • removed: property NodeFsHandler._boundHandleError: (error: unknown) => void
  • removed: property NodeFsHandler.fsw: FSWatcher
  • removed: property WatchHandlers.errHandler: (err: unknown) => void
  • removed: property WatchHandlers.listener: (path: string) => void
  • removed: property WatchHandlers.rawEmitter: (ev: WatchEventType, path: string, opts: unknown) => void
  • removed: type EventName = (typeof EVENTS)[keyof typeof EVENTS]
  • removed: type FsWatchContainer = { listeners: (path: string) => void | Set<any>; errHandlers: (err: unknown) => void | Set<any>; rawEmitters: (ev: WatchEventType, path: string, opts: unknown)…
  • removed: type Path = string
  • removed: class WatchHelper
  • removed: constructor WatchHelper(path: string, follow: boolean, fsw: FSWatcher)
  • removed: interface MatcherObject
  • removed: method FSWatcher._addIgnoredPath(matcher: Matcher): void
  • removed: method FSWatcher._addPathCloser(path: Path, closer: () => void): void
  • removed: method FSWatcher._awaitWriteFinish(path: Path, threshold: number, event: EventName, awfEmit: (err?: Error, stat?: Stats) => void): void
  • removed: method FSWatcher._closeFile(path: Path): void
  • removed: method FSWatcher._closePath(path: Path): void
  • removed: method FSWatcher._emit(event: EventName, path: Path, stats?: Stats): Promise<this | undefined>
  • removed: method FSWatcher._getWatchHelpers(path: Path): WatchHelper
  • removed: method FSWatcher._getWatchedDir(directory: string): DirEntry
  • removed: method FSWatcher._handleError(error: Error): Error | boolean
  • removed: method FSWatcher._hasReadPermissions(stats: Stats): boolean
  • removed: method FSWatcher._incrReadyCount(): number
  • removed: method FSWatcher._isIgnored(path: Path, stats?: Stats): boolean
  • removed: method FSWatcher._isntIgnored(path: Path, stat?: Stats): boolean
  • removed: method FSWatcher._readdirp(root: Path, opts?: Partial<ReaddirpOptions>): ReaddirpStream | undefined
  • removed: method FSWatcher._remove(directory: string, item: string, isDirectory?: boolean): void
  • removed: method FSWatcher._removeIgnoredPath(matcher: Matcher): void
  • removed: method FSWatcher._throttle(actionType: ThrottleType, path: Path, timeout: number): Throttler | false
  • removed: method FSWatcher.emitWithAll(event: EventName, args: EmitArgs): void
  • removed: method WatchHelper.entryPath(entry: EntryInfo): Path
  • removed: method WatchHelper.filterDir(entry: EntryInfo): boolean
  • removed: method WatchHelper.filterPath(entry: EntryInfo): boolean
  • removed: property FSWatcher._boundRemove: (dir: string, item: string) => void
  • removed: property FSWatcher._closePromise?: Promise<void>
  • removed: property FSWatcher._closers: Map<string, Array<any>>
  • removed: property FSWatcher._emitRaw: WatchHandlers['rawEmitter']
  • removed: property FSWatcher._emitReady: () => void
  • removed: property FSWatcher._ignoredPaths: Set<Matcher>
  • removed: property FSWatcher._nodeFsHandler: NodeFsHandler
  • removed: property FSWatcher._pendingUnlinks: Map<string, EmitArgsWithName>
  • removed: property FSWatcher._pendingWrites: Map<string, any>
  • removed: property FSWatcher._readyCount: number
  • removed: property FSWatcher._readyEmitted: boolean
  • removed: property FSWatcher._streams: Set<ReaddirpStream>
  • removed: property FSWatcher._symlinkPaths: Map<Path, string | boolean>
  • removed: property FSWatcher._throttled: Map<ThrottleType, Map<any, any>>
  • removed: property FSWatcher._userIgnored?: MatchFunction
  • removed: property FSWatcher._watched: Map<string, DirEntry>
  • removed: property FSWatcher.closed: boolean
  • removed: property MatcherObject.path: string
  • removed: property MatcherObject.recursive?: boolean
  • removed: property WatchHelper.dirParts: string[][]
  • removed: property WatchHelper.followSymlinks: boolean
  • removed: property WatchHelper.fsw: FSWatcher
  • removed: property WatchHelper.fullWatchPath: string
  • removed: property WatchHelper.path: string
  • removed: property WatchHelper.statMethod: 'stat' | 'lstat'
  • removed: property WatchHelper.watchPath: string
  • removed: type AWF = { stabilityThreshold: number; pollInterval: number }
  • removed: type ChokidarOptions = Partial<BasicOpts & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF> }>
  • removed: type EmitArgs = [path: Path, stats?: Stats]
  • removed: type EmitArgsWithName = [event: EventName, ...EmitArgs]
  • removed: type EmitErrorArgs = [error: Error, stats?: Stats]
  • removed: type FSWInstanceOptions = BasicOpts & { ignored: Matcher[]; awaitWriteFinish: false | AWF }
  • removed: type MatchFunction = (val: string, stats?: Stats) => boolean
  • removed: type Matcher = string | RegExp | MatchFunction | MatcherObject
  • removed: type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change'
  • removed: type Throttler = { timeoutObject: NodeJS.Timeout; clear: () => void; count: number }
  • changed: constructor FSWatcher(_opts?: ChokidarOptions) → constructor FSWatcher(_opts?: ChokidarOptions, scheduler?: Scheduler)
  • changed: method FSWatcher.add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher → method FSWatcher.add(paths_: Path | Path[]): FSWatcher
  • added: export { AWF } from './runtime'
  • added: export { BackendStrategy } from './runtime'
  • added: export { ChokidarOptions } from './runtime'
  • added: export { EmitArgs } from './runtime'
  • added: export { EmitArgsWithName } from './runtime'
  • added: export { EmitErrorArgs } from './runtime'
  • added: export { FSWInstanceOptions } from './runtime'
  • added: export { MatchFunction } from './runtime'
  • added: export { Matcher } from './runtime'
  • added: export { MatcherObject } from './runtime'
  • added: export { Scheduler } from './runtime'
  • added: export { SchedulerTimer } from './runtime'
  • added: export { ThrottleType } from './runtime'
  • added: export { Throttler } from './runtime'
  • added: export { WatchBackend } from './runtime'
  • added: get FSWatcher.closed(): boolean
  • added: method FSWatcher.addPathCloser(path: Path, closer: () => void | Promise<void>): void
  • added: method FSWatcher.capturePathGeneration(): number
  • added: method FSWatcher.closePath(path: Path, recursive?: boolean): void
  • added: method FSWatcher.createHelper(path: Path): WatchHelper
  • added: method FSWatcher.createScanStream(root: Path, opts?: Partial<ReaddirpOptions>): ReaddirpStream | undefined
  • added: method FSWatcher.emitEvent(event: EventName, path: Path, stats?: Stats): Promise<void>
  • added: method FSWatcher.emitRaw(...args: Parameters<WatchHandlers['rawEmitter']>): void
  • added: method FSWatcher.handleError(error: unknown): void
  • added: method FSWatcher.isIgnored(path: Path, stats?: Stats): boolean
  • added: method FSWatcher.isPathGenerationActive(path: Path, generation: number): boolean
  • added: method FSWatcher.isUnwatched(path: Path): boolean
  • added: method FSWatcher.removePath(directory: string, item: string, isDirectory?: boolean): void
  • added: method FSWatcher.rewatchMissingPath(path: Path): void
  • added: property FSWatcher.readyEmitted: boolean
  • added: readonly property FSWatcher.events: EventPolicy
  • added: readonly property FSWatcher.handler: ObservationEngine
  • added: readonly property FSWatcher.lifecycle: LifecycleScope
  • added: readonly property FSWatcher.reconciliation: ReconciliationQueue
  • added: readonly property FSWatcher.scheduler: Scheduler
  • added: readonly property FSWatcher.streams: Set<ReaddirpStream>
  • added: readonly property FSWatcher.tree: TreeState
  • added: class EventPolicy
  • added: constructor EventPolicy(context: EventPolicyContext)
  • added: method EventPolicy.awaitWriteFinish(path: Path, threshold: number, event: EventName, awfEmit: (error?: Error, stats?: Stats) => void, logicalKey?: LogicalPathKey): void
  • added: method EventPolicy.cancelPath(path: Path): void
  • added: method EventPolicy.cancelWhere(contains: (path: string) => boolean): void
  • added: method EventPolicy.close(): void
  • added: method EventPolicy.emit(event: EventName, path: Path, stats?: Stats): Promise<void>
  • added: method EventPolicy.throttle(actionType: ThrottleType, path: Path, timeout: number, onRelease?: (suppressedCount: number) => void): Throttler | false
  • added: readonly property EventPolicy.heldAdds: Map<string, HeldAdd>
  • added: readonly property EventPolicy.pendingChanges: Map<string, PendingChangeEmission>
  • added: readonly property EventPolicy.pendingUnlinks: Map<string, { event: EmitArgsWithName; timer: SchedulerTimer }>
  • added: readonly property EventPolicy.pendingWrites: Map<string, PendingWrite>
  • added: readonly property EventPolicy.throttled: Map<ThrottleType, Map<string, Throttler>>
  • added: type PendingChangeEmission = { path: Path; stats?: Stats; replay: boolean; held?: { timer: SchedulerTimer; release: () => void } }
  • added: type PendingWrite = { lastChange: number; cancelWait: () => EventName }
  • added: class ObservationEngine
  • added: constructor ObservationEngine(fsW: WatcherContext)
  • added: method ObservationEngine.addPathOnce(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string, pathGeneration?: number): Promise<AddPathOutcome>
  • added: method ObservationEngine.addRoot(path: string, initialAdd: boolean, pathGeneration: number, target?: string): Promise<void>
  • added: method ObservationEngine.handleDirectory(dir: string, stats: Stats, initialAdd: boolean, depth: number, target: string | undefined, wh: WatchHelper): Promise<(() => void | Promise<void>) | undefined>
  • added: method ObservationEngine.handleFile(file: Path, stats: Stats, initialAdd: boolean, watchResource?: boolean, trigger?: NativeTrigger, initialRecursive?: boolean, retainObservation?: boolean): (() => void | Promise<void>) | undefined
  • added: method ObservationEngine.handleSymlink(entry: EntryInfo, directory: string, path: Path, item: string, initialAdd: boolean, wh?: WatchHelper): Promise<boolean | undefined>
  • added: method ObservationEngine.isHelperActive(wh: WatchHelper, path?: string): boolean
  • added: method ObservationEngine.readDirectory(directory: string, initialAdd: boolean, wh: WatchHelper, target: Path | undefined, dir: Path, depth: number): Promise<void> | undefined
  • added: method ObservationEngine.reconcileBackendTrigger(scope: string, mapRelative: boolean, trigger: BackendTrigger, reconcile: (candidate: string) => void | Promise<void>, isActive?: () => boolean, coalesce?: boolean, queueScope?: string): Promise<void>
  • added: method ObservationEngine.reconcileNativeTrigger(root: string, rootHelper: WatchHelper, trigger: NativeTrigger, candidateOverride?: string, baseDepth?: number, exact?: ExactCandidate): Promise<void>
  • added: method ObservationEngine.rescanRecursiveTree(dir: string, wh: WatchHelper, baseDepth: number): Promise<void>
  • added: method ObservationEngine.scanRecursiveTree(dir: string, initialAdd: boolean, wh: WatchHelper, baseDepth: number, rescan?: RecursiveRescan): Promise<void> | undefined
  • added: method ObservationEngine.subscribeMappedFile(logicalPath: string, targetPath: string, helper: WatchHelper, depth: number, useExactFallback?: boolean): (() => void | Promise<void>) | undefined
  • added: method ObservationEngine.subscribePath(path: string, listener: (path: string, newStats: Stats | undefined, trigger: BackendTrigger) => void | Promise<void>, initialStats?: Stats, mapRelative?: boolean, queueScope?: string): (() => void | Promise<void>) | undefined
  • added: method ObservationEngine.watchRecursiveDirectory(dir: string, initialAdd: boolean, depth: number, wh: WatchHelper): Promise<(() => void | Promise<void>) | false | undefined>
  • added: method ObservationEngine.watchRootParent(dir: string, wh: WatchHelper): (() => void | Promise<void>) | undefined
  • added: method ObservationEngine.watchSymlinkDeletion(path: string, force?: boolean): (() => void) | undefined
  • added: property ObservationEngine.fsw: WatcherContext
  • added: property ObservationEngine.reportError: (error: unknown) => void
  • added: class WatchHelper
  • added: const EVENTS: { readonly ALL: 'all'; readonly READY: 'ready'; readonly ADD: 'add'; readonly CHANGE: 'change'; readonly ADD_DIR: 'addDir'; readonly UNLINK: 'unlink'; readonly…
  • added: const isFreeBSD: boolean
  • added: const isIBMi: boolean
  • added: const isLinux: boolean
  • added: const isMacos: boolean
  • added: const isWindows: boolean
  • added: const systemScheduler: Scheduler
  • added: constructor WatchHelper(path: string, follow: boolean, context: WatchHelperContext)
  • added: function classifyError(error: unknown): ErrorClass
  • added: function cloneOwnedMatcher(matcher: Matcher): Matcher
  • added: function compileMatchers(matchers: readonly Matcher[]): MatchFunction
  • added: function errorCode(error: unknown): string | undefined
  • added: function isMatcherObject(matcher: Matcher): matcher is MatcherObject
  • added: function isMissingError(error: unknown): boolean
  • added: function isPermissionError(error: unknown): boolean
  • added: function isRecursiveWatchUnsupported(error: unknown): boolean
  • added: function isSameOrInside(root: Path, candidate: Path): boolean
  • added: function isStrictlyInside(root: Path, candidate: Path): boolean
  • added: function logicalPathKey(path: Path): LogicalPathKey
  • added: function normalizeMatcher(matcher: Matcher, cwd?: string): Matcher
  • added: function normalizePath(path: Path): Path
  • added: function statIdentity(stats: Stats): StatIdentity
  • added: interface BackendSubscription
  • added: interface Scheduler
  • added: interface SchedulerTimer
  • added: interface WatchHandlers
  • added: method BackendSubscription.close(): void | Promise<void>
  • added: method Scheduler.clearTimeout(timer: SchedulerTimer | undefined): void
  • added: method Scheduler.now(): number
  • added: method Scheduler.setTimeout(callback: () => void, delay: number): SchedulerTimer
  • added: method SchedulerTimer.ref(): SchedulerTimer
  • added: method SchedulerTimer.unref(): SchedulerTimer
  • added: method WatchHelper.filterDir(entry: EntryInfo): boolean
  • added: method WatchHelper.filterPath(entry: EntryInfo): boolean
  • added: method WatchHelper.fork(path: string): WatchHelper
  • added: method WatchHelper.withObservation(trigger: NativeTrigger): WatchHelper
  • added: property WatchHandlers.errHandler: (err: unknown) => void
  • added: property WatchHandlers.rawEmitter: (ev: WatchEventType, path: string | null, opts: unknown) => void
  • added: property WatchHelper.followSymlinks: boolean
  • added: property WatchHelper.observationTrigger?: NativeTrigger
  • added: property WatchHelper.pathGeneration: number
  • added: property WatchHelper.realpathAncestry: Set<string>
  • added: property WatchHelper.recursiveDisabled?: boolean
  • added: property WatchHelper.recursiveRoot?: string
  • added: property WatchHelper.watchPath: string
  • added: readonly property BackendSubscription.resource: BackendResourceKey
  • added: type AWF = { stabilityThreshold: number; pollInterval: number }
  • added: type BackendResourceKey = string & { readonly __backendResourceKey: unique symbol }
  • added: type BackendStrategy = 'polling' | 'native-per-directory' | 'native-recursive-preferred'
  • added: type BackendTrigger = NativeTrigger | PollTrigger
  • added: type ChokidarOptions = Partial<BasicOptions & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF> }>
  • added: type EmitArgs = [path: Path, stats?: Stats]
  • added: type EmitArgsWithName = [event: EventName, ...EmitArgs]
  • added: type EmitErrorArgs = [error: Error, stats?: Stats]
  • added: type ErrorClass = 'missing' | 'permission' | 'recursive-unsupported' | 'other'
  • added: type EventName = (typeof EVENTS)[keyof typeof EVENTS]
  • added: type FSWInstanceOptions = BasicOptions & { ignored: readonly Matcher[]; awaitWriteFinish: false | AWF; backendStrategy: BackendStrategy; backendCapabilities: import('./backend.js').Back…
  • added: type LogicalPathKey = string & { readonly __logicalPathKey: unique symbol }
  • added: type MatchFunction = (val: string, stats?: Stats) => boolean
  • added: type Matcher = string | RegExp | MatchFunction | MatcherObject
  • added: type MatcherObject = { path: string; recursive?: boolean }
  • added: type MissingPollObservation = { missing: true }
  • added: type NativeTrigger = { kind: 'native'; resource: BackendResourceKey; rawEvent: WatchEventType; relativePath: string | null; sequence: number; observedAt: number }
  • added: type Path = string
  • added: type PollObservation = Stats | MissingPollObservation
  • added: type PollTrigger = { kind: 'poll'; resource: BackendResourceKey; current: PollObservation; previous?: PollObservation; sequence: number; observedAt: number }
  • added: type StatIdentity = { size: number; mtimeMs: number; ino: number }
  • added: type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change'
  • added: type Throttler = { timeoutObject: SchedulerTimer; clear: (invokeRelease?: boolean) => number; count: number }
  • added: type WatchBackend = 'auto' | 'native' | 'native-recursive' | 'polling'
  • added: type WatchHelperContext = { capturePathGeneration: () => number; isntIgnored: (path: Path, stats?: EntryInfo['stats']) => boolean }
  • added: class DirEntry
  • added: class LifecycleScope
  • added: class ReconciliationQueue
  • added: class TreeState
  • added: constructor DirEntry(dir: Path)
  • added: constructor LifecycleScope(onTaskSettled: () => void, onTaskError: (error: unknown) => void)
  • added: constructor ReconciliationQueue(lifecycle: LifecycleScope)
  • added: constructor TreeState(observesNative: () => boolean)
  • added: function resolveRecursiveCandidate(root: string, relativePath: string): string | undefined
  • added: interface WatcherContext
  • added: method DirEntry.add(item: string): void
  • added: method DirEntry.dispose(): void
  • added: method DirEntry.getChildren(): string[]
  • added: method DirEntry.has(item: string): boolean
  • added: method DirEntry.remove(item: string): boolean
  • added: method LifecycleScope.addCloser(key: string, closer: Closer): void
  • added: method LifecycleScope.beginClose(): Promise<void>[]
  • added: method LifecycleScope.drain(): Promise<void>
  • added: method LifecycleScope.finishClose(): void
  • added: method LifecycleScope.isActive(generation: number): boolean
  • added: method LifecycleScope.takeClosers(key: string): Closer[]
  • added: method LifecycleScope.track<T>(task: Promise<T>): Promise<T>
  • added: method ReconciliationQueue.clear(): void
  • added: method ReconciliationQueue.enqueue(scope: Path, work: () => Promise<void>, coalescePath?: Path | false): Promise<void>
  • added: method ReconciliationQueue.forgetPending(predicate: (scope: string, candidate: string) => boolean): void
  • added: method TreeState.changedSinceObserved(path: Path, stats: Stats): boolean
  • added: method TreeState.clearInitialCreate(path: Path): void
  • added: method TreeState.clearInitialCreates(root: Path): void
  • added: method TreeState.consumeInitialCreate(path: Path, stats: Stats, trigger: NativeTrigger, ignoreInitial: boolean): EventName | false | undefined
  • added: method TreeState.dispose(): void
  • added: method TreeState.getDirectory(directory: string): DirEntry
  • added: method TreeState.isDuplicateObservation(path: Path, stats: Stats, trigger: NativeTrigger): boolean
  • added: method TreeState.markInitialCreate(path: Path): void
  • added: method TreeState.peekDirectory(directory: string): DirEntry | undefined
  • added: method TreeState.recordObserved(path: Path, stats: Stats, transition?: ObservedPathFact['transition'], trigger?: NativeTrigger, initialRecursive?: boolean, retainWithoutTrigger?: boolean): void
  • added: method TreeState.replacedSinceObserved(path: Path, stats: Stats): boolean
  • added: method WatcherContext.addPathCloser(path: Path, closer: PathCloser): void
  • added: method WatcherContext.capturePathGeneration(): number
  • added: method WatcherContext.closePath(path: Path, recursive?: boolean): void
  • added: method WatcherContext.createHelper(path: Path): WatchHelper
  • added: method WatcherContext.createScanStream(root: Path, options?: Partial<ReaddirpOptions>): ReaddirpStream | undefined
  • added: method WatcherContext.emitEvent(event: EventName, path: Path, stats?: Stats): Promise<void>
  • added: method WatcherContext.handleError(error: unknown): void
  • added: method WatcherContext.isIgnored(path: Path, stats?: Stats): boolean
  • added: method WatcherContext.isPathGenerationActive(path: Path, generation: number): boolean
  • added: method WatcherContext.isUnwatched(path: Path): boolean
  • added: method WatcherContext.removePath(directory: string, item: string, isDirectory?: boolean): void
  • added: method WatcherContext.rewatchMissingPath(path: Path): void
  • added: property DirEntry.path: Path
  • added: property LifecycleScope.generation: number
  • added: property LifecycleScope.state: LifecycleState
  • added: readonly property LifecycleScope.abortController: AbortController
  • added: readonly property LifecycleScope.closers: Map<string, Closer[]>
  • added: readonly property LifecycleScope.tasks: Set<Promise<unknown>>
  • added: readonly property ReconciliationQueue.pending: Map<string, PendingReconciliation>
  • added: readonly property ReconciliationQueue.queues: Map<string, Promise<void>>
  • added: readonly property TreeState.observed: Map<string, ObservedPathFact>
  • added: readonly property TreeState.recursiveRoots: Set<string>
  • added: readonly property TreeState.symlinkPaths: Map<Path, string | boolean>
  • added: readonly property TreeState.watched: Map<string, DirEntry>
  • added: readonly property WatcherContext.closed: boolean
  • added: readonly property WatcherContext.emitRaw: WatchHandlers['rawEmitter']
  • added: readonly property WatcherContext.events: EventPolicy
  • added: readonly property WatcherContext.lifecycle: LifecycleScope
  • added: readonly property WatcherContext.options: FSWInstanceOptions
  • added: readonly property WatcherContext.reconciliation: ReconciliationQueue
  • added: readonly property WatcherContext.scheduler: Scheduler
  • added: readonly property WatcherContext.tree: TreeState
  • added: type Closer = () => void | Promise<void>
  • added: type LifecycleState = 'OPEN' | 'CLOSING' | 'CLOSED'
  • added: type ObservedPathFact = { size: number; mtimeMs: number; ino: number; kind: 'file' | 'directory' | 'symlink' | 'other'; transition?: 'add' | 'change'; rawEvent?: NativeTrigger['rawEve…
  • added: type PathCloser = () => void | Promise<void>
  • added: type PendingReconciliation = { promise: Promise<void>; work: () => Promise<void>; replay: boolean }