/** * The following code is modified based on * https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/NodeWatchFileSystem.js * * MIT Licensed * Author Tobias Koppers @sokra * Copyright (c) JS Foundation and other contributors * https://github.com/webpack/webpack/blob/main/LICENSE */ import type Watchpack from '../../compiled/watchpack/index.js'; import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs.js'; type WatchpackInstance = InstanceType; export default class NodeWatchFileSystem implements WatchFileSystem { #private; inputFileSystem: InputFileSystem; watcherOptions: Watchpack.WatchOptions; watcher?: WatchpackInstance; constructor(inputFileSystem: InputFileSystem); watch(files: Iterable, directories: Iterable, missing: Iterable, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map, contextTimeInfoEntries: Map, changedFiles: Set, removedFiles: Set) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher; on(event: 'change', listener: (filename: string, mtime: number) => void): this; on(event: 'remove', listener: (filename: string) => void): this; on(event: 'aggregated', listener: (changes: Set, removals: Set) => void): this; once(event: 'change', listener: (filename: string, mtime: number) => void): this; once(event: 'remove', listener: (filename: string) => void): this; once(event: 'aggregated', listener: (changes: Set, removals: Set) => void): this; emit(event: 'change', filename: string, mtime: number): boolean; emit(event: 'remove', filename: string): boolean; emit(event: 'aggregated', changes: Set, removals: Set): boolean; } export {};