import type { EventEmitter } from 'events'; import webpack from 'webpack'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; interface FileEvent extends EventEmitter { filePath: string; outputPath: string; shouldWatch: boolean; } declare function preprocessor(options?: { typescript?: string | boolean; webpackOptions?: any; }): (file: FileEvent) => Promise; declare namespace preprocessor { var defaultOptions: { webpackOptions: { mode: string; node: { global: boolean; __filename: boolean; __dirname: boolean; }; module: { rules: ({ test: RegExp; include: RegExp; exclude: RegExp[]; type: string; use?: undefined; loader?: undefined; } | { include?: undefined; test: RegExp; exclude: RegExp[]; type: string; use: { loader: string; options: { plugins: (string | (string | { version: string; })[] | (string | { absoluteRuntime: string; })[])[]; presets: (string | (string | { modules: string; targets: { chrome: string; }; })[])[]; configFile: boolean; babelrc: boolean; }; }[]; loader?: undefined; } | { include?: undefined; type?: undefined; use?: undefined; test: RegExp; exclude: RegExp[]; loader: string; })[]; }; plugins: (BundleAnalyzerPlugin | webpack.ProvidePlugin)[]; resolve: { extensions: string[]; fallback: { assert: boolean; buffer: string; child_process: boolean; cluster: boolean; console: boolean; constants: boolean; crypto: boolean; dgram: boolean; dns: boolean; domain: boolean; events: boolean; fs: boolean; http: boolean; https: boolean; http2: boolean; inspector: boolean; module: boolean; net: boolean; os: string; path: string; perf_hooks: boolean; punycode: boolean; process: string; querystring: boolean; readline: boolean; repl: boolean; stream: string; string_decoder: boolean; sys: boolean; timers: boolean; tls: boolean; tty: boolean; url: boolean; util: boolean; vm: boolean; zlib: boolean; }; plugins: never[]; }; }; watchOptions: {}; }; var getFullWebpackOptions: (filePath?: string, typescript?: string | boolean) => any; var __reset: any; } export = preprocessor;