/// import { EventEmitter } from "events"; import webpack from "webpack"; import { ProgressWatcher } from "./ProgressWatcher"; import { Build as CompilerBuild } from "./Compiler"; export declare enum WatchHandleEvent { Build = "build", Stop = "stop", ProgressStart = "progressStart", ProgressComplete = "progressComplete" } export declare class WatchHandle extends EventEmitter { private readonly webpackCompiler; private webpackWatcher; private readonly progressWatcher; constructor({ webpackCompiler, progressWatcher, }: { webpackCompiler: webpack.Compiler; progressWatcher: ProgressWatcher; }); watch(): void; invalidate(): void; stop(onStop?: () => void): void; emit(type: WatchHandleEvent.Build, error: undefined, build: CompilerBuild): boolean; emit(type: WatchHandleEvent.Build, error: Error): boolean; emit(type: WatchHandleEvent.Stop): boolean; emit(type: WatchHandleEvent.ProgressStart): boolean; emit(type: WatchHandleEvent.ProgressComplete): boolean; on(type: WatchHandleEvent.Build, callback: (error: undefined | Error, build: CompilerBuild | undefined) => void): this; on(type: WatchHandleEvent.Stop, callback: () => void): this; on(type: WatchHandleEvent.ProgressStart, callback: () => void): this; on(type: WatchHandleEvent.ProgressComplete, callback: () => void): this; once(type: WatchHandleEvent.Build, callback: (error: undefined | Error, build: CompilerBuild | undefined) => void): this; once(type: WatchHandleEvent.Stop, callback: () => void): this; once(type: WatchHandleEvent.ProgressStart, callback: () => void): this; once(type: WatchHandleEvent.ProgressComplete, callback: () => void): this; private onProgressStart; private onProgressComplete; }