/** * The following code is modified based on * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Watching.js * * MIT Licensed * Author Tobias Koppers @sokra * Copyright (c) JS Foundation and other contributors * https://github.com/webpack/webpack/blob/main/LICENSE */ import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.js'; import type { Compiler } from './index.js'; import { Stats } from './index.js'; import type { WatchOptions } from './config/index.js'; import type { Watcher } from './util/fs.js'; export declare class Watching { #private; watcher?: Watcher; pausedWatcher?: Watcher; compiler: Compiler; handler: Callback; callbacks: Callback[]; watchOptions: WatchOptions; lastWatcherStartTime: number; running: boolean; blocked: boolean; isBlocked: () => boolean; onChange: () => void; onInvalid: () => void; invalid: boolean; startTime?: number; suspended: boolean; constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback); watch(files: Iterable & { added?: Iterable; removed?: Iterable; }, dirs: Iterable & { added?: Iterable; removed?: Iterable; }, missing: Iterable & { added?: Iterable; removed?: Iterable; }): void; close(callback?: () => void): void; invalidate(callback?: Callback): void; /** * @internal This is not a public API yet, still unstable, might change in the future */ invalidateWithChangesAndRemovals(changedFiles?: Set, removedFiles?: Set, callback?: Callback): void; /** * The reason why this is _done instead of #done, is that in Webpack, * it will rewrite this function to another function */ private _done; suspend(): void; resume(): void; }