export = Watching; /** @typedef {import("../declarations/WebpackOptions").WatchOptions} WatchOptions */ /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */ /** @typedef {import("./WebpackError")} WebpackError */ /** @typedef {import("./logging/Logger").Logger} Logger */ /** * @template T * @callback Callback * @param {(Error | null)=} err * @param {T=} result */ declare class Watching { /** * @param {Compiler} compiler the compiler * @param {WatchOptions} watchOptions options * @param {Callback} handler completion handler */ constructor( compiler: Compiler, watchOptions: WatchOptions, handler: Callback, ); startTime: number; invalid: boolean; handler: Callback; /** @type {Callback[]} */ callbacks: Callback[]; /** @type {Callback[] | undefined} */ _closeCallbacks: Callback[] | undefined; closed: boolean; suspended: boolean; blocked: boolean; _isBlocked: () => boolean; _onChange: () => void; _onInvalid: () => void; watchOptions: { aggregateTimeout?: number; followSymlinks?: boolean; ignored?: string | RegExp | string[]; poll?: number | boolean; stdin?: boolean; }; compiler: import('./Compiler'); running: boolean; _initial: boolean; _invalidReported: boolean; _needRecords: boolean; watcher: import('./util/fs').Watcher; pausedWatcher: import('./util/fs').Watcher; /** @type {Set | undefined} */ _collectedChangedFiles: Set | undefined; /** @type {Set | undefined} */ _collectedRemovedFiles: Set | undefined; /** * @param {(Error | null)=} err an optional error * @param {Compilation=} compilation the compilation * @returns {void} */ _done( err?: (Error | null) | undefined, compilation?: Compilation | undefined, ): void; /** * @param {ReadonlySet=} changedFiles changed files * @param {ReadonlySet=} removedFiles removed files */ _mergeWithCollected( changedFiles?: ReadonlySet | undefined, removedFiles?: ReadonlySet | undefined, ): void; /** * @param {ReadonlyMap=} fileTimeInfoEntries info for files * @param {ReadonlyMap=} contextTimeInfoEntries info for directories * @param {ReadonlySet=} changedFiles changed files * @param {ReadonlySet=} removedFiles removed files * @returns {void} */ _go( fileTimeInfoEntries?: | ReadonlyMap | undefined, contextTimeInfoEntries?: | ReadonlyMap | undefined, changedFiles?: ReadonlySet | undefined, removedFiles?: ReadonlySet | undefined, ): void; lastWatcherStartTime: number; /** * @param {Compilation} compilation the compilation * @returns {Stats} the compilation stats */ _getStats(compilation: Compilation): Stats; /** * @param {Iterable} files watched files * @param {Iterable} dirs watched directories * @param {Iterable} missing watched existence entries * @returns {void} */ watch( files: Iterable, dirs: Iterable, missing: Iterable, ): void; /** * @param {Callback=} callback signals when the build has completed again * @returns {void} */ invalidate(callback?: Callback | undefined): void; /** * @param {ReadonlyMap=} fileTimeInfoEntries info for files * @param {ReadonlyMap=} contextTimeInfoEntries info for directories * @param {ReadonlySet=} changedFiles changed files * @param {ReadonlySet=} removedFiles removed files * @returns {void} */ _invalidate( fileTimeInfoEntries?: | ReadonlyMap | undefined, contextTimeInfoEntries?: | ReadonlyMap | undefined, changedFiles?: ReadonlySet | undefined, removedFiles?: ReadonlySet | undefined, ): void; suspend(): void; resume(): void; /** * @param {Callback} callback signals when the watcher is closed * @returns {void} */ close(callback: Callback): void; } declare namespace Watching { export { WatchOptions, Compilation, Compiler, FileSystemInfoEntry, WebpackError, Logger, Callback, }; } import Stats = require('./Stats'); type Callback = ( err?: (Error | null) | undefined, result?: T | undefined, ) => any; type Compilation = import('./Compilation'); type FileSystemInfoEntry = import('./FileSystemInfo').FileSystemInfoEntry; type Compiler = import('./Compiler'); type WatchOptions = import('../declarations/WebpackOptions').WatchOptions; type WebpackError = import('./WebpackError'); type Logger = import('./logging/Logger').Logger;