import { Buffer } from "node:buffer";
import { URL as URL$1 } from "node:url";
import { Plugin as VitePlugin } from "vite";
import { OutputOptions as RollupOutputOptions, RollupOptions } from "rollup";
import webpack, { Compilation, Compiler, Configuration, LoaderContext } from "webpack";
import { Configuration as DevServerConfiguration } from "webpack-dev-server";
import WebpackChain from "webpack-chain";
import { SectionedSourceMapInput } from "@jridgewell/source-map";
import { Options as Options$2 } from "html-minifier-terser";
import { AsyncSeriesWaterfallHook } from "tapable";

//#region src/utils.d.ts
/**
 * Promise or not
 */
type Awaitable<T> = PromiseLike<T> | T;
/**
 * Array or not
 */

/**
 * Any function
 */
type AnyFn<T = unknown> = (...args: T[]) => T;
/**
 * A literal type that supports custom further strings but preserves autocompletion in IDEs.
 *
 * @see https://github.com/microsoft/TypeScript/issues/29729#issuecomment-471566609
 */
type LiteralUnion<Union extends Base, Base = string> = Union | (Base & {
  zz_IGNORE_ME?: never;
});
/**
 * Non empty object `{}`
 */
type NonEmptyObject<T> = T extends Record<string, never> ? never : T;
/**
 * Exclude empty object properties from a type
 */
type ExcludeEmptyObjects<T> = { [K in keyof T]: NonEmptyObject<T[K]> };
//#endregion
//#region src/config/cache.d.ts
interface CacheBuildDependencies {
  config?: string[];
}
interface Cache {
  /**
   * 是否开启持久化缓存
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#cacheenable
   */
  enable?: boolean;
  /**
   * 缓存子目录的名称
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#cachename
   * @default `process.env.NODE_ENV-process.env.TARO_ENV`
   */
  name?: string;
  /**
   * 当依赖的文件或该文件的依赖改变时，使缓存失效
   *
   * @see https://webpack.js.org/configuration/cache/#cachebuilddependencies
   */
  buildDependencies?: CacheBuildDependencies;
}
//#endregion
//#region src/config/packages/less.d.ts
interface LessSourceMap {
  outputFilename?: string;
  sourceMapRootpath?: string;
  sourceMapBasepath?: string;
  outputSourceFiles?: boolean;
  sourceMapFileInline?: boolean;
  sourceMapURL?: string;
}
interface LessOptions {
  /**
   * Source map options
   */
  sourceMap?: LessSourceMap;
  /**
   * Filename of the main file to be passed to less.render()
   */
  filename?: string;
  /**
   * The locations for less looking for files in @import rules
   */
  paths?: string[];
  /**
   * True, if run the less parser and just reports errors without any output
   */
  lint?: boolean;
  /**
   * Pre-load global Less.js plugins
   */
  plugins?: AnyFn[];
  strictImports?: boolean;
  /**
   * If true, allow imports from insecure https hosts
   */
  insecure?: boolean;
  depends?: boolean;
  maxLineLen?: number;
  /**
   * Add a path to every generated import and url in output css files
   */
  rootpath?: string;
  /**
   * allows you to rewrite URLs in imported files so that the URL is always relative to the base file that has been passed to Less
   *
   * @see https://lesscss.org/usage/#less-options-rewrite-urls
   * @default `off`
   */
  rewriteUrls?: LiteralUnion<'all' | 'local' | 'off'>;
  /**
   * Math mode options for avoiding symbol conflicts on math expressions
   * @description
   *  - `always` (3.x default) - Less does math eagerly
   *  - `parens-division` (4.0 default) - No division is performed outside of parens using / operator (but can be "forced" outside of parens with ./ operator - ./ is deprecated)
   *  - `parens` | `strict` - Parens required for all math expressions
   *  - `strict-legacy` (removed in 4.0) - In some cases, math will not be evaluated if any part of the expression cannot be evaluated
   */
  math?: 'always' | 'parens-division' | 'parens' | 'strict-legacy' | 'strict';
  /**
   * If true, stops any warnings from being shown
   */
  silent?: boolean;
  /**
   * Without this option, Less attempts to guess at the output unit when it does maths
   *
   * @default false
   */
  strictUnits?: boolean;
  /**
   * Defines a variable that can be referenced by the file
   */
  globalVars?: Record<string, string>;
  /**
   * Puts Var declaration at the end of base file
   */
  modifyVars?: Record<string, string>;
  /**
   * This option allows you to specify a argument to go on to every URL, This may be used for cache-busting for instance
   */
  urlArgs?: string;
  /**
   * Read files synchronously in Node.js
   */
  syncImport?: boolean;
  /**
   * If false, No color in compiling
   *
   * @deprecated
   */
  color?: boolean;
  /**
   * @deprecated
   * @default false
   */
  ieCompat?: boolean;
  /**
   * If true, compress using less built-in compression
   *
   * @deprecated use a third-party tool instead
   */
  compress?: boolean;
  /**
   * @deprecated use `math` instead
   */
  strictMath?: boolean;
  /**
   * @deprecated use `{ rewriteUrls: 'all' }` instead
   */
  relativeUrls?: boolean;
  /**
   * Whether output file information and line numbers in compiled CSS code
   *
   * @deprecated
   */
  dumpLineNumbers?: 'all' | 'comments' | 'mediaquery' | string;
  /**
   * If true, enable evaluation of JavaScript inline in `.less` files
   *
   * @deprecated use `plugins` instead
   */
  javascriptEnabled?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/sass.d.ts
/**
 * All of the deprecation types currently used by Sass.
 *
 * Any of these IDs or the deprecation objects they point to can be passed to
 * `fatalDeprecations`, `futureDeprecations`, or `silenceDeprecations`.
 */
interface Deprecations {
  /**
   * Deprecation for passing a string directly to meta.call().
   *
   * This deprecation was active in the first version of Dart Sass.
   */
  'call-string': Deprecation<'call-string'>;
  /**
   * Deprecation for @elseif.
   *
   * This deprecation became active in Dart Sass 1.3.2.
   */
  elseif: Deprecation<'elseif'>;
  /**
   * Deprecation for @-moz-document.
   *
   * This deprecation became active in Dart Sass 1.7.2.
   */
  'moz-document': Deprecation<'moz-document'>;
  /**
   * Deprecation for imports using relative canonical URLs.
   *
   * This deprecation became active in Dart Sass 1.14.2.
   */
  'relative-canonical': Deprecation<'relative-canonical'>;
  /**
   * Deprecation for declaring new variables with !global.
   *
   * This deprecation became active in Dart Sass 1.17.2.
   */
  'new-global': Deprecation<'new-global'>;
  /**
   * Deprecation for using color module functions in place of plain CSS functions.
   *
   * This deprecation became active in Dart Sass 1.23.0.
   */
  'color-module-compat': Deprecation<'color-module-compat'>;
  /**
   * Deprecation for / operator for division.
   *
   * This deprecation became active in Dart Sass 1.33.0.
   */
  'slash-div': Deprecation<'slash-div'>;
  /**
   * Deprecation for leading, trailing, and repeated combinators.
   *
   * This deprecation became active in Dart Sass 1.54.0.
   */
  'bogus-combinators': Deprecation<'bogus-combinators'>;
  /**
   * Deprecation for ambiguous + and - operators.
   *
   * This deprecation became active in Dart Sass 1.55.0.
   */
  'strict-unary': Deprecation<'strict-unary'>;
  /**
   * Deprecation for passing invalid units to built-in functions.
   *
   * This deprecation became active in Dart Sass 1.56.0.
   */
  'function-units': Deprecation<'function-units'>;
  /**
   * Deprecation for using !default or !global multiple times for one variable.
   *
   * This deprecation became active in Dart Sass 1.62.0.
   */
  'duplicate-var-flags': Deprecation<'duplicate-var-flags'>;
  /**
   * Deprecation for passing null as alpha in the JS API.
   *
   * This deprecation became active in Dart Sass 1.62.3.
   */
  'null-alpha': Deprecation<'null-alpha'>;
  /**
   * Deprecation for passing percentages to the Sass abs() function.
   *
   * This deprecation became active in Dart Sass 1.65.0.
   */
  'abs-percent': Deprecation<'abs-percent'>;
  /**
   * Deprecation for using the current working directory as an implicit load path.
   *
   * This deprecation became active in Dart Sass 1.73.0.
   */
  'fs-importer-cwd': Deprecation<'fs-importer-cwd'>;
  /**
   * Deprecation for function and mixin names beginning with --.
   *
   * This deprecation became active in Dart Sass 1.76.0.
   */
  'css-function-mixin': Deprecation<'css-function-mixin'>;
  /**
   * Deprecation for declarations after or between nested rules.
   *
   * This deprecation became active in Dart Sass 1.77.7.
   */
  'mixed-decls': Deprecation<'mixed-decls'>;
  /**
   * Deprecation for meta.feature-exists
   *
   * This deprecation became active in Dart Sass 1.78.0.
   */
  'feature-exists': Deprecation<'feature-exists'>;
  /**
   * Deprecation for certain uses of built-in sass:color functions.
   *
   * This deprecation became active in Dart Sass 1.79.0.
   */
  'color-4-api': Deprecation<'color-4-api'>;
  /**
   * Deprecation for using global color functions instead of sass:color.
   *
   * This deprecation became active in Dart Sass 1.79.0.
   */
  'color-functions': Deprecation<'color-functions'>;
  /**
   * Deprecation for legacy JS API.
   *
   * This deprecation became active in Dart Sass 1.79.0.
   */
  'legacy-js-api': Deprecation<'legacy-js-api'>;
  /**
   * Deprecation for @import rules.
   *
   * This deprecation became active in Dart Sass 1.80.0.
   */
  import: Deprecation<'import'>;
  /**
   * Deprecation for global built-in functions that are available in sass: modules.
   *
   * This deprecation became active in Dart Sass 1.80.0.
   */
  'global-builtin': Deprecation<'global-builtin'>;
  /**
   * Used for any user-emitted deprecation warnings.
   */
  'user-authored': Deprecation<'user-authored', 'user'>;
}
/**
 * Either a deprecation or its ID, either of which can be passed to any of
 * the relevant compiler options.
 *
 * @category Messages
 * @compatibility dart: 1.85.1, node: false
 */
type DeprecationOrId = Deprecation | keyof Deprecations;
/**
 * The possible statuses that each deprecation can have.
 *
 * "active" deprecations are currently emitting deprecation warnings.
 * "future" deprecations are not yet active, but will be in the future.
 * "obsolete" deprecations were once active, but no longer are.
 *
 * The only "user" deprecation is "user-authored", which is used for deprecation
 * warnings coming from user code.
 */
type DeprecationStatus = 'active' | 'future' | 'obsolete' | 'user';
/**
 * A deprecated feature in the language.
 */
interface Deprecation<id extends keyof Deprecations = keyof Deprecations, status extends DeprecationStatus = DeprecationStatus> {
  /** The unique ID of this deprecation. */
  id: id;
  /** The current status of this deprecation. */
  status: status;
  /** A human-readable description of this deprecation. */
  description?: string;
  /** The version this deprecation first became active in. */
  deprecatedIn: status extends 'future' | 'user' ? null : Version;
  /** The version this deprecation became obsolete in. */
  obsoleteIn: status extends 'obsolete' ? Version : null;
}
/**
 * A semantic version of the compiler.
 */
declare class Version {
  /**
   * Constructs a new version.
   *
   * All components must be non-negative integers.
   *
   * @param major - The major version.
   * @param minor - The minor version.
   * @param patch - The patch version.
   */
  constructor(major: number, minor: number, patch: number);
  readonly major: number;
  readonly minor: number;
  readonly patch: number;
  /**
   * Parses a version from a string.
   *
   * This throws an error if a valid version can't be parsed.
   *
   * @param version - A string in the form "major.minor.patch".
   */
  static parse(version: string): Version;
}
type CallbackValue = boolean | number | string | Array<boolean | number | string> | Record<PropertyKey, any>;
type Context = {
  options: NodeSassOptions;
  callback?: (result: CallbackValue) => void;
  [data: string]: any;
};
interface AsyncContext extends Context {
  callback: (result: CallbackValue) => void;
}
interface SyncContext extends Context {
  callback: undefined;
}
type ImporterReturnType = Error | {
  contents: string;
  file?: string;
} | {
  file: string;
} | null;
type AsyncImporter = (this: AsyncContext, url: string, prev: string, done: (data: ImporterReturnType) => void) => void;
type SyncImporter = (this: SyncContext, url: string, prev: string) => ImporterReturnType;
type SourceSpan = {
  text: string;
  url: URL$1;
  context?: string;
  end: {
    column: number;
    line: number;
    offset: number;
  };
  start: {
    column: number;
    line: number;
    offset: number;
  };
};
type LoggerWarnOptions = {
  span?: SourceSpan;
  stack?: string;
} & ({
  deprecation: false;
} | {
  deprecation: true;
  deprecationType: Deprecation;
});
interface SassLogger {
  /**
   * If this is `undefined`, Sass will print warnings to standard error
   */
  warn(message: string, options: {}): void;
  /**
   * If this is `undefined`, Sass will print debug messages to standard error
   */
  debug(message: string, options: {
    span: SourceSpan;
  }): void;
}
declare const nodePackageImporterKey: unique symbol;
declare class NodePackageImporter {
  private readonly [nodePackageImporterKey];
  constructor(entryPointDirectory?: string);
}
/**
 * Taro 配置项中 `sass` 配置
 *
 * @see https://nervjs.github.io/taro-docs/docs/config-detail/#sass
 */
interface TaroSassOptions {
  /**
   * 需要全局注入的 `scss` 文件的绝对路径
   * 当存在 {@link projectDirectory} 配置时，才支持传入相对路径
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#sassresource
   */
  resource?: string | string[];
  /**
   * 项目根目录的绝对地址(若为小程序云开发模板，则应该是 `client` 目录)
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#sassprojectdirectory
   */
  projectDirectory?: string;
  /**
   * 全局 `scss` 变量，优先级高于 `resource`
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#sassdata
   */
  data?: string;
  [key: string]: any;
}
interface CommonSassOptions {
  /**
   * Path to a file to compile
   * @description `unavailable` and will be ignored
   */
  file?: string;
  /**
   * Handles when LibSass encounters the \@import directive
   *
   * @experimental
   */
  importer?: Array<AsyncImporter | SyncImporter> | AsyncImporter | SyncImporter;
  /**
   * holds a collection of custom functions that may be invoked by the sass files being compiled
   *
   * @experimental
   */
  functions?: Record<string, AnyFn>;
  /**
   * `true` values disable the inclusion of source map information in the output file
   *
   * @default false
   */
  omitSourceMapUrl?: boolean;
  /**
   * Enables source map generation during render and renderSync
   */
  sourceMap?: boolean | string;
  /**
   * `true` includes the contents in the source map information
   *
   * @default false
   */
  sourceMapContents?: boolean;
  /**
   * `true` embeds the source map as a data URI
   *
   * @default false
   */
  sourceMapEmbed?: boolean;
  /**
   * the value will be emitted as `sourceRoot` in the source map information
   */
  sourceMapRoot?: string;
}
/**
 * `node-sass` 配置, `sass-loader` 仅支持部分配置
 *
 * @see https://www.npmjs.com/package/@types/node-sass?activeTab=code
 * @compatibility 9.0.0
 * @deprecated
 */
interface NodeSassOptions extends CommonSassOptions {
  /**
   * A string to pass to compile
   * @description `unavailable` and will be ignored
   */
  data?: string;
  /**
   * An array of paths that LibSass can look in to attempt to resolve your \@import declarations
   */
  includePaths?: string[];
  /**
   * true values enable Sass Indented Syntax for parsing the data string or file
   *
   * @default false
   */
  indentedSyntax?: boolean;
  /**
   * Specify the intended location of the output file
   */
  outFile?: string | null;
  /**
   * Determines the output format of the final CSS style
   *
   * @default `nested`
   */
  outputStyle?: LiteralUnion<'compact' | 'compressed' | 'expanded' | 'nested'>;
  /**
   * determine whether to use space or tab character for indentation
   *
   * @default `space`
   */
  indentType?: LiteralUnion<'space' | 'tab'>;
  /**
   * determine the number of spaces or tabs to be used for indentation, max is 10
   *
   * @default 2
   */
  indentWidth?: number;
  /**
   * determine whether to use cr, crlf, lf or lfcr sequence for line break
   *
   * @default `lf`
   */
  linefeed?: LiteralUnion<'cf' | 'crlf' | 'if' | 'lfcr'>;
  /**
   * determine how many digits after the decimal will be allowed
   *
   * @default 5
   */
  precision?: number;
  /**
   * Enables the line number and file where a selector is defined to be emitted into the compiled CSS as a comment
   *
   * @default false
   */
  sourceComments?: boolean;
  [key: string]: any;
}
/**
 * `dart-sass` 配置, `sass-loader` 仅支持部分配置
 *
 * @see https://github.com/sass/dart-sass
 * @see https://www.npmjs.com/package/sass?activeTab=code
 * @compatibility 1.89.1
 */
interface DartSassOptions extends CommonSassOptions {
  /**
   * A string to pass to compile
   * `unavailable` and will be ignored
   */
  data?: never;
  /**
   * Paths in which to look for stylesheets loaded by rules like \@use and \@import.
   */
  loadPaths?: string[];
  /**
   * Specify the intended location of the output file
   */
  outFile?: string;
  /**
   * Determines the output format of the final CSS style
   *
   * @default `expanded`
   * @deprecated use `style` instead
   */
  outputStyle?: LiteralUnion<'compressed' | 'expanded'>;
  /**
   * Determines the output format of the final CSS style
   *
   * @default `expanded`
   */
  style?: LiteralUnion<'compressed' | 'expanded'>;
  /**
   * By default, if the CSS document contains non-ASCII characters, Sass adds a
   * `@charset` declaration (in expanded output mode) or a byte-order mark (in
   * compressed mode) to indicate its encoding to browsers or other consumers.
   * If `charset` is `false`, these annotations are omitted
   *
   * @default true
   */
  charset?: boolean;
  /**
   * If this option is set to `true`, Sass won’t print warnings that are caused
   * by dependencies
   *
   * @default false
   */
  quietDeps?: boolean;
  /**
   * A set of deprecations to treat as fatal
   */
  fatalDeprecations?: (DeprecationOrId | Version)[];
  /**
   * A set of future deprecations to opt into early
   */
  futureDeprecations?: DeprecationOrId[];
  /**
   * A set of active deprecations to ignore
   */
  silenceDeprecations?: DeprecationOrId[];
  /**
   * By default, Dart Sass will print only five instances of the same
   * deprecation warning per compilation to avoid deluging users in console
   * noise. If you set `verbose` to `true`, it will instead print every
   * deprecation warning it encounters
   *
   * @default false
   */
  verbose?: boolean;
  /**
   * An object to use to handle warnings and/or debug messages from Sass
   */
  logger?: SassLogger;
  /**
   * If this option is set to an instance of `NodePackageImporter`, Sass will
   * use the built-in Node.js package importer to resolve Sass files with a
   * `pkg:` URL scheme.
   */
  pkgImporter?: NodePackageImporter;
  /**
   * If this is true, the compiler will exclusively use ASCII characters in its error and warning  * messages. Otherwise, it may use non-ASCII Unicode characters as well.
   *
   * @default false
   */
  alertAscii?: boolean;
  /**
   * If this is true, the compiler will use ANSI color escape codes in its error and warning
   * messages. If it's false, it won't use these. If it's undefined, the compiler will determine
   * whether or not to use colors depending on whether the user is using an interactive terminal.
   *
   * @default false
   */
  alertColor?: boolean;
  /**
   * Whether Sass should include the sources in the generated source map.
   * This option has no effect if sourceMap is false.
   *
   * @default false
   */
  sourceMapIncludeSources?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/stylus.d.ts
type StylusOptionsDefineItem = [string, boolean | number | string, boolean?];
interface StylusOptions {
  /**
   * Specify Stylus plugins to use
   */
  use?: (string | AnyFn)[];
  /**
   * Add path(s) to the import lookup paths
   */
  include?: string[];
  /**
   * Import the specified Stylus files/paths
   */
  import?: string[];
  /**
   * Define Stylus variables or functions
   * @default {}
   */
  define?: Record<string, boolean | number | string> | StylusOptionsDefineItem[];
  /**
   * Include regular CSS on \@import
   * @default false
   */
  includeCSS?: boolean;
  /**
   * Emits comments in the generated CSS indicating the corresponding Stylus line
   * @default false
   */
  lineNumbers?: boolean;
  /**
   * Move \@import and \@charset to the top
   * @default false
   */
  hoistAtrules?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/cssnano.d.ts
type CSSNanoConfig<T> = T | [T, Record<string, any>] | [T];
interface CSSNanoOptions {
  /**
   * @see https://cssnano.github.io/cssnano/docs/config-file/#choose-a-preset
   */
  preset?: CSSNanoConfig<AnyFn> | CSSNanoConfig<string>;
  /**
   * @see https://cssnano.github.io/cssnano/docs/config-file/#use-individual-plugins
   */
  plugins?: (CSSNanoConfig<AnyFn> | CSSNanoConfig<string>)[] | CSSNanoConfig<AnyFn> | CSSNanoConfig<string>;
  /**
   * @see https://github.com/cssnano/cssnano/blob/master/packages/cssnano/types/index.d.ts
   */
  configFile?: string;
}
//#endregion
//#region src/config/packages/webpack.d.ts
type Webpack = typeof webpack;
type WebpackCompilation = Compilation;
type WebpackCompiler = Compiler;
type WebpackConfiguration = Configuration;
type WebpackLoaderContext<T = any> = LoaderContext<T>;
//#endregion
//#region src/config/packages/css-loader.d.ts
interface CSSLoaderUrl {
  filter: (url: string, resourcePath: string) => boolean;
}
interface CSSLoaderImport {
  filter: (url: string, media: string, resourcePath: string, supports?: string, layer?: string) => boolean;
}
type CSSLoaderModulesUnion = LiteralUnion<'global' | 'icss' | 'local' | 'pure'>;
type CSSLoaderModulesExportLocalsConvention = LiteralUnion<'as-is' | 'asIs' | 'camel-case-only' | 'camel-case' | 'camelCase' | 'camelCaseOnly' | 'dashes-only' | 'dashes' | 'dashesOnly'>;
interface CSSLoaderModulesObject {
  /**
   * @see https://github.com/webpack-contrib/css-loader#auto
   */
  auto?: boolean | RegExp | ((resourcePath: string, resourceQuery: string, resourceFragment: string) => boolean);
  /**
   * @see https://github.com/webpack-contrib/css-loader#mode
   * @default `local`
   */
  mode?: CSSLoaderModulesUnion | ((resourcePath: string, resourceQuery: string, resourceFragment: string) => CSSLoaderModulesUnion);
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidentname
   * @default `hash:base64`
   */
  localIdentName?: string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidentcontext
   * @default `compiler.context`
   */
  localIdentContext?: string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidenthashsalt
   */
  localIdentHashSalt?: string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidenthashfunction
   * @default `md4`
   */
  localIdentHashFunction?: string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidenthashdigest
   * @default `hex`
   */
  localIdentHashDigest?: string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidenthashdigestlength
   * @default 20
   */
  localIdentHashDigestLength?: number;
  /**
   * @see https://github.com/webpack-contrib/css-loader#localidentregexp
   */
  localIdentRegExp?: string | RegExp;
  /**
   * @see https://github.com/webpack-contrib/css-loader#getlocalident
   */
  getLocalIdent?: (loaderContext: WebpackLoaderContext, localIdentName: string, localName: string) => string;
  /**
   * @see https://github.com/webpack-contrib/css-loader#namedexport
   */
  namedExport?: boolean;
  /**
   * @see https://github.com/webpack-contrib/css-loader#exportglobals
   */
  exportGlobals?: boolean;
  /**
   * @see https://github.com/webpack-contrib/css-loader#exportlocalsconvention
   */
  exportLocalsConvention?: CSSLoaderModulesExportLocalsConvention | ((name: string) => string);
  /**
   * @see https://github.com/webpack-contrib/css-loader#exportonlylocals
   */
  exportOnlyLocals?: boolean;
  /**
   * @see https://github.com/webpack-contrib/css-loader#getjson
   */
  getJSON?: ({
    resourcePath,
    imports,
    exports,
    replacements
  }: {
    resourcePath: string;
    exports: Array<{
      name: string;
      value: string;
    }>;
    imports: Array<{
      icss: boolean;
      importName: string;
      index: number;
      type: string;
      url: string;
    }>;
    replacements: Array<{
      importName: string;
      localName: string;
      replacementName: string;
    }>;
  }) => Awaitable<void>;
}
type CSSLoaderExportType = LiteralUnion<'array' | 'css-style-sheet' | 'string'>;
interface CSSLoaderOptions {
  /**
   * @see https://github.com/webpack-contrib/css-loader#url
   * @default true
   */
  url?: boolean | CSSLoaderUrl;
  /**
   * @see https://github.com/webpack-contrib/css-loader#import
   * @default true
   */
  import?: boolean | CSSLoaderImport;
  /**
   * @see https://github.com/webpack-contrib/css-loader#modules
   */
  modules?: boolean | CSSLoaderModulesObject | CSSLoaderModulesUnion;
  /**
   * @see https://github.com/webpack-contrib/css-loader#sourcemap
   * @default compiler.devtool
   */
  sourceMap?: boolean;
  /**
   * @see https://github.com/webpack-contrib/css-loader#importloaders
   * @default 0
   */
  importLoaders?: number;
  /**
   * @see https://github.com/webpack-contrib/css-loader#esmodule
   * @default true
   */
  esModule?: boolean;
  /**
   * @see https://github.com/webpack-contrib/css-loader#exporttype
   * @default `array`
   */
  exportType?: CSSLoaderExportType;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/url-loader.d.ts
/**
 * `url-loader` 配置
 *
 * @see https://github.com/webpack-contrib/url-loader#options
 * @compatibility 4.1.1
 * @deprecated
 */
interface URLLoaderOptions {
  /**
   * Specify the name of the chunk
   */
  name?: string | ((moduleId: string) => string);
  /**
   * Specifying the maximum size of a file in bytes
   *
   * @see https://github.com/webpack-contrib/url-loader#limit
   * @default true
   */
  limit?: boolean | number | string;
  /**
   * Sets the MIME type for the file to be transformed
   *
   * @see https://github.com/webpack-contrib/url-loader#mimetype
   */
  mimetype?: boolean | string;
  /**
   * Specify the encoding which the file will be inlined with
   *
   * @see https://github.com/webpack-contrib/url-loader#encoding
   * @default `base64`
   */
  encoding?: boolean | string;
  /**
   * You can create you own custom implementation for encoding data.
   *
   * @see https://github.com/webpack-contrib/url-loader#generator
   */
  generator?: (mimetype: string, encoding: string, content: string, resourcePath: string) => string;
  /**
   * Specifies an alternative loader to use when a target file's size exceeds the limit
   *
   * @see https://github.com/webpack-contrib/url-loader#fallback
   * @default `file-loader`
   */
  fallback?: string;
  /**
   * Use ES modules syntax
   *
   * @see https://github.com/webpack-contrib/url-loader#esmodule
   * @default true
   */
  esModule?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/less-loader.d.ts
interface LessLoaderOptions {
  /**
   * less options in camelCase, default value is `{ relativeUrls: true }`
   *
   * @see https://github.com/webpack-contrib/less-loader#lessoptions
   */
  lessOptions?: LessOptions | ((loaderConext: WebpackLoaderContext) => LessOptions);
  /**
   * prepends/appends Less code to the actual entry file
   *
   * @see https://github.com/webpack-contrib/less-loader#additionaldata
   */
  additionalData?: LoaderAdditionalData<'less'>;
  /**
   * if generation of source maps
   *
   * @see https://github.com/webpack-contrib/less-loader#sourcemap
   * @default compiler.devtool
   */
  sourceMap?: boolean;
  /**
   * enables/disables the default webpack importer
   *
   * @see https://github.com/webpack-contrib/less-loader#webpackimporter
   * @default true
   */
  webpackImporter?: 'only' | boolean;
  /**
   * determines which implementation of Less to use
   *
   * @see https://github.com/webpack-contrib/less-loader#implementation
   */
  implementation?: string | Record<string, any>;
  /**
   * warnings and errors will be webpack warnings and errors, not just logs
   *
   * @see https://github.com/webpack-contrib/less-loader#lesslogaswarnorerr
   * @default false
   */
  lessLogAsWarnOrErr?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/postcss-url.d.ts
type PostCSSUrlUrl = LiteralUnion<'copy' | 'inline' | 'rebase'>;
interface PostCSSUrlUrlAsset {
  url: string;
  pathname?: string;
  absolutePath?: string;
  relativePath?: string;
  search?: string;
  hash?: string;
}
interface PostCSSUrlUrlDir {
  from?: string;
  to?: string;
  file?: string;
}
type PostcssUrlHashOptionsMethod = LiteralUnion<'xxhash32' | 'xxhash64'>;
interface PostcssUrlHashOptions {
  method?: PostcssUrlHashOptionsMethod | ((file: Buffer) => string);
  shrink?: number;
  append?: boolean;
}
interface PostcssUrlOptions {
  /**
   * @see https://github.com/postcss/postcss-url#url
   * @default `rebase`
   */
  url?: PostCSSUrlUrl | ((asset: PostCSSUrlUrlAsset, dir: PostCSSUrlUrlDir) => string);
  /**
   * @see https://github.com/postcss/postcss-url#maxsize
   */
  maxSize?: number;
  /**
   * @see https://github.com/postcss/postcss-url#ignorefragmentwarning
   * @default false
   */
  ignoreFragmentWarning?: boolean;
  /**
   * @default false
   */
  optimizeSvgEncode?: boolean;
  /**
   * @see https://github.com/postcss/postcss-url#filter
   */
  filter?: string | RegExp | ((file: string) => boolean);
  /**
   * @see https://github.com/postcss/postcss-url#includeurifragment
   * @default false
   */
  includeUriFragment?: boolean;
  /**
   * @see https://github.com/postcss/postcss-url#fallback
   */
  fallback?: (asset: PostCSSUrlUrlAsset, dir: PostCSSUrlUrlDir) => string;
  /**
   * @see https://github.com/postcss/postcss-url#basepath
   */
  basePath?: string | string[];
  /**
   * @see https://github.com/postcss/postcss-url#assetspath
   * @default false
   */
  assetsPath?: boolean | string;
  /**
   * @see https://github.com/postcss/postcss-url#usehash
   * @default false
   */
  useHash?: boolean;
  /**
   * @see https://github.com/postcss/postcss-url#hashoptions
   */
  hashOptions?: PostcssUrlHashOptions;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/sass-loader.d.ts
type SassLoaderSassOptions = DartSassOptions | NodeSassOptions;
interface SassLoaderOptions {
  /**
   * determines which implementation of Sass to use
   *
   * @see https://github.com/webpack-contrib/sass-loader#implementation
   * @default `sass`
   */
  implementation?: object | string;
  /**
   * Options for Dart Sass or Node Sass implementation
   *
   * @see https://github.com/webpack-contrib/sass-loader#sassoptions
   */
  sassOptions?: SassLoaderSassOptions | ((content: string | Buffer, loaderContext: WebpackLoaderContext, meta: any) => SassLoaderSassOptions);
  /**
   * Enables/Disables generation of source maps
   *
   * @see https://github.com/webpack-contrib/sass-loader#sourcemap
   * @default compiler.devtool
   */
  sourceMap?: boolean;
  /**
   * Prepends Sass/SCSS code before the actual entry file. In this case, the sass-loader will not override the data option but just prepend the entry's content
   *
   * @see https://github.com/webpack-contrib/sass-loader#additionaldata
   */
  additionalData?: LoaderAdditionalData<'sass'>;
  /**
   * Enables/Disables the default webpack importer
   *
   * @see https://github.com/webpack-contrib/sass-loader#webpackimporter
   * @default true
   */
  webpackImporter?: boolean;
  /**
   * Treats the @warn rule as a webpack warning
   *
   * @see https://github.com/webpack-contrib/sass-loader#warnruleaswarning
   * @default false
   */
  warnRuleAsWarning?: boolean;
  /**
   * Allows you to switch between the legacy and modern APIs
   *
   * @see https://github.com/webpack-contrib/sass-loader#api
   * @see https://sass-lang.com/documentation/js-api/
   * @default `modern` for `sass (dart-sass)` and `sass-embedded`, or `legacy` for `node-sass`
   */
  api?: LiteralUnion<'legacy' | 'modern-compiler' | 'modern'>;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/autoprefixer.d.ts
/**
 * `autoprefixer` 配置
 *
 * @see https://github.com/postcss/autoprefixer/blob/main/lib/autoprefixer.d.ts
 * @compatibility 10.4.21
 */
interface AutoprefixerOptions {
  /**
   * environment for `Browserslist`
   */
  env?: string;
  /**
   * should Autoprefixer use Visual Cascade, if CSS is uncompressed
   *
   * @default true
   */
  cascade?: boolean;
  /**
   * should Autoprefixer add prefixes
   *
   * @default true
   */
  add?: boolean;
  /**
   * should Autoprefixer [remove outdated] prefixes
   *
   * @default true
   */
  remove?: boolean;
  /**
   * should Autoprefixer add prefixes for `@supports` parameters
   *
   * @default true
   */
  supports?: boolean;
  /**
   * should Autoprefixer add prefixes for flexbox properties
   *
   * @default true
   */
  flexbox?: 'no-2009' | boolean;
  /**
   * should Autoprefixer add IE 10-11 prefixes for Grid Layout properties
   * @description
   *  - false (default): prevent Autoprefixer from outputting CSS Grid translations
   *  - "autoplace": enable Autoprefixer grid translations and include autoplacement support. You can also use /* autoprefixer grid: autoplace *\/ in your CSS
   *  - "no-autoplace": enable Autoprefixer grid translations but exclude autoplacement support. You can also use /* autoprefixer grid: no-autoplace *\/ in your CSS. (alias for the deprecated true value)
   *
   * @default false
   */
  grid?: 'autoplace' | 'no-autoplace' | boolean;
  /**
   * custom usage statistics for > 10% in my stats browsers query
   */
  stats?: Record<string, any>;
  /**
   * list of queries for target browsers
   *
   * @description Try to not use it. The best practice is to use `.browserslistrc` config or `browserslist` key in `package.json` to share target browsers with Babel, ESLint and Stylelint
   *
   * @see https://github.com/browserslist/browserslist#queries
   * @default ['defaults']
   */
  overrideBrowserslist?: string | string[];
  /**
   * do not raise error on unknown browser version in `Browserslist` config
   *
   * @default false
   */
  ignoreUnknownVersions?: boolean;
}
//#endregion
//#region src/config/packages/style-loader.d.ts
type StyleLoaderInjectType = LiteralUnion<'autoStyleTag' | 'lazyAutoStyleTag' | 'lazySingletonStyleTag' | 'lazyStyleTag' | 'linkTag' | 'singletonStyleTag' | 'styleTag'>;
interface StyleLoaderOptions {
  /**
   * Allows to setup how styles will be injected into the DOM
   *
   * @see https://github.com/webpack-contrib/style-loader#injecttype
   * @default `styleTag`
   */
  injectType?: StyleLoaderInjectType;
  /**
   * attach given attributes with their values on <style> / <link> element
   *
   * @see https://github.com/webpack-contrib/style-loader#attributes
   */
  attributes?: Record<string, string>;
  /**
   * @see https://github.com/webpack-contrib/style-loader#insert
   * @default `head`
   */
  insert?: string | ((htmlElement: HTMLElement, options: Record<string, any>) => void);
  /**
   * @see https://github.com/webpack-contrib/style-loader#styleTagTransform
   */
  styleTagTransform?: string | ((css: string, styleElement: HTMLStyleElement, options: Record<string, any>) => void);
  /**
   * @see https://github.com/webpack-contrib/style-loader#base
   */
  base?: number;
  /**
   * @see https://github.com/webpack-contrib/style-loader#esmodule
   * @default true
   */
  esModule?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/stylus-loader.d.ts
interface StylusOptionsResolveURL {
  paths?: string[];
  nocheck?: boolean;
}
/**
 * @see https://github.com/webpack-contrib/stylus-loader#object
 */
interface StylusLoaderStylusOptions extends StylusOptions {
  resolveURL?: boolean | StylusOptionsResolveURL;
  compress?: boolean;
  paths?: string[];
}
interface StylusLoaderOptions {
  /**
   * @see https://github.com/webpack-contrib/stylus-loader#stylusOptions
   * @default {}
   */
  stylusOptions?: StylusLoaderStylusOptions | ((loaderContext: WebpackLoaderContext) => string[] | {
    paths: string[];
  });
  /**
   * @see https://github.com/webpack-contrib/stylus-loader#sourcemap
   */
  sourceMap?: boolean;
  /**
   * @see https://github.com/webpack-contrib/stylus-loader#webpackimporter
   * @default true
   */
  webpackImporter?: boolean;
  /**
   * @see https://github.com/webpack-contrib/stylus-loader#additionalData
   */
  additionalData?: LoaderAdditionalData<'stylus'>;
  /**
   * @see https://github.com/webpack-contrib/stylus-loader#implementation
   */
  implementation?: string | AnyFn;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/postcss-css-modules.d.ts
declare class CustomLoader {
  constructor(root: string, plugins: any[]);
  fetch(file: string, relativeTo: string, depTrace: string): Promise<Record<string, string>>;
  finalSource?: string;
}
interface PostcssCssModulesOptions {
  getJSON?: (cssFilename: string, json: Record<string, string>, outputFilename: string) => void;
  /**
   * style of exported classnames, the keys in your json
   */
  localsConvention?: LiteralUnion<'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly'> | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
  /**
   * change all the classes are local or global
   *
   * @default `local`
   */
  scopeBehaviour?: LiteralUnion<'global' | 'local'>;
  /**
   *  define paths for global modules
   */
  globalModulePaths?: RegExp[];
  /**
   * 转换模式，取值为 global/module
   */
  namingPattern?: 'global' | string;
  /**
   * generate custom classes
   */
  generateScopedName?: string | ((name: string, filename: string, css: string) => string);
  /**
   * add custom hash to generate more unique classes
   */
  hashPrefix?: string;
  /**
   * export global names via the JSON object along with the local ones
   */
  exportGlobals?: boolean;
  /**
   * root path
   */
  root?: string;
  /**
   * use custom loader if needed
   */
  Loader?: typeof CustomLoader;
  /**
   * resolve custom path alias
   */
  resolve?: (file: string, importer: string) => string | Promise<string | null> | null;
  [key: string]: any;
}
//#endregion
//#region src/config/design.d.ts
interface DesignWidthInput {
  /**
   * 样式文件内容
   */
  css: string;
  /**
   * 样式文件路径
   */
  file?: string;
  hasBOM: boolean;
}
/**
 * @param input - 样式文件绝对路径
 *
 * @returns 设计稿尺寸
 */
type DesignWidth = number | ((input?: number | string | DesignWidthInput) => number);
/**
 * 设计稿尺寸换算规则
 */
type DesignRatio = Record<number | string, number>;
//#endregion
//#region src/config/packages/postcss-pxtransform.d.ts
interface PostcssPxtransformOptions {
  /**
   * 目标平台
   *
   * @default `weapp`
   */
  platform?: LiteralUnion<'h5' | 'harmony' | 'quickapp' | 'rn' | 'weapp'>;
  /**
   * 设计稿尺寸
   *
   * @default 750
   */
  designWidth?: DesignWidth;
  /**
   * 设计稿尺寸换算规则
   */
  deviceRatio?: DesignRatio;
  /**
   * @default 16
   */
  rootValue?: number;
  /**
   * @deprecated use `rootValue` instead
   */
  root_value?: number;
  /**
   * `rem` 单位允许的小数位
   *
   * @default 5
   */
  unitPrecision?: number;
  /**
   * @deprecated use `unitPrecision` instead
   */
  unit_precision?: number;
  /**
   * 允许转换的属性列表
   *
   * @default ['*']
   */
  propList?: string[];
  /**
   * @deprecated use `propList` instead
   */
  prop_white_list?: string[];
  /**
   * @deprecated use `propList` instead
   */
  propWhiteList?: string[];
  /**
   * 黑名单里的选择器将会被忽略
   *
   * @default []
   */
  selectorBlackList?: (string | RegExp)[];
  /**
   * @deprecated use `selectorBlackList` instead
   */
  selector_black_list?: (string | RegExp)[];
  /**
   * 直接替换而不是追加一条进行覆盖
   *
   * @default true
   */
  replace?: boolean;
  /**
   * 允许媒体查询里的 px 单位转换
   *
   * @default false
   */
  mediaQuery?: boolean;
  /**
   * @deprecated use `mediaQuery` instead
   */
  media_query?: boolean;
  /**
   * 设置一个可被转换的最小 px 值
   *
   * @default 0
   */
  minPixelValue?: number;
  /**
   * H5 字体尺寸大小基准值，开发者可以自行调整单位换算的基准值
   *
   * @description supported h5 only
   * @default 20
   */
  baseFontSize?: number;
  /**
   * H5 根节点 font-size 的最小值
   *
   * @description supported h5 only
   * @default 20
   */
  minRootSize?: number;
  /**
   * H5 根节点 font-size 的最大值
   *
   * @description supported h5 only
   * @default 40
   */
  maxRootSize?: number;
  /**
   * 设置 1px 是否需要被转换
   *
   * @default false
   */
  onePxTransform?: boolean;
  /**
   * 转换后的单位，当前仅支持小程序 (默认 `rpx`) 和 Web 端 (默认 `rem`)
   * @description Web 端使用 rem 单位时会注入脚本用于设置 body 上的 font-size 属性，其他单位无该操作
   */
  targetUnit?: LiteralUnion<'rem' | 'rpx' | 'vw'>;
  /**
   * 启用的能力 Scope
   *
   * @default ['platform', 'size']
   */
  methods?: string[];
  /**
   * filter 回调函数，可 exclude 不处理的文件
   */
  exclude?: (fileName: string) => boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/postcss-html-transform.d.ts
type PostcssHtmlTransformPlatform = LiteralUnion<'h5' | 'mini-program' | 'quickapp' | 'rn'>;
interface PostcssHtmlTransformOptions {
  /**
   * 目标构建平台
   *
   * @see https://github.com/NervJS/taro/blob/884c799553df1682ef0996c59c7fbd77f60755c9/packages/postcss-html-transform/src/index.ts#L12
   * @default `mini-program`
   */
  platform?: PostcssHtmlTransformPlatform;
  /**
   * 是否移除鼠标样式, `h5` 平台默认为 `true`
   *
   * @see https://github.com/NervJS/taro/blob/884c799553df1682ef0996c59c7fbd77f60755c9/packages/postcss-html-transform/src/index.ts#L46
   */
  removeCursorStyle?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/esbuild.d.ts
/**
 * @file `esbuild` 类型
 *
 * @see https://www.npmjs.com/package/esbuild?activeTab=code
 * @compatibility 0.25.5
 */
type Platform = 'browser' | 'neutral' | 'node';
type Format = 'cjs' | 'esm' | 'iife';
type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx';
type LogLevel = 'debug' | 'error' | 'info' | 'silent' | 'verbose' | 'warning';
type Charset = 'ascii' | 'utf8';
type Drop = 'console' | 'debugger';
interface CommonOptions {
  /** Documentation: https://esbuild.github.io/api/#sourcemap */
  sourcemap?: 'both' | 'external' | 'inline' | 'linked' | boolean;
  /** Documentation: https://esbuild.github.io/api/#legal-comments */
  legalComments?: 'eof' | 'external' | 'inline' | 'linked' | 'none';
  /** Documentation: https://esbuild.github.io/api/#source-root */
  sourceRoot?: string;
  /** Documentation: https://esbuild.github.io/api/#sources-content */
  sourcesContent?: boolean;
  /** Documentation: https://esbuild.github.io/api/#format */
  format?: Format;
  /** Documentation: https://esbuild.github.io/api/#global-name */
  globalName?: string;
  /** Documentation: https://esbuild.github.io/api/#target */
  target?: string | string[];
  /** Documentation: https://esbuild.github.io/api/#supported */
  supported?: Record<string, boolean>;
  /** Documentation: https://esbuild.github.io/api/#platform */
  platform?: Platform;
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
  mangleProps?: RegExp;
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
  reserveProps?: RegExp;
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
  mangleQuoted?: boolean;
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
  mangleCache?: Record<string, false | string>;
  /** Documentation: https://esbuild.github.io/api/#drop */
  drop?: Drop[];
  /** Documentation: https://esbuild.github.io/api/#drop-labels */
  dropLabels?: string[];
  /** Documentation: https://esbuild.github.io/api/#minify */
  minify?: boolean;
  /** Documentation: https://esbuild.github.io/api/#minify */
  minifyWhitespace?: boolean;
  /** Documentation: https://esbuild.github.io/api/#minify */
  minifyIdentifiers?: boolean;
  /** Documentation: https://esbuild.github.io/api/#minify */
  minifySyntax?: boolean;
  /** Documentation: https://esbuild.github.io/api/#line-limit */
  lineLimit?: number;
  /** Documentation: https://esbuild.github.io/api/#charset */
  charset?: Charset;
  /** Documentation: https://esbuild.github.io/api/#tree-shaking */
  treeShaking?: boolean;
  /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
  ignoreAnnotations?: boolean;
  /** Documentation: https://esbuild.github.io/api/#jsx */
  jsx?: 'automatic' | 'preserve' | 'transform';
  /** Documentation: https://esbuild.github.io/api/#jsx-factory */
  jsxFactory?: string;
  /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
  jsxFragment?: string;
  /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
  jsxImportSource?: string;
  /** Documentation: https://esbuild.github.io/api/#jsx-development */
  jsxDev?: boolean;
  /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
  jsxSideEffects?: boolean;
  /** Documentation: https://esbuild.github.io/api/#define */
  define?: {
    [key: string]: string;
  };
  /** Documentation: https://esbuild.github.io/api/#pure */
  pure?: string[];
  /** Documentation: https://esbuild.github.io/api/#keep-names */
  keepNames?: boolean;
  /** Documentation: https://esbuild.github.io/api/#color */
  color?: boolean;
  /** Documentation: https://esbuild.github.io/api/#log-level */
  logLevel?: LogLevel;
  /** Documentation: https://esbuild.github.io/api/#log-limit */
  logLimit?: number;
  /** Documentation: https://esbuild.github.io/api/#log-override */
  logOverride?: Record<string, LogLevel>;
  /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
  tsconfigRaw?: string | TsconfigRaw;
}
interface TsconfigRaw {
  compilerOptions?: {
    alwaysStrict?: boolean;
    baseUrl?: string;
    experimentalDecorators?: boolean;
    importsNotUsedAsValues?: 'error' | 'preserve' | 'remove';
    jsx?: 'preserve' | 'react-jsx' | 'react-jsxdev' | 'react-native' | 'react';
    jsxFactory?: string;
    jsxFragmentFactory?: string;
    jsxImportSource?: string;
    paths?: Record<string, string[]>;
    preserveValueImports?: boolean;
    strict?: boolean;
    target?: string;
    useDefineForClassFields?: boolean;
    verbatimModuleSyntax?: boolean;
  };
}
interface BuildOptions extends CommonOptions {
  /** Documentation: https://esbuild.github.io/api/#bundle */
  bundle?: boolean;
  /** Documentation: https://esbuild.github.io/api/#splitting */
  splitting?: boolean;
  /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
  preserveSymlinks?: boolean;
  /** Documentation: https://esbuild.github.io/api/#outfile */
  outfile?: string;
  /** Documentation: https://esbuild.github.io/api/#metafile */
  metafile?: boolean;
  /** Documentation: https://esbuild.github.io/api/#outdir */
  outdir?: string;
  /** Documentation: https://esbuild.github.io/api/#outbase */
  outbase?: string;
  /** Documentation: https://esbuild.github.io/api/#external */
  external?: string[];
  /** Documentation: https://esbuild.github.io/api/#packages */
  packages?: 'bundle' | 'external';
  /** Documentation: https://esbuild.github.io/api/#alias */
  alias?: Record<string, string>;
  /** Documentation: https://esbuild.github.io/api/#loader */
  loader?: {
    [ext: string]: Loader;
  };
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
  resolveExtensions?: string[];
  /** Documentation: https://esbuild.github.io/api/#main-fields */
  mainFields?: string[];
  /** Documentation: https://esbuild.github.io/api/#conditions */
  conditions?: string[];
  /** Documentation: https://esbuild.github.io/api/#write */
  write?: boolean;
  /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
  allowOverwrite?: boolean;
  /** Documentation: https://esbuild.github.io/api/#tsconfig */
  tsconfig?: string;
  /** Documentation: https://esbuild.github.io/api/#out-extension */
  outExtension?: {
    [ext: string]: string;
  };
  /** Documentation: https://esbuild.github.io/api/#public-path */
  publicPath?: string;
  /** Documentation: https://esbuild.github.io/api/#entry-names */
  entryNames?: string;
  /** Documentation: https://esbuild.github.io/api/#chunk-names */
  chunkNames?: string;
  /** Documentation: https://esbuild.github.io/api/#asset-names */
  assetNames?: string;
  /** Documentation: https://esbuild.github.io/api/#inject */
  inject?: string[];
  /** Documentation: https://esbuild.github.io/api/#banner */
  banner?: {
    [type: string]: string;
  };
  /** Documentation: https://esbuild.github.io/api/#footer */
  footer?: {
    [type: string]: string;
  };
  /** Documentation: https://esbuild.github.io/api/#entry-points */
  entryPoints?: {
    in: string;
    out: string;
  }[] | Record<string, string> | string[];
  /** Documentation: https://esbuild.github.io/api/#stdin */
  stdin?: StdinOptions;
  /** Documentation: https://esbuild.github.io/plugins/ */
  plugins?: Plugin$2[];
  /** Documentation: https://esbuild.github.io/api/#working-directory */
  absWorkingDir?: string;
  /** Documentation: https://esbuild.github.io/api/#node-paths */
  nodePaths?: string[];
}
interface StdinOptions {
  contents: string | Uint8Array;
  resolveDir?: string;
  sourcefile?: string;
  loader?: Loader;
}
interface Message {
  id: string;
  pluginName: string;
  text: string;
  location: Location | null;
  notes: Note[];
  /**
   * Optional user-specified data that is passed through unmodified. You can
   * use this to stash the original error, for example.
   */
  detail: any;
}
interface Note {
  text: string;
  location: Location | null;
}
interface Location {
  file: string;
  namespace: string;
  /** 1-based */
  line: number;
  /** 0-based, in bytes */
  column: number;
  /** in bytes */
  length: number;
  lineText: string;
  suggestion: string;
}
interface OutputFile {
  path: string;
  contents: Uint8Array;
  hash: string;
  /** "contents" as text (changes automatically with "contents") */
  readonly text: string;
}
interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
  errors: Message[];
  warnings: Message[];
  /** Only when "write: false" */
  outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined);
  /** Only when "metafile: true" */
  metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined);
  /** Only when "mangleCache" is present */
  mangleCache: Record<string, false | string> | (ProvidedOptions['mangleCache'] extends object ? never : undefined);
}
/** Documentation: https://esbuild.github.io/api/#serve-arguments */
interface ServeOptions {
  port?: number;
  host?: string;
  servedir?: string;
  keyfile?: string;
  certfile?: string;
  fallback?: string;
  cors?: CORSOptions;
  onRequest?: (args: ServeOnRequestArgs) => void;
}
/** Documentation: https://esbuild.github.io/api/#cors */
interface CORSOptions {
  origin?: string | string[];
}
interface ServeOnRequestArgs {
  remoteAddress: string;
  method: string;
  path: string;
  status: number;
  /** The time to generate the response, not to send it */
  timeInMS: number;
}
/** Documentation: https://esbuild.github.io/api/#serve-return-values */
interface ServeResult {
  port: number;
  hosts: string[];
}
interface TransformOptions extends CommonOptions {
  /** Documentation: https://esbuild.github.io/api/#sourcefile */
  sourcefile?: string;
  /** Documentation: https://esbuild.github.io/api/#loader */
  loader?: Loader;
  /** Documentation: https://esbuild.github.io/api/#banner */
  banner?: string;
  /** Documentation: https://esbuild.github.io/api/#footer */
  footer?: string;
}
interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
  code: string;
  map: string;
  warnings: Message[];
  /** Only when "mangleCache" is present */
  mangleCache: Record<string, false | string> | (ProvidedOptions['mangleCache'] extends object ? never : undefined);
  /** Only when "legalComments" is "external" */
  legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined);
}
interface Plugin$2 {
  name: string;
  setup: (build: PluginBuild) => Promise<void> | void;
}
interface PluginBuild {
  /** Documentation: https://esbuild.github.io/plugins/#build-options */
  initialOptions: BuildOptions;
  /** Documentation: https://esbuild.github.io/plugins/#resolve */
  resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>;
  /** Documentation: https://esbuild.github.io/plugins/#on-start */
  onStart(callback: () => OnStartResult | Promise<OnStartResult | null | void> | null | void): void;
  /** Documentation: https://esbuild.github.io/plugins/#on-end */
  onEnd(callback: (result: BuildResult) => OnEndResult | Promise<OnEndResult | null | void> | null | void): void;
  /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
  onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => OnResolveResult | Promise<OnResolveResult | null | undefined> | null | undefined): void;
  /** Documentation: https://esbuild.github.io/plugins/#on-load */
  onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => OnLoadResult | Promise<OnLoadResult | null | undefined> | null | undefined): void;
  /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
  onDispose(callback: () => void): void;
  esbuild: {
    analyzeMetafile: typeof analyzeMetafile;
    analyzeMetafileSync: typeof analyzeMetafileSync;
    build: typeof build;
    buildSync: typeof buildSync;
    context: typeof context;
    formatMessages: typeof formatMessages;
    formatMessagesSync: typeof formatMessagesSync;
    initialize: typeof initialize;
    transform: typeof transform;
    transformSync: typeof transformSync;
    version: typeof version;
  };
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-options */
interface ResolveOptions {
  pluginName?: string;
  importer?: string;
  namespace?: string;
  resolveDir?: string;
  kind?: ImportKind;
  pluginData?: any;
  with?: Record<string, string>;
}
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
interface ResolveResult {
  errors: Message[];
  warnings: Message[];
  path: string;
  external: boolean;
  sideEffects: boolean;
  namespace: string;
  suffix: string;
  pluginData: any;
}
interface OnStartResult {
  errors?: PartialMessage[];
  warnings?: PartialMessage[];
}
interface OnEndResult {
  errors?: PartialMessage[];
  warnings?: PartialMessage[];
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
interface OnResolveOptions {
  filter: RegExp;
  namespace?: string;
}
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
interface OnResolveArgs {
  path: string;
  importer: string;
  namespace: string;
  resolveDir: string;
  kind: ImportKind;
  pluginData: any;
  with: Record<string, string>;
}
type ImportKind = 'composes-from' | 'dynamic-import' | 'entry-point' | 'import-rule' | 'import-statement' | 'require-call' | 'require-resolve' | 'url-token';
/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
interface OnResolveResult {
  pluginName?: string;
  errors?: PartialMessage[];
  warnings?: PartialMessage[];
  path?: string;
  external?: boolean;
  sideEffects?: boolean;
  namespace?: string;
  suffix?: string;
  pluginData?: any;
  watchFiles?: string[];
  watchDirs?: string[];
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-options */
interface OnLoadOptions {
  filter: RegExp;
  namespace?: string;
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
interface OnLoadArgs {
  path: string;
  namespace: string;
  suffix: string;
  pluginData: any;
  with: Record<string, string>;
}
/** Documentation: https://esbuild.github.io/plugins/#on-load-results */
interface OnLoadResult {
  pluginName?: string;
  errors?: PartialMessage[];
  warnings?: PartialMessage[];
  contents?: string | Uint8Array;
  resolveDir?: string;
  loader?: Loader;
  pluginData?: any;
  watchFiles?: string[];
  watchDirs?: string[];
}
interface PartialMessage {
  id?: string;
  pluginName?: string;
  text?: string;
  location?: Partial<Location> | null;
  notes?: PartialNote[];
  detail?: any;
}
interface PartialNote {
  text?: string;
  location?: Partial<Location> | null;
}
/** Documentation: https://esbuild.github.io/api/#metafile */
interface Metafile {
  inputs: {
    [path: string]: {
      bytes: number;
      format?: 'cjs' | 'esm';
      with?: Record<string, string>;
      imports: {
        kind: ImportKind;
        path: string;
        external?: boolean;
        original?: string;
        with?: Record<string, string>;
      }[];
    };
  };
  outputs: {
    [path: string]: {
      bytes: number;
      exports: string[];
      cssBundle?: string;
      entryPoint?: string;
      imports: {
        kind: 'file-loader' | ImportKind;
        path: string;
        external?: boolean;
      }[];
      inputs: {
        [path: string]: {
          bytesInOutput: number;
        };
      };
    };
  };
}
interface FormatMessagesOptions {
  kind: 'error' | 'warning';
  color?: boolean;
  terminalWidth?: number;
}
interface AnalyzeMetafileOptions {
  color?: boolean;
  verbose?: boolean;
}
interface WatchOptions {}
interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
  /** Documentation: https://esbuild.github.io/api/#rebuild */
  rebuild(): Promise<BuildResult<ProvidedOptions>>;
  /** Documentation: https://esbuild.github.io/api/#watch */
  watch(options?: WatchOptions): Promise<void>;
  /** Documentation: https://esbuild.github.io/api/#serve */
  serve(options?: ServeOptions): Promise<ServeResult>;
  cancel(): Promise<void>;
  dispose(): Promise<void>;
}
type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never };
/**
 * This function invokes the "esbuild" command-line tool for you. It returns a
 * promise that either resolves with a "BuildResult" object or rejects with a
 * "BuildFailure" object.
 *
 * - Works in node: yes
 * - Works in browser: yes
 *
 * Documentation: https://esbuild.github.io/api/#build
 */
declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>;
/**
 * This is the advanced long-running form of "build" that supports additional
 * features such as watch mode and a local development server.
 *
 * - Works in node: yes
 * - Works in browser: no
 *
 * Documentation: https://esbuild.github.io/api/#build
 */
declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>;
/**
 * This function transforms a single JavaScript file. It can be used to minify
 * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
 * to older JavaScript. It returns a promise that is either resolved with a
 * "TransformResult" object or rejected with a "TransformFailure" object.
 *
 * - Works in node: yes
 * - Works in browser: yes
 *
 * Documentation: https://esbuild.github.io/api/#transform
 */
declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>;
/**
 * Converts log messages to formatted message strings suitable for printing in
 * the terminal. This allows you to reuse the built-in behavior of esbuild's
 * log message formatter. This is a batch-oriented API for efficiency.
 *
 * - Works in node: yes
 * - Works in browser: yes
 */
declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
/**
 * Pretty-prints an analysis of the metafile JSON to a string. This is just for
 * convenience to be able to match esbuild's pretty-printing exactly. If you want
 * to customize it, you can just inspect the data in the metafile yourself.
 *
 * - Works in node: yes
 * - Works in browser: yes
 *
 * Documentation: https://esbuild.github.io/api/#analyze
 */
declare function analyzeMetafile(metafile: string | Metafile, options?: AnalyzeMetafileOptions): Promise<string>;
/**
 * A synchronous version of "build".
 *
 * - Works in node: yes
 * - Works in browser: no
 *
 * Documentation: https://esbuild.github.io/api/#build
 */
declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>;
/**
 * A synchronous version of "transform".
 *
 * - Works in node: yes
 * - Works in browser: no
 *
 * Documentation: https://esbuild.github.io/api/#transform
 */
declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>;
/**
 * A synchronous version of "formatMessages".
 *
 * - Works in node: yes
 * - Works in browser: no
 */
declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
/**
 * A synchronous version of "analyzeMetafile".
 *
 * - Works in node: yes
 * - Works in browser: no
 *
 * Documentation: https://esbuild.github.io/api/#analyze
 */
declare function analyzeMetafileSync(metafile: string | Metafile, options?: AnalyzeMetafileOptions): string;
/**
 * This configures the browser-based version of esbuild. It is necessary to
 * call this first and wait for the returned promise to be resolved before
 * making other API calls when using esbuild in the browser.
 *
 * - Works in node: yes
 * - Works in browser: yes ("options" is required)
 *
 * Documentation: https://esbuild.github.io/api/#browser
 */
declare function initialize(options: InitializeOptions): Promise<void>;
interface InitializeOptions {
  /**
   * The URL of the "esbuild.wasm" file. This must be provided when running
   * esbuild in the browser.
   */
  wasmURL?: string | URL;
  /**
   * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
   * is a typed array or ArrayBuffer containing the binary code of the
   * "esbuild.wasm" file.
   *
   * You can use this as an alternative to "wasmURL" for environments where it's
   * not possible to download the WebAssembly module.
   */
  wasmModule?: WebAssembly.Module;
  /**
   * By default esbuild runs the WebAssembly-based browser API in a web worker
   * to avoid blocking the UI thread. This can be disabled by setting "worker"
   * to false.
   */
  worker?: boolean;
}
declare const version: string;
declare global {
  namespace WebAssembly {
    interface Module {}
  }
  interface URL {}
}
//#endregion
//#region src/config/packages/esbuild-loader.d.ts
type Filter = string | RegExp;
type Implementation = {
  transform: typeof transform;
};
type Except<ObjectType, Properties> = { [Key in keyof ObjectType as Key extends Properties ? never : Key]: ObjectType[Key] };
type EsbuildPluginOptions = Except<TransformOptions, 'sourcefile' | 'sourcemap'> & {
  css?: boolean;
  exclude?: Filter | Filter[];
  /** Pass a custom esbuild implementation */
  implementation?: Implementation;
  include?: Filter | Filter[];
};
//#endregion
//#region src/config/packages/webpack-chain.d.ts
type ChainableWebpackConfig = WebpackChain;
//#endregion
//#region src/config/packages/terser.d.ts
type ECMA = 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 5;
type ConsoleProperty = keyof typeof console;
type DropConsoleOption = boolean | ConsoleProperty[];
interface ParseOptions {
  bare_returns?: boolean;
  /** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
  ecma?: ECMA;
  html5_comments?: boolean;
  shebang?: boolean;
}
interface CompressOptions {
  arguments?: boolean;
  arrows?: boolean;
  booleans_as_integers?: boolean;
  booleans?: boolean;
  collapse_vars?: boolean;
  comparisons?: boolean;
  computed_props?: boolean;
  conditionals?: boolean;
  dead_code?: boolean;
  defaults?: boolean;
  directives?: boolean;
  drop_console?: DropConsoleOption;
  drop_debugger?: boolean;
  ecma?: ECMA;
  evaluate?: boolean;
  expression?: boolean;
  global_defs?: object;
  hoist_funs?: boolean;
  hoist_props?: boolean;
  hoist_vars?: boolean;
  ie8?: boolean;
  if_return?: boolean;
  inline?: boolean | InlineFunctions;
  join_vars?: boolean;
  keep_classnames?: boolean | RegExp;
  keep_fargs?: boolean;
  keep_fnames?: boolean | RegExp;
  keep_infinity?: boolean;
  loops?: boolean;
  module?: boolean;
  negate_iife?: boolean;
  passes?: number;
  properties?: boolean;
  pure_funcs?: string[];
  pure_new?: boolean;
  pure_getters?: 'strict' | boolean;
  reduce_funcs?: boolean;
  reduce_vars?: boolean;
  sequences?: boolean | number;
  side_effects?: boolean;
  switches?: boolean;
  toplevel?: boolean;
  top_retain?: string | RegExp | string[] | null;
  typeofs?: boolean;
  unsafe_arrows?: boolean;
  unsafe?: boolean;
  unsafe_comps?: boolean;
  unsafe_Function?: boolean;
  unsafe_math?: boolean;
  unsafe_symbols?: boolean;
  unsafe_methods?: boolean;
  unsafe_proto?: boolean;
  unsafe_regexp?: boolean;
  unsafe_undefined?: boolean;
  unused?: boolean;
}
declare enum InlineFunctions {
  Disabled = 0,
  SimpleFunctions = 1,
  WithArguments = 2,
  WithArgumentsAndVariables = 3,
}
interface MangleOptions {
  eval?: boolean;
  keep_classnames?: boolean | RegExp;
  keep_fnames?: boolean | RegExp;
  module?: boolean;
  nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
  properties?: boolean | ManglePropertiesOptions;
  reserved?: string[];
  safari10?: boolean;
  toplevel?: boolean;
}
/**
 * An identifier mangler for which the output is invariant with respect to the source code.
 */
interface SimpleIdentifierMangler {
  /**
   * Obtains the nth most favored (usually shortest) identifier to rename a variable to.
   * The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
   * This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
   * @param n - The ordinal of the identifier.
   */
  get(n: number): string;
}
/**
 * An identifier mangler that leverages character frequency analysis to determine identifier precedence.
 */
interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
  /**
   * Modifies the internal weighting of the input characters by the specified delta.
   * Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
   * @param chars - The characters to modify the weighting of.
   * @param delta - The numeric weight to add to the characters.
   */
  consider(chars: string, delta: number): number;
  /**
   * Resets character weights.
   */
  reset(): void;
  /**
   * Sorts identifiers by character frequency, in preparation for calls to get(n).
   */
  sort(): void;
}
interface ManglePropertiesOptions {
  builtins?: boolean;
  debug?: boolean;
  keep_quoted?: 'strict' | boolean;
  nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
  regex?: string | RegExp;
  reserved?: string[];
}
interface FormatOptions {
  ascii_only?: boolean;
  /** @deprecated Not implemented anymore */
  beautify?: boolean;
  braces?: boolean;
  comments?: 'all' | 'some' | boolean | RegExp | ((node: any, comment: {
    col: number;
    line: number;
    pos: number;
    type: 'comment1' | 'comment2' | 'comment3' | 'comment4';
    value: string;
  }) => boolean);
  ecma?: ECMA;
  ie8?: boolean;
  keep_numbers?: boolean;
  indent_level?: number;
  indent_start?: number;
  inline_script?: boolean;
  keep_quoted_props?: boolean;
  max_line_len?: false | number;
  preamble?: string;
  preserve_annotations?: boolean;
  quote_keys?: boolean;
  quote_style?: OutputQuoteStyle;
  safari10?: boolean;
  semicolons?: boolean;
  shebang?: boolean;
  shorthand?: boolean;
  source_map?: SourceMapOptions;
  webkit?: boolean;
  width?: number;
  wrap_iife?: boolean;
  wrap_func_args?: boolean;
}
declare enum OutputQuoteStyle {
  AlwaysDouble = 2,
  AlwaysOriginal = 3,
  AlwaysSingle = 1,
  PreferDouble = 0,
}
interface MinifyOptions$1 {
  compress?: boolean | CompressOptions;
  ecma?: ECMA;
  enclose?: boolean | string;
  ie8?: boolean;
  keep_classnames?: boolean | RegExp;
  keep_fnames?: boolean | RegExp;
  mangle?: boolean | MangleOptions;
  module?: boolean;
  nameCache?: object;
  format?: FormatOptions;
  /** @deprecated */
  output?: FormatOptions;
  parse?: ParseOptions;
  safari10?: boolean;
  sourceMap?: boolean | SourceMapOptions;
  toplevel?: boolean;
}
interface SourceMapOptions {
  /** Source map object, 'inline' or source map file content */
  content?: string | SectionedSourceMapInput;
  includeSources?: boolean;
  filename?: string;
  root?: string;
  asObject?: boolean;
  url?: 'inline' | string;
}
//#endregion
//#region src/config/packages/html-webpack-plugin.d.ts
declare class HtmlWebpackPlugin {
  constructor(options?: HtmlWebpackPlugin.Options);
  userOptions: HtmlWebpackPlugin.Options;
  /** Current HtmlWebpackPlugin Major */
  version: number;
  /**
   * Options after html-webpack-plugin has been initialized with defaults
   */
  options?: HtmlWebpackPlugin.ProcessedOptions;
  apply(compiler: WebpackCompiler): void;
  static getHooks(compilation: WebpackCompilation): HtmlWebpackPlugin.Hooks;
  static getCompilationHooks(compilation: WebpackCompilation): HtmlWebpackPlugin.Hooks;
  /**
   * Static helper to create a tag object to be get injected into the dom
   */
  static createHtmlTagObject(tagName: string, attributes?: {
    [attributeName: string]: boolean | string;
  }, innerHTML?: string): HtmlWebpackPlugin.HtmlTagObject;
  static readonly version: number;
}
declare namespace HtmlWebpackPlugin {
  type MinifyOptions = Options$2;
  interface Options {
    /**
     * Emit the file only if it was changed.
     * @default true
     */
    cache?: boolean;
    /**
     * List all entries which should be injected
     */
    chunks?: 'all' | string[];
    /**
     * Allows to control how chunks should be sorted before they are included to the html.
     * @default 'auto'
     */
    chunksSortMode?: 'auto' | 'manual' | 'none' | ((entryNameA: string, entryNameB: string) => number);
    /**
     * List all entries which should not be injected
     */
    excludeChunks?: string[];
    /**
     * Path to the favicon icon
     */
    favicon?: false | string;
    /**
     * The file to write the HTML to.
     * Supports subdirectories eg: `assets/admin.html`
     * [name] will be replaced by the entry name
     * Supports a function to generate the name
     *
     * @default 'index.html'
     */
    filename?: string | ((entryName: string) => string);
    /**
     * By default the public path is set to `auto` - that way the html-webpack-plugin will try
     * to set the publicPath according to the current filename and the webpack publicPath setting
     */
    publicPath?: 'auto' | string;
    /**
     * If `true` then append a unique `webpack` compilation hash to all included scripts and CSS files.
     * This is useful for cache busting
     */
    hash?: boolean;
    /**
     * Inject all assets into the given `template` or `templateContent`.
     */
    inject?: 'body' | 'head' | false | true;
    /**
     * Set up script loading
     * blocking will result in <script src="..."></script>
     * defer will result in <script defer src="..."></script>
     *
     * @default 'defer'
     */
    scriptLoading?: 'blocking' | 'defer' | 'module' | 'systemjs-module';
    /**
     * Inject meta tags
     */
    meta?: false | {
      [name: string]: false | string | {
        [attributeName: string]: boolean | string;
      };
    };
    /**
     * HTML Minification options accepts the following values:
     * - Set to `false` to disable minification
     * - Set to `'auto'` to enable minification only for production mode
     * - Set to custom minification according to
     * {@link https://github.com/kangax/html-minifier#options-quick-reference}
     */
    minify?: 'auto' | boolean | MinifyOptions;
    /**
     * Render errors into the HTML page
     */
    showErrors?: boolean;
    /**
     * The `webpack` require path to the template.
     * @see https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md
     */
    template?: string;
    /**
     * Allow to use a html string instead of reading from a file
     */
    templateContent?: false | string | Promise<string> | ((templateParameters: {
      [option: string]: any;
    }) => string | Promise<string>);
    /**
     * Allows to overwrite the parameters used in the template
     */
    templateParameters?: false | ((compilation: WebpackCompilation, assets: {
      css: Array<string>;
      js: Array<string>;
      publicPath: string;
      favicon?: string;
      manifest?: string;
    }, assetTags: {
      bodyTags: HtmlTagObject[];
      headTags: HtmlTagObject[];
    }, options: ProcessedOptions) => Promise<{
      [option: string]: any;
    }> | {
      [option: string]: any;
    }) | {
      [option: string]: any;
    };
    /**
     * The title to use for the generated HTML document
     */
    title?: string;
    /**
     * Enforce self closing tags e.g. <link />
     */
    xhtml?: boolean;
    /**
     * In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through
     * to your template.
     */
    [option: string]: any;
  }
  /**
   * The plugin options after adding default values
   */
  interface ProcessedOptions extends Required<Options> {
    filename: string;
  }
  /**
   * The values which are available during template execution
   *
   * Please keep in mind that the `templateParameter` options allows to change them
   */
  interface TemplateParameter {
    compilation: WebpackCompilation;
    htmlWebpackPlugin: {
      options: Options;
      files: {
        css: Array<string>;
        js: Array<string>;
        publicPath: string;
        favicon?: string;
        manifest?: string;
      };
      tags: {
        bodyTags: HtmlTagObject[];
        headTags: HtmlTagObject[];
      };
    };
    webpackConfig: any;
  }
  interface Hooks {
    alterAssetTags: AsyncSeriesWaterfallHook<{
      outputName: string;
      plugin: HtmlWebpackPlugin;
      publicPath: string;
      assetTags: {
        meta: HtmlTagObject[];
        scripts: HtmlTagObject[];
        styles: HtmlTagObject[];
      };
    }>;
    alterAssetTagGroups: AsyncSeriesWaterfallHook<{
      bodyTags: HtmlTagObject[];
      headTags: HtmlTagObject[];
      outputName: string;
      plugin: HtmlWebpackPlugin;
      publicPath: string;
    }>;
    afterTemplateExecution: AsyncSeriesWaterfallHook<{
      bodyTags: HtmlTagObject[];
      headTags: HtmlTagObject[];
      html: string;
      outputName: string;
      plugin: HtmlWebpackPlugin;
    }>;
    beforeAssetTagGeneration: AsyncSeriesWaterfallHook<{
      outputName: string;
      plugin: HtmlWebpackPlugin;
      assets: {
        css: Array<string>;
        js: Array<string>;
        publicPath: string;
        favicon?: string;
        manifest?: string;
      };
    }>;
    beforeEmit: AsyncSeriesWaterfallHook<{
      html: string;
      outputName: string;
      plugin: HtmlWebpackPlugin;
    }>;
    afterEmit: AsyncSeriesWaterfallHook<{
      outputName: string;
      plugin: HtmlWebpackPlugin;
    }>;
  }
  /**
   * A tag element according to the htmlWebpackPlugin object notation
   */
  interface HtmlTagObject {
    /**
     * Attributes of the html tag
     * E.g. `{'disabled': true, 'value': 'demo'}`
     */
    attributes: {
      [attributeName: string]: boolean | string | null | undefined;
    };
    /**
     * The tag name e.g. `'div'`
     */
    tagName: string;
    /**
     * The inner HTML
     */
    innerHTML?: string;
    /**
     * Whether this html must not contain innerHTML
     * @see https://www.w3.org/TR/html5/syntax.html#void-elements
     */
    voidTag: boolean;
    /**
     * Meta information about the tag
     * E.g. `{'plugin': 'html-webpack-plugin'}`
     */
    meta: {
      plugin?: string;
      [metaAttributeName: string]: any;
    };
  }
}
type HtmlWebpackPluginOptions = HtmlWebpackPlugin.Options;
//#endregion
//#region src/config/packages/mini-css-extract-plugin.d.ts
interface MiniCSSExtractPluginOptions {
  /**
   * determines the name of each output CSS file
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#filename
   */
  filename?: Required<WebpackConfiguration>['output']['filename'];
  /**
   * determines the name of non-entry chunk files
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#chunkfilename
   */
  chunkFilename?: Required<WebpackConfiguration>['output']['chunkFilename'];
  /**
   * Remove Order Warnings
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#ignoreorder
   * @default false
   */
  ignoreOrder?: boolean;
  /**
   * Inserts the link tag at the given position for non-initial (async) CSS chunks
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#insert
   * @default `document.head.appendChild(linkTag)`
   */
  insert?: string | ((linkTag: HTMLLinkElement) => void);
  /**
   * attach given attributes with their values on <link> element, only for non-initial (async) chunks
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#attributes
   * @default {}
   */
  attributes?: Record<string, string>;
  /**
   * This option allows loading asynchronous chunks with a custom link type, such as `<link type="text/css" ...>`
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#linktype
   * @default `text/css`
   */
  linkType?: false | string;
  /**
   * Allows to enable/disable the runtime generation
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#runtime
   *
   * @default true
   */
  runtime?: boolean;
  /**
   * Use a new webpack API to execute modules instead of child compilers
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin#experimentalUseImportModule
   */
  experimentalUseImportModule?: boolean;
  [key: string]: any;
}
//#endregion
//#region src/config/packages/swc-core.d.ts
/**
 * @file swc 类型
 * @see https://www.npmjs.com/package/@swc/core?activeTab=code
 * @see https://www.npmjs.com/package/@swc/types?activeTab=code
 * @compatibility 1.11.29 for @swc/core
 * @compatibility 0.1.21 for @swc/types
 */
interface Plugin$1 {
  (module: Program): Program;
}
type TerserEcmaVersion = 2015 | 2016 | 5 | number | string;
interface JsMinifyOptions {
  compress?: boolean | TerserCompressOptions;
  format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
  mangle?: boolean | TerserMangleOptions;
  ecma?: TerserEcmaVersion;
  keep_classnames?: boolean;
  keep_fnames?: boolean;
  module?: 'unknown' | boolean;
  safari10?: boolean;
  toplevel?: boolean;
  sourceMap?: boolean;
  outputPath?: string;
  inlineSourcesContent?: boolean;
}
/**
 * @example ToSnakeCase<'indentLevel'> == 'indent_level'
 */
type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
/**
 * @example ToSnakeCaseProperties<{indentLevel: 3}> == {indent_level: 3}
 */
type ToSnakeCaseProperties<T> = { [K in keyof T as K extends string ? ToSnakeCase<K> : K]: T[K] };
/**
 * These properties are mostly not implemented yet,
 * but it exists to support passing terser config to swc minify
 * without modification.
 */
interface JsFormatOptions {
  /**
   * Currently noop.
   * @default false
   * @alias ascii_only
   */
  asciiOnly?: boolean;
  /**
   * Currently noop.
   * @default false
   */
  beautify?: boolean;
  /**
   * Currently noop.
   * @default false
   */
  braces?: boolean;
  /**
   * - `false`: removes all comments
   * - `'some'`: preserves some comments
   * - `'all'`: preserves all comments
   * @default false
   */
  comments?: 'all' | 'some' | false;
  /**
   * Currently noop.
   * @default 5
   */
  ecma?: TerserEcmaVersion;
  /**
   * Currently noop.
   * @alias indent_level
   */
  indentLevel?: number;
  /**
   * Currently noop.
   * @alias indent_start
   */
  indentStart?: number;
  /**
   * Currently noop.
   * @alias inline_script
   */
  inlineScript?: boolean;
  /**
   * Currently noop.
   * @alias keep_numbers
   */
  keepNumbers?: number;
  /**
   * Currently noop.
   * @alias keep_quoted_props
   */
  keepQuotedProps?: boolean;
  /**
   * Currently noop.
   * @alias max_line_len
   */
  maxLineLen?: false | number;
  /**
   * Currently noop.
   */
  preamble?: string;
  /**
   * Currently noop.
   * @alias quote_keys
   */
  quoteKeys?: boolean;
  /**
   * Currently noop.
   * @alias quote_style
   */
  quoteStyle?: boolean;
  /**
   * Currently noop.
   * @alias preserve_annotations
   */
  preserveAnnotations?: boolean;
  /**
   * Currently noop.
   */
  safari10?: boolean;
  /**
   * Currently noop.
   */
  semicolons?: boolean;
  /**
   * Currently noop.
   */
  shebang?: boolean;
  /**
   * Currently noop.
   */
  webkit?: boolean;
  /**
   * Currently noop.
   * @alias wrap_iife
   */
  wrapIife?: boolean;
  /**
   * Currently noop.
   * @alias wrap_func_args
   */
  wrapFuncArgs?: boolean;
}
interface TerserCompressOptions {
  arguments?: boolean;
  arrows?: boolean;
  booleans?: boolean;
  booleans_as_integers?: boolean;
  collapse_vars?: boolean;
  comparisons?: boolean;
  computed_props?: boolean;
  conditionals?: boolean;
  dead_code?: boolean;
  defaults?: boolean;
  directives?: boolean;
  drop_console?: boolean;
  drop_debugger?: boolean;
  ecma?: TerserEcmaVersion;
  evaluate?: boolean;
  expression?: boolean;
  global_defs?: any;
  hoist_funs?: boolean;
  hoist_props?: boolean;
  hoist_vars?: boolean;
  ie8?: boolean;
  if_return?: boolean;
  inline?: 0 | 1 | 2 | 3;
  join_vars?: boolean;
  keep_classnames?: boolean;
  keep_fargs?: boolean;
  keep_fnames?: boolean;
  keep_infinity?: boolean;
  loops?: boolean;
  negate_iife?: boolean;
  passes?: number;
  properties?: boolean;
  pure_getters?: any;
  pure_funcs?: string[];
  reduce_funcs?: boolean;
  reduce_vars?: boolean;
  sequences?: any;
  side_effects?: boolean;
  switches?: boolean;
  top_retain?: any;
  toplevel?: any;
  typeofs?: boolean;
  unsafe?: boolean;
  unsafe_passes?: boolean;
  unsafe_arrows?: boolean;
  unsafe_comps?: boolean;
  unsafe_function?: boolean;
  unsafe_math?: boolean;
  unsafe_symbols?: boolean;
  unsafe_methods?: boolean;
  unsafe_proto?: boolean;
  unsafe_regexp?: boolean;
  unsafe_undefined?: boolean;
  unused?: boolean;
  const_to_let?: boolean;
  module?: boolean;
}
interface TerserMangleOptions {
  props?: TerserManglePropertiesOptions;
  /**
   * Pass `true` to mangle names declared in the top level scope.
   */
  topLevel?: boolean;
  /**
   * @deprecated An alias for compatibility with terser.
   */
  toplevel?: boolean;
  /**
   * Pass `true` to not mangle class names.
   */
  keepClassNames?: boolean;
  /**
   * @deprecated An alias for compatibility with terser.
   */
  keep_classnames?: boolean;
  /**
   * Pass `true` to not mangle function names.
   */
  keepFnNames?: boolean;
  /**
   * @deprecated An alias for compatibility with terser.
   */
  keep_fnames?: boolean;
  /**
   * Pass `true` to not mangle private props.
   */
  keepPrivateProps?: boolean;
  /**
   * @deprecated An alias for compatibility with terser.
   */
  keep_private_props?: boolean;
  ie8?: boolean;
  safari10?: boolean;
  reserved?: string[];
}
interface TerserManglePropertiesOptions {}
/**
 * Programmatic options.
 */
interface Options$1 extends Config {
  /**
   * If true, a file is parsed as a script instead of module.
   */
  script?: boolean;
  /**
   * The working directory that all paths in the programmatic
   * options will be resolved relative to.
   *
   * Defaults to `process.cwd()`.
   */
  cwd?: string;
  caller?: CallerOptions;
  /**
   * The filename associated with the code currently being compiled,
   * if there is one. The filename is optional, but not all of Swc's
   * functionality is available when the filename is unknown, because a
   * subset of options rely on the filename for their functionality.
   *
   * The three primary cases users could run into are:
   *
   * - The filename is exposed to plugins. Some plugins may require the
   * presence of the filename.
   * - Options like "test", "exclude", and "ignore" require the filename
   * for string/RegExp matching.
   * - .swcrc files are loaded relative to the file being compiled.
   * If this option is omitted, Swc will behave as if swcrc: false has been set.
   */
  filename?: string;
  /**
   * The initial path that will be processed based on the "rootMode" to
   * determine the conceptual root folder for the current Swc project.
   * This is used in two primary cases:
   *
   * - The base directory when checking for the default "configFile" value
   * - The default value for "swcrcRoots".
   *
   * Defaults to `opts.cwd`
   */
  root?: string;
  /**
   * This option, combined with the "root" value, defines how Swc chooses
   * its project root. The different modes define different ways that Swc
   * can process the "root" value to get the final project root.
   *
   * "root" - Passes the "root" value through as unchanged.
   * "upward" - Walks upward from the "root" directory, looking for a directory
   * containing a swc.config.js file, and throws an error if a swc.config.js
   * is not found.
   * "upward-optional" - Walk upward from the "root" directory, looking for
   * a directory containing a swc.config.js file, and falls back to "root"
   *  if a swc.config.js is not found.
   *
   *
   * "root" is the default mode because it avoids the risk that Swc
   * will accidentally load a swc.config.js that is entirely outside
   * of the current project folder. If you use "upward-optional",
   * be aware that it will walk up the directory structure all the
   * way to the filesystem root, and it is always possible that someone
   * will have a forgotten swc.config.js in their home directory,
   * which could cause unexpected errors in your builds.
   *
   *
   * Users with monorepo project structures that run builds/tests on a
   * per-package basis may well want to use "upward" since monorepos
   * often have a swc.config.js in the project root. Running Swc
   * in a monorepo subdirectory without "upward", will cause Swc
   * to skip loading any swc.config.js files in the project root,
   * which can lead to unexpected errors and compilation failure.
   */
  rootMode?: 'root' | 'upward-optional' | 'upward';
  /**
   * The current active environment used during configuration loading.
   * This value is used as the key when resolving "env" configs,
   * and is also available inside configuration functions, plugins,
   * and presets, via the api.env() function.
   *
   * Defaults to `process.env.SWC_ENV || process.env.NODE_ENV || "development"`
   */
  envName?: string;
  /**
   * Defaults to searching for a default `.swcrc` file, but can
   * be passed the path of any JS or JSON5 config file.
   *
   *
   * NOTE: This option does not affect loading of .swcrc files,
   * so while it may be tempting to do configFile: "./foo/.swcrc",
   * it is not recommended. If the given .swcrc is loaded via the
   * standard file-relative logic, you'll end up loading the same
   * config file twice, merging it with itself. If you are linking
   * a specific config file, it is recommended to stick with a
   * naming scheme that is independent of the "swcrc" name.
   *
   * Defaults to `path.resolve(opts.root, ".swcrc")`
   */
  configFile?: boolean | string;
  /**
   * true will enable searching for configuration files relative to the "filename" provided to Swc.
   *
   * A swcrc value passed in the programmatic options will override one set within a configuration file.
   *
   * Note: .swcrc files are only loaded if the current "filename" is inside of
   *  a package that matches one of the "swcrcRoots" packages.
   *
   *
   * Defaults to true as long as the filename option has been specified
   */
  swcrc?: boolean;
  /**
   * By default, Babel will only search for .babelrc files within the "root" package
   *  because otherwise Babel cannot know if a given .babelrc is meant to be loaded,
   *  or if it's "plugins" and "presets" have even been installed, since the file
   *  being compiled could be inside node_modules, or have been symlinked into the project.
   *
   *
   * This option allows users to provide a list of other packages that should be
   * considered "root" packages when considering whether to load .babelrc files.
   *
   *
   * For example, a monorepo setup that wishes to allow individual packages
   * to have their own configs might want to do
   *
   *
   *
   * Defaults to `opts.root`
   */
  swcrcRoots?: boolean | MatchPattern | MatchPattern[];
  /**
   * `true` will attempt to load an input sourcemap from the file itself, if it
   * contains a //# sourceMappingURL=... comment. If no map is found, or the
   * map fails to load and parse, it will be silently discarded.
   *
   *  If an object is provided, it will be treated as the source map object itself.
   *
   * Defaults to `true`.
   */
  inputSourceMap?: boolean | string;
  /**
   * The name to use for the file inside the source map object.
   *
   * Defaults to `path.basename(opts.filenameRelative)` when available, or `"unknown"`.
   */
  sourceFileName?: string;
  /**
   * The sourceRoot fields to set in the generated source map, if one is desired.
   */
  sourceRoot?: string;
  plugin?: Plugin$1;
  isModule?: 'unknown' | boolean;
  /**
   * Destination path. Note that this value is used only to fix source path
   * of source map files and swc does not write output to this path.
   */
  outputPath?: string;
}
interface CallerOptions {
  name: string;
  [key: string]: any;
}
/**
 * .swcrc
 */
interface Config {
  /**
   * Note: The type is string because it follows rust's regex syntax.
   */
  test?: string | string[];
  /**
   * Note: The type is string because it follows rust's regex syntax.
   */
  exclude?: string | string[];
  env?: EnvConfig;
  jsc?: JscConfig;
  module?: ModuleConfig;
  minify?: boolean;
  /**
   * - true to generate a sourcemap for the code and include it in the result object.
   * - "inline" to generate a sourcemap and append it as a data URL to the end of the code, but not include it in the result object.
   *
   * `swc-cli` overloads some of these to also affect how maps are written to disk:
   *
   * - true will write the map to a .map file on disk
   * - "inline" will write the file directly, so it will have a data: containing the map
   * - Note: These options are bit weird, so it may make the most sense to just use true
   *  and handle the rest in your own code, depending on your use case.
   */
  sourceMaps?: 'inline' | boolean;
  inlineSourcesContent?: boolean;
}
/**
 * Configuration ported from babel-preset-env
 */
interface EnvConfig {
  mode?: 'entry' | 'usage';
  debug?: boolean;
  dynamicImport?: boolean;
  loose?: boolean;
  /**
   * Transpiles the broken syntax to the closest non-broken modern syntax
   *
   * Defaults to false.
   */
  bugfixes?: boolean;
  skip?: string[];
  include?: string[];
  exclude?: string[];
  /**
   * The version of the used core js.
   *
   */
  coreJs?: string;
  targets?: any;
  path?: string;
  shippedProposals?: boolean;
  /**
   * Enable all transforms
   */
  forceAllTransforms?: boolean;
}
interface JscConfig {
  assumptions?: Assumptions;
  loose?: boolean;
  /**
   * Defaults to EsParserConfig
   */
  parser?: ParserConfig;
  transform?: TransformConfig;
  /**
   * Use `@swc/helpers` instead of inline helpers.
   */
  externalHelpers?: boolean;
  /**
   * Defaults to `es3` (which enabled **all** pass).
   */
  target?: JscTarget;
  /**
   * Keep class names.
   */
  keepClassNames?: boolean;
  /**
   * This is experimental, and can be removed without a major version bump.
   */
  experimental?: {
    /**
     * Specify the location where SWC stores its intermediate cache files.
     * Currently only transform plugin uses this. If not specified, SWC will
     * create `.swc` directories.
     */
    cacheRoot?: string;
    /**
     * Disable all lint rules.
     */
    disableAllLints?: boolean;
    /**
     * Disable builtin transforms. If enabled, only Wasm plugins are used.
     */
    disableBuiltinTransformsForInternalTesting?: boolean;
    /**
     * Use `assert` instead of `with` for imports and exports.
     * This option only works when `keepImportAttributes` is `true`.
     */
    emitAssertForImportAttributes?: boolean;
    /**
     * Emit isolated dts files for each module.
     */
    emitIsolatedDts?: boolean;
    /**
     * Keep import assertions.
     */
    keepImportAssertions?: boolean;
    /**
     * Preserve `with` in imports and exports.
     *
     * @deprecated Use `keepImportAssertions` instead.
     */
    keepImportAttributes?: boolean;
    optimizeHygiene?: boolean;
    /**
     * List of custom transform plugins written in WebAssembly.
     * First parameter of tuple indicates the name of the plugin - it can be either
     * a name of the npm package can be resolved, or absolute path to .wasm binary.
     *
     * Second parameter of tuple is JSON based configuration for the plugin.
     */
    plugins?: WasmPlugin[];
    /**
     * Run Wasm plugins before stripping TypeScript or decorators.
     *
     * See https://github.com/swc-project/swc/issues/9132 for more details.
     */
    runPluginFirst?: boolean;
  };
  baseUrl?: string;
  paths?: {
    [from: string]: string[];
  };
  minify?: JsMinifyOptions;
  preserveAllComments?: boolean;
}
type JscTarget = 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'es3' | 'es5' | 'esnext';
type ParserConfig = EsParserConfig | TsParserConfig;
interface TsParserConfig {
  syntax: 'typescript';
  /**
   * Defaults to `false`.
   */
  tsx?: boolean;
  /**
   * Defaults to `false`.
   */
  decorators?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  dynamicImport?: boolean;
}
interface EsParserConfig {
  syntax: 'ecmascript';
  /**
   * Defaults to false.
   */
  jsx?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  numericSeparator?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  classPrivateProperty?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  privateMethod?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  classProperty?: boolean;
  /**
   * Defaults to `false`
   */
  functionBind?: boolean;
  /**
   * Defaults to `false`
   */
  decorators?: boolean;
  /**
   * Defaults to `false`
   */
  decoratorsBeforeExport?: boolean;
  /**
   * Defaults to `false`
   */
  exportDefaultFrom?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  exportNamespaceFrom?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  dynamicImport?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  nullishCoalescing?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  optionalChaining?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  importMeta?: boolean;
  /**
   * @deprecated Always true because it's in ecmascript spec.
   */
  topLevelAwait?: boolean;
  /**
   * @deprecated An alias of `importAttributes`
   */
  importAssertions?: boolean;
  /**
   * Defaults to `false`
   */
  importAttributes?: boolean;
  /**
   * Defaults to `false`
   */
  allowSuperOutsideMethod?: boolean;
  /**
   * Defaults to `false`
   */
  allowReturnOutsideFunction?: boolean;
  /**
   * Defaults to `false`
   */
  autoAccessors?: boolean;
  /**
   * Defaults to `false`
   */
  explicitResourceManagement?: boolean;
}
/**
 * Options for transform.
 */
interface TransformConfig {
  /**
   * Effective only if `syntax` supports ƒ.
   */
  react?: ReactConfig;
  constModules?: ConstModulesConfig;
  /**
   * Defaults to null, which skips optimizer pass.
   */
  optimizer?: OptimizerConfig;
  /**
   * https://swc.rs/docs/configuration/compilation#jsctransformlegacydecorator
   */
  legacyDecorator?: boolean;
  /**
   * https://swc.rs/docs/configuration/compilation#jsctransformdecoratormetadata
   */
  decoratorMetadata?: boolean;
  /**
   * https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion
   */
  decoratorVersion?: '2021-12' | '2022-03';
  treatConstEnumAsEnum?: boolean;
  /**
   * https://www.typescriptlang.org/tsconfig#useDefineForClassFields
   */
  useDefineForClassFields?: boolean;
  /**
   * https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
   */
  verbatimModuleSyntax?: boolean;
}
interface ReactConfig {
  /**
   * Replace the function used when compiling JSX expressions.
   *
   * Defaults to `React.createElement`.
   */
  pragma?: string;
  /**
   * Replace the component used when compiling JSX fragments.
   *
   * Defaults to `React.Fragment`
   */
  pragmaFrag?: string;
  /**
   * Toggles whether or not to throw an error if a XML namespaced tag name is used. For example:
   * `<f:image />`
   *
   * Though the JSX spec allows this, it is disabled by default since React's
   * JSX does not currently have support for it.
   *
   */
  throwIfNamespace?: boolean;
  /**
   * Toggles plugins that aid in development, such as @swc/plugin-transform-react-jsx-self
   * and @swc/plugin-transform-react-jsx-source.
   *
   * Defaults to `false`,
   *
   */
  development?: boolean;
  /**
   * Use `Object.assign()` instead of `_extends`. Defaults to false.
   * @deprecated
   */
  useBuiltins?: boolean;
  /**
   * Enable fast refresh feature for React app
   */
  refresh?: boolean | {
    /**
     * Flag to emit full signatures.
     *
     * Defaults to `false`
     */
    emitFullSignatures?: boolean;
    /**
     * Identifier for the `react-refresh` register function.
     *
     * Defaults to `$RefreshReg$`
     */
    refreshReg?: string;
    /**
     * Identifier for the `react-refresh` signature function.
     *
     * Defaults to `$RefreshSig$`
     */
    refreshSig?: string;
  };
  /**
   * jsx runtime
   */
  runtime?: 'automatic' | 'classic';
  /**
   * Declares the module specifier to be used for importing the `jsx` and `jsxs` factory functions when using `runtime` 'automatic'
   */
  importSource?: string;
}
/**
 *  - `import { DEBUG } from '@ember/env-flags';`
 *  - `import { FEATURE_A, FEATURE_B } from '@ember/features';`
 *
 * See: https://github.com/swc-project/swc/issues/18#issuecomment-466272558
 */
interface ConstModulesConfig {
  globals?: {
    [module: string]: {
      [name: string]: string;
    };
  };
}
interface OptimizerConfig {
  simplify?: boolean;
  globals?: GlobalPassOption;
  jsonify?: {
    minCost: number;
  };
}
/**
 * Options for inline-global pass.
 */
interface GlobalPassOption {
  /**
   * Global variables that should be inlined with passed value.
   *
   * e.g. `{ __DEBUG__: true }`
   */
  vars?: Record<string, string>;
  /**
   * Names of environment variables that should be inlined with the value of corresponding env during build.
   *
   * Defaults to `["NODE_ENV", "SWC_ENV"]`
   */
  envs?: Record<string, string> | string[];
  /**
   * Replaces typeof calls for passed variables with corresponding value
   *
   * e.g. `{ window: 'object' }`
   */
  typeofs?: Record<string, string>;
}
type ModuleConfig = AmdConfig | CommonJsConfig | Es6Config | NodeNextConfig | SystemjsConfig | UmdConfig;
interface BaseModuleConfig {
  /**
   * By default, when using exports with babel a non-enumerable `__esModule`
   * property is exported. In some cases this property is used to determine
   * if the import is the default export or if it contains the default export.
   *
   * In order to prevent the __esModule property from being exported, you
   *  can set the strict option to true.
   *
   * Defaults to `false`.
   */
  strict?: boolean;
  /**
   * Emits 'use strict' directive.
   *
   * Defaults to `true`.
   */
  strictMode?: boolean;
  /**
   * Changes Babel's compiled import statements to be lazily evaluated when their imported bindings are used for the first time.
   *
   * This can improve initial load time of your module because evaluating dependencies up
   *  front is sometimes entirely un-necessary. This is especially the case when implementing
   *  a library module.
   *
   *
   * The value of `lazy` has a few possible effects:
   *
   *  - `false` - No lazy initialization of any imported module.
   *  - `true` - Do not lazy-initialize local `./foo` imports, but lazy-init `foo` dependencies.
   *
   * Local paths are much more likely to have circular dependencies, which may break if loaded lazily,
   * so they are not lazy by default, whereas dependencies between independent modules are rarely cyclical.
   *
   *  - `Array<string>` - Lazy-initialize all imports with source matching one of the given strings.
   *
   * -----
   *
   * The two cases where imports can never be lazy are:
   *
   *  - `import "foo";`
   *
   * Side-effect imports are automatically non-lazy since their very existence means
   *  that there is no binding to later kick off initialization.
   *
   *  - `export * from "foo"`
   *
   * Re-exporting all names requires up-front execution because otherwise there is no
   * way to know what names need to be exported.
   *
   * Defaults to `false`.
   */
  lazy?: boolean | string[];
  /**
   * @deprecated  Use the `importInterop` option instead.
   *
   * By default, when using exports with swc a non-enumerable __esModule property is exported.
   * This property is then used to determine if the import is the default export or if
   *  it contains the default export.
   *
   * In cases where the auto-unwrapping of default is not needed, you can set the noInterop option
   *  to true to avoid the usage of the interopRequireDefault helper (shown in inline form above).
   *
   * Defaults to `false`.
   */
  noInterop?: boolean;
  /**
   * Defaults to `swc`.
   *
   * CommonJS modules and ECMAScript modules are not fully compatible.
   * However, compilers, bundlers and JavaScript runtimes developed different strategies
   * to make them work together as well as possible.
   *
   * - `swc` (alias: `babel`)
   *
   * When using exports with `swc` a non-enumerable `__esModule` property is exported
   * This property is then used to determine if the import is the default export
   * or if it contains the default export.
   *
   * ```javascript
   * import foo from "foo";
   * import { bar } from "bar";
   * foo;
   * bar;
   *
   * // Is compiled to ...
   *
   * "use strict";
   *
   * function _interop_require_default(obj) {
   *   return obj && obj.__esModule ? obj : { default: obj };
   * }
   *
   * var _foo = _interop_require_default(require("foo"));
   * var _bar = require("bar");
   *
   * _foo.default;
   * _bar.bar;
   * ```
   *
   * When this import interop is used, if both the imported and the importer module are compiled
   * with swc they behave as if none of them was compiled.
   *
   * This is the default behavior.
   *
   * - `node`
   *
   * When importing CommonJS files (either directly written in CommonJS, or generated with a compiler)
   * Node.js always binds the `default` export to the value of `module.exports`.
   *
   * ```javascript
   * import foo from "foo";
   * import { bar } from "bar";
   * foo;
   * bar;
   *
   * // Is compiled to ...
   *
   * "use strict";
   *
   * var _foo = require("foo");
   * var _bar = require("bar");
   *
   * _foo;
   * _bar.bar;
   * ```
   * This is not exactly the same as what Node.js does since swc allows accessing any property of `module.exports`
   * as a named export, while Node.js only allows importing statically analyzable properties of `module.exports`.
   * However, any import working in Node.js will also work when compiled with swc using `importInterop: "node"`.
   *
   * - `none`
   *
   * If you know that the imported file has been transformed with a compiler that stores the `default` export on
   * `exports.default` (such as swc or Babel), you can safely omit the `_interop_require_default` helper.
   *
   * ```javascript
   * import foo from "foo";
   * import { bar } from "bar";
   * foo;
   * bar;
   *
   * // Is compiled to ...
   *
   * "use strict";
   *
   * var _foo = require("foo");
   * var _bar = require("bar");
   *
   * _foo.default;
   * _bar.bar;
   * ```
   */
  importInterop?: 'babel' | 'node' | 'none' | 'swc';
  /**
   * Output extension for generated files.
   *
   * Defaults to `js`.
   */
  outFileExtension?: 'cjs' | 'js' | 'mjs';
  /**
   * Emits `cjs-module-lexer` annotation
   * `cjs-module-lexer` is used in Node.js core for detecting the named exports available when importing a CJS module into ESM.
   * swc will emit `cjs-module-lexer` detectable annotation with this option enabled.
   *
   * Defaults to `true` if import_interop is Node, else `false`
   */
  exportInteropAnnotation?: boolean;
  /**
   * If set to true, dynamic imports will be preserved.
   */
  ignoreDynamic?: boolean;
  allowTopLevelThis?: boolean;
  preserveImportMeta?: boolean;
}
interface Es6Config extends BaseModuleConfig {
  type: 'es6';
}
interface NodeNextConfig extends BaseModuleConfig {
  type: 'nodenext';
}
interface CommonJsConfig extends BaseModuleConfig {
  type: 'commonjs';
}
interface UmdConfig extends BaseModuleConfig {
  type: 'umd';
  globals?: {
    [key: string]: string;
  };
}
interface AmdConfig extends BaseModuleConfig {
  type: 'amd';
  moduleId?: string;
}
interface SystemjsConfig {
  type: 'systemjs';
  allowTopLevelThis?: boolean;
}
interface MatchPattern {}
interface Span {
  start: number;
  end: number;
  ctxt: number;
}
interface Node {
  type: string;
}
interface HasSpan {
  span: Span;
}
interface HasDecorator {
  decorators?: Decorator[];
}
interface Class extends HasDecorator, HasSpan {
  body: ClassMember[];
  superClass?: Expression;
  isAbstract: boolean;
  typeParams?: TsTypeParameterDeclaration;
  superTypeParams?: TsTypeParameterInstantiation;
  implements: TsExpressionWithTypeArguments[];
}
type ClassMember = ClassMethod | ClassProperty | Constructor | EmptyStatement | PrivateMethod | PrivateProperty | StaticBlock | TsIndexSignature;
interface ClassPropertyBase extends HasDecorator, HasSpan, Node {
  value?: Expression;
  typeAnnotation?: TsTypeAnnotation;
  isStatic: boolean;
  accessibility?: Accessibility;
  isOptional: boolean;
  isOverride: boolean;
  readonly: boolean;
  definite: boolean;
}
interface ClassProperty extends ClassPropertyBase {
  type: 'ClassProperty';
  key: PropertyName;
  isAbstract: boolean;
  declare: boolean;
}
interface PrivateProperty extends ClassPropertyBase {
  type: 'PrivateProperty';
  key: PrivateName;
}
interface Param extends HasDecorator, HasSpan, Node {
  type: 'Parameter';
  pat: Pattern;
}
interface Constructor extends HasSpan, Node {
  type: 'Constructor';
  key: PropertyName;
  params: (Param | TsParameterProperty)[];
  body?: BlockStatement;
  accessibility?: Accessibility;
  isOptional: boolean;
}
interface ClassMethodBase extends HasSpan, Node {
  function: Fn;
  kind: MethodKind;
  isStatic: boolean;
  accessibility?: Accessibility;
  isAbstract: boolean;
  isOptional: boolean;
  isOverride: boolean;
}
interface ClassMethod extends ClassMethodBase {
  type: 'ClassMethod';
  key: PropertyName;
}
interface PrivateMethod extends ClassMethodBase {
  type: 'PrivateMethod';
  key: PrivateName;
}
interface StaticBlock extends HasSpan, Node {
  type: 'StaticBlock';
  body: BlockStatement;
}
interface Decorator extends HasSpan, Node {
  type: 'Decorator';
  expression: Expression;
}
type MethodKind = 'getter' | 'method' | 'setter';
type Declaration = ClassDeclaration | FunctionDeclaration | TsEnumDeclaration | TsInterfaceDeclaration | TsModuleDeclaration | TsTypeAliasDeclaration | VariableDeclaration;
interface FunctionDeclaration extends Fn {
  type: 'FunctionDeclaration';
  identifier: Identifier;
  declare: boolean;
}
interface ClassDeclaration extends Class, Node {
  type: 'ClassDeclaration';
  identifier: Identifier;
  declare: boolean;
}
interface VariableDeclaration extends HasSpan, Node {
  type: 'VariableDeclaration';
  kind: VariableDeclarationKind;
  declare: boolean;
  declarations: VariableDeclarator[];
}
type VariableDeclarationKind = 'const' | 'let' | 'var';
interface VariableDeclarator extends HasSpan, Node {
  type: 'VariableDeclarator';
  id: Pattern;
  init?: Expression;
  definite: boolean;
}
type Expression = ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | Invalid | JSXElement | JSXEmptyExpression | JSXFragment | JSXMemberExpression | JSXNamespacedName | Literal | MemberExpression | MetaProperty | NewExpression | ObjectExpression | OptionalChainingExpression | ParenthesisExpression | PrivateName | SequenceExpression | SuperPropExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TsAsExpression | TsConstAssertion | TsInstantiation | TsNonNullExpression | TsSatisfiesExpression | TsTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression;
interface ExpressionBase extends HasSpan, Node {}
interface Identifier extends ExpressionBase {
  type: 'Identifier';
  value: string;
  optional: boolean;
}
interface OptionalChainingExpression extends ExpressionBase {
  type: 'OptionalChainingExpression';
  questionDotToken: Span;
  /**
   * Call expression or member expression.
   */
  base: MemberExpression | OptionalChainingCall;
}
interface OptionalChainingCall extends ExpressionBase {
  type: 'CallExpression';
  callee: Expression;
  arguments: ExprOrSpread[];
  typeArguments?: TsTypeParameterInstantiation;
}
interface ThisExpression extends ExpressionBase {
  type: 'ThisExpression';
}
interface ArrayExpression extends ExpressionBase {
  type: 'ArrayExpression';
  elements: (ExprOrSpread | undefined)[];
}
interface ExprOrSpread {
  spread?: Span;
  expression: Expression;
}
interface ObjectExpression extends ExpressionBase {
  type: 'ObjectExpression';
  properties: (Property | SpreadElement)[];
}
interface Argument {
  spread?: Span;
  expression: Expression;
}
interface SpreadElement extends Node {
  type: 'SpreadElement';
  spread: Span;
  arguments: Expression;
}
interface UnaryExpression extends ExpressionBase {
  type: 'UnaryExpression';
  operator: UnaryOperator;
  argument: Expression;
}
interface UpdateExpression extends ExpressionBase {
  type: 'UpdateExpression';
  operator: UpdateOperator;
  prefix: boolean;
  argument: Expression;
}
interface BinaryExpression extends ExpressionBase {
  type: 'BinaryExpression';
  operator: BinaryOperator;
  left: Expression;
  right: Expression;
}
interface FunctionExpression extends ExpressionBase, Fn {
  type: 'FunctionExpression';
  identifier?: Identifier;
}
interface ClassExpression extends Class, ExpressionBase {
  type: 'ClassExpression';
  identifier?: Identifier;
}
interface AssignmentExpression extends ExpressionBase {
  type: 'AssignmentExpression';
  operator: AssignmentOperator;
  left: Expression | Pattern;
  right: Expression;
}
interface MemberExpression extends ExpressionBase {
  type: 'MemberExpression';
  object: Expression;
  property: ComputedPropName | Identifier | PrivateName;
}
interface SuperPropExpression extends ExpressionBase {
  type: 'SuperPropExpression';
  obj: Super;
  property: ComputedPropName | Identifier;
}
interface ConditionalExpression extends ExpressionBase {
  type: 'ConditionalExpression';
  test: Expression;
  consequent: Expression;
  alternate: Expression;
}
interface Super extends HasSpan, Node {
  type: 'Super';
}
interface Import extends HasSpan, Node {
  type: 'Import';
}
interface CallExpression extends ExpressionBase {
  type: 'CallExpression';
  callee: Expression | Import | Super;
  arguments: Argument[];
  typeArguments?: TsTypeParameterInstantiation;
}
interface NewExpression extends ExpressionBase {
  type: 'NewExpression';
  callee: Expression;
  arguments?: Argument[];
  typeArguments?: TsTypeParameterInstantiation;
}
interface SequenceExpression extends ExpressionBase {
  type: 'SequenceExpression';
  expressions: Expression[];
}
interface ArrowFunctionExpression extends ExpressionBase {
  type: 'ArrowFunctionExpression';
  params: Pattern[];
  body: BlockStatement | Expression;
  async: boolean;
  generator: boolean;
  typeParameters?: TsTypeParameterDeclaration;
  returnType?: TsTypeAnnotation;
}
interface YieldExpression extends ExpressionBase {
  type: 'YieldExpression';
  argument?: Expression;
  delegate: boolean;
}
interface MetaProperty extends HasSpan, Node {
  type: 'MetaProperty';
  kind: 'import.meta' | 'new.target';
}
interface AwaitExpression extends ExpressionBase {
  type: 'AwaitExpression';
  argument: Expression;
}
interface TemplateLiteral extends ExpressionBase {
  type: 'TemplateLiteral';
  expressions: Expression[];
  quasis: TemplateElement[];
}
interface TaggedTemplateExpression extends ExpressionBase {
  type: 'TaggedTemplateExpression';
  tag: Expression;
  typeParameters?: TsTypeParameterInstantiation;
  template: TemplateLiteral;
}
interface TemplateElement extends ExpressionBase {
  type: 'TemplateElement';
  tail: boolean;
  cooked?: string;
  raw: string;
}
interface ParenthesisExpression extends ExpressionBase {
  type: 'ParenthesisExpression';
  expression: Expression;
}
interface Fn extends HasDecorator, HasSpan {
  params: Param[];
  body?: BlockStatement;
  generator: boolean;
  async: boolean;
  typeParameters?: TsTypeParameterDeclaration;
  returnType?: TsTypeAnnotation;
}
interface PatternBase extends HasSpan, Node {
  typeAnnotation?: TsTypeAnnotation;
}
interface PrivateName extends ExpressionBase {
  type: 'PrivateName';
  id: Identifier;
}
type JSXObject = Identifier | JSXMemberExpression;
interface JSXMemberExpression extends Node {
  type: 'JSXMemberExpression';
  object: JSXObject;
  property: Identifier;
}
/**
 * XML-based namespace syntax:
 */
interface JSXNamespacedName extends Node {
  type: 'JSXNamespacedName';
  namespace: Identifier;
  name: Identifier;
}
interface JSXEmptyExpression extends HasSpan, Node {
  type: 'JSXEmptyExpression';
}
interface JSXExpressionContainer extends HasSpan, Node {
  type: 'JSXExpressionContainer';
  expression: JSXExpression;
}
type JSXExpression = Expression | JSXEmptyExpression;
interface JSXSpreadChild extends HasSpan, Node {
  type: 'JSXSpreadChild';
  expression: Expression;
}
type JSXElementName = Identifier | JSXMemberExpression | JSXNamespacedName;
interface JSXOpeningElement extends HasSpan, Node {
  type: 'JSXOpeningElement';
  name: JSXElementName;
  attributes: JSXAttributeOrSpread[];
  selfClosing: boolean;
  typeArguments?: TsTypeParameterInstantiation;
}
type JSXAttributeOrSpread = JSXAttribute | SpreadElement;
interface JSXClosingElement extends HasSpan, Node {
  type: 'JSXClosingElement';
  name: JSXElementName;
}
interface JSXAttribute extends HasSpan, Node {
  type: 'JSXAttribute';
  name: JSXAttributeName;
  value?: JSXAttrValue;
}
type JSXAttributeName = Identifier | JSXNamespacedName;
type JSXAttrValue = JSXElement | JSXExpressionContainer | JSXFragment | Literal;
interface JSXText extends HasSpan, Node {
  type: 'JSXText';
  value: string;
  raw: string;
}
interface JSXElement extends HasSpan, Node {
  type: 'JSXElement';
  opening: JSXOpeningElement;
  children: JSXElementChild[];
  closing?: JSXClosingElement;
}
type JSXElementChild = JSXElement | JSXExpressionContainer | JSXFragment | JSXSpreadChild | JSXText;
interface JSXFragment extends HasSpan, Node {
  type: 'JSXFragment';
  opening: JSXOpeningFragment;
  children: JSXElementChild[];
  closing: JSXClosingFragment;
}
interface JSXOpeningFragment extends HasSpan, Node {
  type: 'JSXOpeningFragment';
}
interface JSXClosingFragment extends HasSpan, Node {
  type: 'JSXClosingFragment';
}
type Literal = BigIntLiteral | BooleanLiteral | JSXText | NullLiteral | NumericLiteral | RegExpLiteral | StringLiteral;
interface StringLiteral extends HasSpan, Node {
  type: 'StringLiteral';
  value: string;
  raw?: string;
}
interface BooleanLiteral extends HasSpan, Node {
  type: 'BooleanLiteral';
  value: boolean;
}
interface NullLiteral extends HasSpan, Node {
  type: 'NullLiteral';
}
interface RegExpLiteral extends HasSpan, Node {
  type: 'RegExpLiteral';
  pattern: string;
  flags: string;
}
interface NumericLiteral extends HasSpan, Node {
  type: 'NumericLiteral';
  value: number;
  raw?: string;
}
interface BigIntLiteral extends HasSpan, Node {
  type: 'BigIntLiteral';
  value: bigint;
  raw?: string;
}
type ModuleDeclaration = ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportNamedDeclaration | ImportDeclaration | TsExportAssignment | TsImportEqualsDeclaration | TsNamespaceExportDeclaration;
interface ExportDefaultExpression extends HasSpan, Node {
  type: 'ExportDefaultExpression';
  expression: Expression;
}
interface ExportDeclaration extends HasSpan, Node {
  type: 'ExportDeclaration';
  declaration: Declaration;
}
interface ImportDeclaration extends HasSpan, Node {
  type: 'ImportDeclaration';
  specifiers: ImportSpecifier[];
  source: StringLiteral;
  typeOnly: boolean;
  asserts?: ObjectExpression;
}
interface ExportAllDeclaration extends HasSpan, Node {
  type: 'ExportAllDeclaration';
  source: StringLiteral;
  asserts?: ObjectExpression;
}
/**
 * - `export { foo } from 'mod'`
 * - `export { foo as bar } from 'mod'`
 */
interface ExportNamedDeclaration extends HasSpan, Node {
  type: 'ExportNamedDeclaration';
  specifiers: ExportSpecifier[];
  source?: StringLiteral;
  typeOnly: boolean;
  asserts?: ObjectExpression;
}
interface ExportDefaultDeclaration extends HasSpan, Node {
  type: 'ExportDefaultDeclaration';
  decl: DefaultDecl;
}
type DefaultDecl = ClassExpression | FunctionExpression | TsInterfaceDeclaration;
type ImportSpecifier = ImportDefaultSpecifier | ImportNamespaceSpecifier | NamedImportSpecifier;
/**
 * e.g. `import foo from 'mod.js'`
 */
interface ImportDefaultSpecifier extends HasSpan, Node {
  type: 'ImportDefaultSpecifier';
  local: Identifier;
}
/**
 * e.g. `import * as foo from 'mod.js'`.
 */
interface ImportNamespaceSpecifier extends HasSpan, Node {
  type: 'ImportNamespaceSpecifier';
  local: Identifier;
}
/**
 * e.g. - `import { foo } from 'mod.js'`
 *
 * local = foo, imported = None
 *
 * e.g. `import { foo as bar } from 'mod.js'`
 *
 * local = bar, imported = Some(foo) for
 */
interface NamedImportSpecifier extends HasSpan, Node {
  type: 'ImportSpecifier';
  local: Identifier;
  imported?: ModuleExportName;
  isTypeOnly: boolean;
}
type ModuleExportName = Identifier | StringLiteral;
type ExportSpecifier = ExportDefaultSpecifier | ExportNamespaceSpecifier | NamedExportSpecifier;
/**
 * `export * as foo from 'src';`
 */
interface ExportNamespaceSpecifier extends HasSpan, Node {
  type: 'ExportNamespaceSpecifier';
  name: ModuleExportName;
}
interface ExportDefaultSpecifier extends HasSpan, Node {
  type: 'ExportDefaultSpecifier';
  exported: Identifier;
}
interface NamedExportSpecifier extends HasSpan, Node {
  type: 'ExportSpecifier';
  orig: ModuleExportName;
  /**
   * `Some(bar)` in `export { foo as bar }`
   */
  exported?: ModuleExportName;
  isTypeOnly: boolean;
}
interface HasInterpreter {
  /**
   * e.g. `/usr/bin/node` for `#!/usr/bin/node`
   */
  interpreter: string;
}
type Program = Module | Script;
interface Module extends HasInterpreter, HasSpan, Node {
  type: 'Module';
  body: ModuleItem[];
}
interface Script extends HasInterpreter, HasSpan, Node {
  type: 'Script';
  body: Statement[];
}
type ModuleItem = ModuleDeclaration | Statement;
type BinaryOperator = '-' | '!=' | '!==' | '??' | '*' | '**' | '/' | '&' | '&&' | '%' | '^' | '+' | '<' | '<<' | '<=' | '==' | '===' | '>' | '>=' | '>>' | '>>>' | '|' | '||' | 'in' | 'instanceof';
type AssignmentOperator = '-=' | '??=' | '**=' | '*=' | '/=' | '&&=' | '&=' | '%=' | '^=' | '+=' | '<<=' | '=' | '>>=' | '>>>=' | '|=' | '||=';
type UpdateOperator = '--' | '++';
type UnaryOperator = '-' | '!' | '+' | '~' | 'delete' | 'typeof' | 'void';
type Pattern = ArrayPattern | AssignmentPattern | BindingIdentifier | Expression | Invalid | ObjectPattern | RestElement;
interface BindingIdentifier extends PatternBase {
  type: 'Identifier';
  value: string;
  optional: boolean;
}
interface ArrayPattern extends PatternBase {
  type: 'ArrayPattern';
  elements: (Pattern | undefined)[];
  optional: boolean;
}
interface ObjectPattern extends PatternBase {
  type: 'ObjectPattern';
  properties: ObjectPatternProperty[];
  optional: boolean;
}
interface AssignmentPattern extends PatternBase {
  type: 'AssignmentPattern';
  left: Pattern;
  right: Expression;
}
interface RestElement extends PatternBase {
  type: 'RestElement';
  rest: Span;
  argument: Pattern;
}
type ObjectPatternProperty = AssignmentPatternProperty | KeyValuePatternProperty | RestElement;
/**
 * `{key: value}`
 */
interface KeyValuePatternProperty extends Node {
  type: 'KeyValuePatternProperty';
  key: PropertyName;
  value: Pattern;
}
/**
 * `{key}` or `{key = value}`
 */
interface AssignmentPatternProperty extends HasSpan, Node {
  type: 'AssignmentPatternProperty';
  key: Identifier;
  value?: Expression;
}
/** Identifier is `a` in `{ a, }` */
type Property = AssignmentProperty | GetterProperty | Identifier | KeyValueProperty | MethodProperty | SetterProperty;
interface PropBase extends Node {
  key: PropertyName;
}
interface KeyValueProperty extends PropBase {
  type: 'KeyValueProperty';
  value: Expression;
}
interface AssignmentProperty extends Node {
  type: 'AssignmentProperty';
  key: Identifier;
  value: Expression;
}
interface GetterProperty extends HasSpan, PropBase {
  type: 'GetterProperty';
  typeAnnotation?: TsTypeAnnotation;
  body?: BlockStatement;
}
interface SetterProperty extends HasSpan, PropBase {
  type: 'SetterProperty';
  param: Pattern;
  body?: BlockStatement;
}
interface MethodProperty extends Fn, PropBase {
  type: 'MethodProperty';
}
type PropertyName = BigIntLiteral | ComputedPropName | Identifier | NumericLiteral | StringLiteral;
interface ComputedPropName extends HasSpan, Node {
  type: 'Computed';
  expression: Expression;
}
interface BlockStatement extends HasSpan, Node {
  type: 'BlockStatement';
  stmts: Statement[];
}
interface ExpressionStatement extends HasSpan, Node {
  type: 'ExpressionStatement';
  expression: Expression;
}
type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | Declaration | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement;
interface EmptyStatement extends HasSpan, Node {
  type: 'EmptyStatement';
}
interface DebuggerStatement extends HasSpan, Node {
  type: 'DebuggerStatement';
}
interface WithStatement extends HasSpan, Node {
  type: 'WithStatement';
  object: Expression;
  body: Statement;
}
interface ReturnStatement extends HasSpan, Node {
  type: 'ReturnStatement';
  argument?: Expression;
}
interface LabeledStatement extends HasSpan, Node {
  type: 'LabeledStatement';
  label: Identifier;
  body: Statement;
}
interface BreakStatement extends HasSpan, Node {
  type: 'BreakStatement';
  label?: Identifier;
}
interface ContinueStatement extends HasSpan, Node {
  type: 'ContinueStatement';
  label?: Identifier;
}
interface IfStatement extends HasSpan, Node {
  type: 'IfStatement';
  test: Expression;
  consequent: Statement;
  alternate?: Statement;
}
interface SwitchStatement extends HasSpan, Node {
  type: 'SwitchStatement';
  discriminant: Expression;
  cases: SwitchCase[];
}
interface ThrowStatement extends HasSpan, Node {
  type: 'ThrowStatement';
  argument: Expression;
}
interface TryStatement extends HasSpan, Node {
  type: 'TryStatement';
  block: BlockStatement;
  handler?: CatchClause;
  finalizer?: BlockStatement;
}
interface WhileStatement extends HasSpan, Node {
  type: 'WhileStatement';
  test: Expression;
  body: Statement;
}
interface DoWhileStatement extends HasSpan, Node {
  type: 'DoWhileStatement';
  test: Expression;
  body: Statement;
}
interface ForStatement extends HasSpan, Node {
  type: 'ForStatement';
  init?: Expression | VariableDeclaration;
  test?: Expression;
  update?: Expression;
  body: Statement;
}
interface ForInStatement extends HasSpan, Node {
  type: 'ForInStatement';
  left: Pattern | VariableDeclaration;
  right: Expression;
  body: Statement;
}
interface ForOfStatement extends HasSpan, Node {
  type: 'ForOfStatement';
  /**
   *  Span of the await token.
   *
   *  es2018 for-await-of statements, e.g., `for await (const x of xs) {`
   */
  await?: Span;
  left: Pattern | VariableDeclaration;
  right: Expression;
  body: Statement;
}
interface SwitchCase extends HasSpan, Node {
  type: 'SwitchCase';
  /**
   * Undefined for default case
   */
  test?: Expression;
  consequent: Statement[];
}
interface CatchClause extends HasSpan, Node {
  type: 'CatchClause';
  /**
   * The param is `undefined` if the catch binding is omitted. E.g., `try { foo() } catch {}`
   */
  param?: Pattern;
  body: BlockStatement;
}
interface TsTypeAnnotation extends HasSpan, Node {
  type: 'TsTypeAnnotation';
  typeAnnotation: TsType;
}
interface TsTypeParameterDeclaration extends HasSpan, Node {
  type: 'TsTypeParameterDeclaration';
  parameters: TsTypeParameter[];
}
interface TsTypeParameter extends HasSpan, Node {
  type: 'TsTypeParameter';
  name: Identifier;
  in: boolean;
  out: boolean;
  constraint?: TsType;
  default?: TsType;
}
interface TsTypeParameterInstantiation extends HasSpan, Node {
  type: 'TsTypeParameterInstantiation';
  params: TsType[];
}
interface TsParameterProperty extends HasDecorator, HasSpan, Node {
  type: 'TsParameterProperty';
  accessibility?: Accessibility;
  override: boolean;
  readonly: boolean;
  param: TsParameterPropertyParameter;
}
type TsParameterPropertyParameter = AssignmentPattern | BindingIdentifier;
interface TsQualifiedName extends Node {
  type: 'TsQualifiedName';
  left: TsEntityName;
  right: Identifier;
}
type TsEntityName = Identifier | TsQualifiedName;
type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsGetterSignature | TsIndexSignature | TsMethodSignature | TsPropertySignature | TsSetterSignature;
interface TsCallSignatureDeclaration extends HasSpan, Node {
  type: 'TsCallSignatureDeclaration';
  params: TsFnParameter[];
  typeAnnotation?: TsTypeAnnotation;
  typeParams?: TsTypeParameterDeclaration;
}
interface TsConstructSignatureDeclaration extends HasSpan, Node {
  type: 'TsConstructSignatureDeclaration';
  params: TsFnParameter[];
  typeAnnotation?: TsTypeAnnotation;
  typeParams?: TsTypeParameterDeclaration;
}
interface TsPropertySignature extends HasSpan, Node {
  type: 'TsPropertySignature';
  readonly: boolean;
  key: Expression;
  computed: boolean;
  optional: boolean;
  typeAnnotation?: TsTypeAnnotation;
}
interface TsGetterSignature extends HasSpan, Node {
  type: 'TsGetterSignature';
  readonly: boolean;
  key: Expression;
  computed: boolean;
  optional: boolean;
  typeAnnotation?: TsTypeAnnotation;
}
interface TsSetterSignature extends HasSpan, Node {
  type: 'TsSetterSignature';
  readonly: boolean;
  key: Expression;
  computed: boolean;
  optional: boolean;
  param: TsFnParameter;
}
interface TsMethodSignature extends HasSpan, Node {
  type: 'TsMethodSignature';
  readonly: boolean;
  key: Expression;
  computed: boolean;
  optional: boolean;
  params: TsFnParameter[];
  typeAnn?: TsTypeAnnotation;
  typeParams?: TsTypeParameterDeclaration;
}
interface TsIndexSignature extends HasSpan, Node {
  type: 'TsIndexSignature';
  params: TsFnParameter[];
  typeAnnotation?: TsTypeAnnotation;
  readonly: boolean;
  static: boolean;
}
type TsType = TsArrayType | TsConditionalType | TsFnOrConstructorType | TsImportType | TsIndexedAccessType | TsInferType | TsKeywordType | TsLiteralType | TsMappedType | TsOptionalType | TsParenthesizedType | TsRestType | TsThisType | TsTupleType | TsTypeLiteral | TsTypeOperator | TsTypePredicate | TsTypeQuery | TsTypeReference | TsUnionOrIntersectionType;
type TsFnOrConstructorType = TsConstructorType | TsFunctionType;
interface TsKeywordType extends HasSpan, Node {
  type: 'TsKeywordType';
  kind: TsKeywordTypeKind;
}
type TsKeywordTypeKind = 'any' | 'bigint' | 'boolean' | 'intrinsic' | 'never' | 'null' | 'number' | 'object' | 'string' | 'symbol' | 'undefined' | 'unknown' | 'void';
interface TsThisType extends HasSpan, Node {
  type: 'TsThisType';
}
type TsFnParameter = ArrayPattern | BindingIdentifier | ObjectPattern | RestElement;
interface TsFunctionType extends HasSpan, Node {
  type: 'TsFunctionType';
  params: TsFnParameter[];
  typeParams?: TsTypeParameterDeclaration;
  typeAnnotation: TsTypeAnnotation;
}
interface TsConstructorType extends HasSpan, Node {
  type: 'TsConstructorType';
  params: TsFnParameter[];
  typeParams?: TsTypeParameterDeclaration;
  typeAnnotation: TsTypeAnnotation;
  isAbstract: boolean;
}
interface TsTypeReference extends HasSpan, Node {
  type: 'TsTypeReference';
  typeName: TsEntityName;
  typeParams?: TsTypeParameterInstantiation;
}
interface TsTypePredicate extends HasSpan, Node {
  type: 'TsTypePredicate';
  asserts: boolean;
  paramName: TsThisTypeOrIdent;
  typeAnnotation?: TsTypeAnnotation;
}
type TsThisTypeOrIdent = Identifier | TsThisType;
interface TsImportType extends HasSpan, Node {
  type: 'TsImportType';
  argument: StringLiteral;
  qualifier?: TsEntityName;
  typeArguments?: TsTypeParameterInstantiation;
}
/**
 * `typeof` operator
 */
interface TsTypeQuery extends HasSpan, Node {
  type: 'TsTypeQuery';
  exprName: TsTypeQueryExpr;
  typeArguments?: TsTypeParameterInstantiation;
}
type TsTypeQueryExpr = TsEntityName | TsImportType;
interface TsTypeLiteral extends HasSpan, Node {
  type: 'TsTypeLiteral';
  members: TsTypeElement[];
}
interface TsArrayType extends HasSpan, Node {
  type: 'TsArrayType';
  elemType: TsType;
}
interface TsTupleType extends HasSpan, Node {
  type: 'TsTupleType';
  elemTypes: TsTupleElement[];
}
interface TsTupleElement extends HasSpan, Node {
  type: 'TsTupleElement';
  label?: Pattern;
  ty: TsType;
}
interface TsOptionalType extends HasSpan, Node {
  type: 'TsOptionalType';
  typeAnnotation: TsType;
}
interface TsRestType extends HasSpan, Node {
  type: 'TsRestType';
  typeAnnotation: TsType;
}
type TsUnionOrIntersectionType = TsIntersectionType | TsUnionType;
interface TsUnionType extends HasSpan, Node {
  type: 'TsUnionType';
  types: TsType[];
}
interface TsIntersectionType extends HasSpan, Node {
  type: 'TsIntersectionType';
  types: TsType[];
}
interface TsConditionalType extends HasSpan, Node {
  type: 'TsConditionalType';
  checkType: TsType;
  extendsType: TsType;
  trueType: TsType;
  falseType: TsType;
}
interface TsInferType extends HasSpan, Node {
  type: 'TsInferType';
  typeParam: TsTypeParameter;
}
interface TsParenthesizedType extends HasSpan, Node {
  type: 'TsParenthesizedType';
  typeAnnotation: TsType;
}
interface TsTypeOperator extends HasSpan, Node {
  type: 'TsTypeOperator';
  op: TsTypeOperatorOp;
  typeAnnotation: TsType;
}
type TsTypeOperatorOp = 'keyof' | 'readonly' | 'unique';
interface TsIndexedAccessType extends HasSpan, Node {
  type: 'TsIndexedAccessType';
  readonly: boolean;
  objectType: TsType;
  indexType: TsType;
}
type TruePlusMinus = '-' | '+' | true;
interface TsMappedType extends HasSpan, Node {
  type: 'TsMappedType';
  readonly?: TruePlusMinus;
  typeParam: TsTypeParameter;
  nameType?: TsType;
  optional?: TruePlusMinus;
  typeAnnotation?: TsType;
}
interface TsLiteralType extends HasSpan, Node {
  type: 'TsLiteralType';
  literal: TsLiteral;
}
type TsLiteral = BigIntLiteral | BooleanLiteral | NumericLiteral | StringLiteral | TsTemplateLiteralType;
interface TsTemplateLiteralType extends HasSpan, Node {
  type: 'TemplateLiteral';
  types: TsType[];
  quasis: TemplateElement[];
}
interface TsInterfaceDeclaration extends HasSpan, Node {
  type: 'TsInterfaceDeclaration';
  id: Identifier;
  declare: boolean;
  typeParams?: TsTypeParameterDeclaration;
  extends: TsExpressionWithTypeArguments[];
  body: TsInterfaceBody;
}
interface TsInterfaceBody extends HasSpan, Node {
  type: 'TsInterfaceBody';
  body: TsTypeElement[];
}
interface TsExpressionWithTypeArguments extends HasSpan, Node {
  type: 'TsExpressionWithTypeArguments';
  expression: Expression;
  typeArguments?: TsTypeParameterInstantiation;
}
interface TsTypeAliasDeclaration extends HasSpan, Node {
  type: 'TsTypeAliasDeclaration';
  declare: boolean;
  id: Identifier;
  typeParams?: TsTypeParameterDeclaration;
  typeAnnotation: TsType;
}
interface TsEnumDeclaration extends HasSpan, Node {
  type: 'TsEnumDeclaration';
  declare: boolean;
  isConst: boolean;
  id: Identifier;
  members: TsEnumMember[];
}
interface TsEnumMember extends HasSpan, Node {
  type: 'TsEnumMember';
  id: TsEnumMemberId;
  init?: Expression;
}
type TsEnumMemberId = Identifier | StringLiteral;
interface TsModuleDeclaration extends HasSpan, Node {
  type: 'TsModuleDeclaration';
  declare: boolean;
  global: boolean;
  id: TsModuleName;
  body?: TsNamespaceBody;
}
/**
 * `namespace A.B { }` is a namespace named `A` with another TsNamespaceDecl as its body.
 */
type TsNamespaceBody = TsModuleBlock | TsNamespaceDeclaration;
interface TsModuleBlock extends HasSpan, Node {
  type: 'TsModuleBlock';
  body: ModuleItem[];
}
interface TsNamespaceDeclaration extends HasSpan, Node {
  type: 'TsNamespaceDeclaration';
  declare: boolean;
  global: boolean;
  id: Identifier;
  body: TsNamespaceBody;
}
type TsModuleName = Identifier | StringLiteral;
interface TsImportEqualsDeclaration extends HasSpan, Node {
  type: 'TsImportEqualsDeclaration';
  declare: boolean;
  isExport: boolean;
  isTypeOnly: boolean;
  id: Identifier;
  moduleRef: TsModuleReference;
}
type TsModuleReference = TsEntityName | TsExternalModuleReference;
interface TsExternalModuleReference extends HasSpan, Node {
  type: 'TsExternalModuleReference';
  expression: StringLiteral;
}
interface TsExportAssignment extends HasSpan, Node {
  type: 'TsExportAssignment';
  expression: Expression;
}
interface TsNamespaceExportDeclaration extends HasSpan, Node {
  type: 'TsNamespaceExportDeclaration';
  id: Identifier;
}
interface TsAsExpression extends ExpressionBase {
  type: 'TsAsExpression';
  expression: Expression;
  typeAnnotation: TsType;
}
interface TsSatisfiesExpression extends ExpressionBase {
  type: 'TsSatisfiesExpression';
  expression: Expression;
  typeAnnotation: TsType;
}
interface TsInstantiation extends HasSpan, Node {
  type: 'TsInstantiation';
  expression: Expression;
  typeArguments: TsTypeParameterInstantiation;
}
interface TsTypeAssertion extends ExpressionBase {
  type: 'TsTypeAssertion';
  expression: Expression;
  typeAnnotation: TsType;
}
interface TsConstAssertion extends ExpressionBase {
  type: 'TsConstAssertion';
  expression: Expression;
}
interface TsNonNullExpression extends ExpressionBase {
  type: 'TsNonNullExpression';
  expression: Expression;
}
type Accessibility = 'private' | 'protected' | 'public';
interface Invalid extends HasSpan, Node {
  type: 'Invalid';
}
type WasmPlugin = [wasmPackage: string, config: Record<string, any>];
interface Assumptions {
  /**
   * https://babeljs.io/docs/en/assumptions#arraylikeisiterable
   */
  arrayLikeIsIterable?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#constantreexports
   */
  constantReexports?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#constantsuper
   */
  constantSuper?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#enumerablemodulemeta
   */
  enumerableModuleMeta?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#ignorefunctionlength
   */
  ignoreFunctionLength?: boolean;
  ignoreFunctionName?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#ignoretoprimitivehint
   */
  ignoreToPrimitiveHint?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#iterableisarray
   */
  iterableIsArray?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#mutabletemplateobject
   */
  mutableTemplateObject?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#noclasscalls
   */
  noClassCalls?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#nodocumentall
   */
  noDocumentAll?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#noincompletensimportdetection
   */
  noIncompleteNsImportDetection?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#nonewarrows
   */
  noNewArrows?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#objectrestnosymbols
   */
  objectRestNoSymbols?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#privatefieldsasproperties
   */
  privateFieldsAsProperties?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#puregetters
   */
  pureGetters?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#setclassmethods
   */
  setClassMethods?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#setcomputedproperties
   */
  setComputedProperties?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#setpublicclassfields
   */
  setPublicClassFields?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#setspreadproperties
   */
  setSpreadProperties?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#skipforofiteratorclosing
   */
  skipForOfIteratorClosing?: boolean;
  /**
   * https://babeljs.io/docs/en/assumptions#superiscallableconstructor
   */
  superIsCallableConstructor?: boolean;
  /**
   * @deprecated This value will be always true
   */
  tsEnumIsReadonly?: boolean;
}
//#endregion
//#region src/config/common.d.ts
/**
 * `Webpack devtool` 类型
 *
 * @see https://webpack.js.org/configuration/devtool/#devtool
 */
type SourceMapType = LiteralUnion<'cheap-module-source-map' | 'cheap-source-map' | 'eval-cheap-module-source-map' | 'eval-cheap-source-map' | 'eval-nosources-cheap-module-source-map' | 'eval-nosources-cheap-source-map' | 'eval-nosources-source-map' | 'eval-source-map' | 'eval' | 'hidden-cheap-module-source-map' | 'hidden-cheap-source-map' | 'hidden-nosources-cheap-module-source-map' | 'hidden-nosources-cheap-source-map' | 'hidden-nosources-source-map' | 'hidden-source-map' | 'inline-cheap-module-source-map' | 'inline-cheap-source-map' | 'inline-nosources-cheap-module-source-map' | 'inline-nosources-cheap-source-map' | 'inline-nosources-source-map' | 'inline-source-map' | 'nosources-cheap-module-source-map' | 'nosources-cheap-source-map' | 'nosources-source-map' | 'source-map'>;
type PlatformUnion = LiteralUnion<'h5' | 'harmony' | 'mini' | 'rn'>;
interface ConfigurablePlugin<T extends Record<string, any>> {
  enable?: boolean;
  config?: T;
}
interface FilterOptions {
  /**
   * 需要额外执行预编译的依赖
   */
  include?: string[];
  /**
   * 不需要执行预编译的依赖
   */
  exclude?: string[];
}
/**
 * 编译过程配置
 */
type ICompileOptions = FilterOptions & {
  /**
   * 对应 `@rollup/plugin-babel` 插件的 filter 配置。
   *
   * 只在 vite 编译模式下有效
   */
  filter?: (filename: string) => boolean;
};
/**
 * 输出文件类型增强
 */
interface IOutputEnhance {
  /**
   * 编译前清空输出目录
   * @since Taro v3.6.9
   * @description
   * - 默认清空输出目录，可设置 clean: false 不清空
   * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件
   * - 注意 clean.keep 不支持函数
   */
  clean?: boolean | {
    keep?: string | Array<string | RegExp> | RegExp;
  };
}
/**
 * 小程序编译时的文件类型集合
 */
type ParseAstType = LiteralUnion<'COMPONENT' | 'ENTRY' | 'NORMAL' | 'PAGE' | 'STATIC'>;
interface BasePostCSSOptions {
  autoprefixer?: ConfigurablePlugin<AutoprefixerOptions>;
  pxtransform?: ConfigurablePlugin<PostcssPxtransformOptions>;
  cssModules?: ConfigurablePlugin<PostcssCssModulesOptions>;
  htmltransform?: ConfigurablePlugin<PostcssHtmlTransformOptions>;
  [key: string]: any;
}
type PostCSSOptions<T extends PlatformUnion> = T extends 'h5' ? BasePostCSSOptions & {
  url?: ConfigurablePlugin<PostcssUrlOptions>;
} : BasePostCSSOptions;
/**
 * 通用 webpack 配置选项
 */
type BaseWebpackConfigOptions = {
  /**
   * `css-loader` 的附加配置
   *
   * @see https://github.com/webpack-contrib/css-loader
   */
  cssLoaderOption?: CSSLoaderOptions;
  /**
   * 针对 `woff | woff2 | eot | ttf | otf` 文件 `url-loader` 的配置
   *
   * @see https://github.com/webpack-contrib/url-loader
   */
  fontUrlLoaderOption?: URLLoaderOptions;
  /**
   * 针对 `png | jpg | jpeg | gif | bpm | svg` 文件 `url-loader` 的配置
   *
   * @see https://github.com/webpack-contrib/url-loader
   */
  imageUrlLoaderOption?: URLLoaderOptions;
  /**
   * `less-loader` 的附加配置
   *
   * @see https://github.com/webpack-contrib/less-loader
   */
  lessLoaderOption?: LessLoaderOptions;
  /**
   * 针对 `mp4 | webm | ogg | mp3 | wav | flac | aac` 文件 `url-loader` 的配置
   *
   * @see https://github.com/webpack-contrib/url-loader
   */
  mediaUrlLoaderOption?: URLLoaderOptions;
  /**
   * `mini-css-extract-plugin` 的附加配置
   *
   * @see https://github.com/webpack-contrib/mini-css-extract-plugin
   */
  miniCssExtractPluginOption?: MiniCSSExtractPluginOptions;
  /**
   * `sass-loader` 的附加配置
   *
   * @see https://github.com/webpack-contrib/sass-loader
   */
  sassLoaderOption?: SassLoaderOptions;
  /**
   * `stylus-loader` 的附加配置
   *
   * @see https://github.com/webpack-contrib/stylus-loader
   */
  stylusLoaderOption?: StylusLoaderOptions;
  /**
   * 自定义 `Webpack` 配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#miniwebpackchain
   */
  webpackChain?: (chain: ChainableWebpackConfig, webpack: Webpack, parseAstType: ParseAstType) => void;
};
type CommonWebpackConfigOptions<T extends PlatformUnion> = T extends 'h5' ? BaseWebpackConfigOptions : BaseWebpackConfigOptions & {
  /**
   * `style-loader` 的附加配置
   * @see https://github.com/webpack-contrib/style-loader
   */
  styleLoaderOption?: StyleLoaderOptions;
};
/**
 * `additionalData` 类型
 *  @description
 *  - `less-loader` 附加数据
 *  - `sass-loader` 附加数据
 *  - `stylus-loader` 附加数据
 */
type LoaderAdditionalData<T extends 'less' | 'sass' | 'stylus'> = string | (T extends 'stylus' ? (content: string | Buffer, loaderContext: WebpackLoaderContext, meta: any) => Awaitable<string> : (content: string, loaderContext: WebpackLoaderContext) => Awaitable<string>);
//#endregion
//#region src/config/compiler.d.ts
type CompilerViteTypes = 'vite';
type CompilerWebpackTypes = 'webpack5';
type CompilerTypes = CompilerViteTypes | CompilerWebpackTypes;
/**
 * @see https://github.com/NervJS/taro/blob/6a7779d98102c9b7b0082ababbac342cbff2d213/packages/taro-plugin-vue-devtools/src/index.ts#L79C44-L79C47
 */
type CompilerPrebundleWebpackProvideFn = (obj: Record<string, any>, taroRuntimeBundlePath: string) => void;
interface CompilerPrebundle extends FilterOptions {
  /**
   * 是否开启依赖预编译
   */
  enable?: boolean;
  /**
   * 缓存目录的绝对路径
   */
  cacheDir?: string;
  /**
   * 是否强行弃用缓存
   */
  force?: boolean;
  /**
   * 是否显示依赖预编译的测速信息
   */
  timings?: boolean;
  /**
   * 自定义 `esbuild` 配置
   *
   * @see https://esbuild.github.io/api/#build
   */
  esbuild?: BuildOptions;
  /**
   * 自定义 `swc` 配置
   *
   * @see https://swc.rs/docs/usage/core#options
   */
  swc?: Config;
  /**
   * 自定义 `webpack` 配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#compilerprebundlewebpackprovide
   */
  webpack?: WebpackConfiguration & {
    provide?: CompilerPrebundleWebpackProvideFn[];
  };
}
interface CompilerConfig<T> {
  /**
   * 编译工具
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#compilertype
   */
  type: T;
  /**
   * 错误处理级别
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#compilererrorlevel
   * @default 0
   */
  errorLevel?: number;
  /**
   * 依赖预编译，仅 `webpack5` 支持
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#compilerprebundle
   */
  prebundle?: CompilerPrebundle;
  /**
   * Vite 插件，仅 `vite` 支持
   */
  vitePlugins?: VitePlugin[];
}
type Compiler$1<T extends CompilerTypes = CompilerWebpackTypes> = CompilerConfig<T> | T;
//#endregion
//#region src/config/copy.d.ts
type CopyIgnore = string | string[];
interface CopyPattern {
  from: string;
  to: string;
  ignore?: CopyIgnore;
  transform?: (...args: any[]) => any;
  watch?: boolean;
}
interface CopyOptions {
  ignore?: CopyIgnore;
}
interface Copy {
  patterns?: CopyPattern[];
  options?: CopyOptions;
}
//#endregion
//#region src/config/logger.d.ts
interface Logger {
  /**
   * 是否简化输出日志
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#quiet
   * @default true
   */
  quiet?: boolean;
  /**
   * 是否输出 `Webpack Stats` 信息
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#stats
   * @default false
   */
  stats?: boolean;
}
//#endregion
//#region src/config/minimizers/js.d.ts
type JSMinimizer = LiteralUnion<'esbuild' | 'terser'>;
type TerserMinimizer = ConfigurablePlugin<MinifyOptions$1>;
interface EsbuildMinimizer {
  /**
   * 配置 `ESBuildMinifyPlugin`
   *
   * @see https://github.com/esbuild-kit/esbuild-loader#minification
   */
  minify?: ConfigurablePlugin<EsbuildPluginOptions>;
}
//#endregion
//#region src/config/minimizers/css.d.ts
type CSSMinimizer = LiteralUnion<'csso' | 'esbuild' | 'lightningcss'>;
type CSSOMinimizer = ConfigurablePlugin<CSSNanoOptions>;
//#endregion
//#region src/config/platforms/h5.d.ts
interface PlatformH5Router {
  /**
   * 配置路由模式
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5routermode
   */
  mode?: LiteralUnion<'browser' | 'hash' | 'multi'>;
  /**
   * 配置路由基准路径
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5routerbasename
   */
  basename?: string;
  /**
   * 配置自定义路由
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5routercustomroutes
   */
  customRoutes?: Record<string, string | string[]>;
  lazyload?: boolean | ((pagename: string) => boolean);
  renamePagename?: (pagename: string) => string;
  forcePath?: string;
  /**
   * 加上这个参数，可以解决返回页面的时候白屏的问题，但是某些不支持 :has() 选择器的浏览器会有问题
   */
  enhanceAnimation?: boolean;
}
interface PlatformH5<T extends CompilerTypes = CompilerWebpackTypes> extends CommonWebpackConfigOptions<'h5'> {
  /**
   * 可用于修改、拓展 `Webpack` 的 `input` 选项
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5entry
   */
  entry?: Record<string, string | string[]>;
  /**
   * webpack 编译模式下，可用于修改、拓展 Webpack 的 output 选项，配置项参考[官方文档](https://webpack.js.org/configuration/output/)
   *
   * vite 编译模式下，用于修改、扩展 rollup 的 output，目前仅适配 chunkFileNames 和 assetFileNames 两个配置，修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/)
   */
  output?: T extends 'vite' ? IOutputEnhance & Pick<RollupOutputOptions, 'assetFileNames' | 'chunkFileNames'> : WebpackConfiguration['output'];
  /**
   * 设置输出解析文件的目录
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5publicpath
   * @default `/`
   */
  publicPath?: string;
  /**
   * `h5` 编译后的静态文件目录
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5staticdirectory
   * @default `static`
   */
  staticDirectory?: string;
  /**
   * 编译后非 `entry` 的 `js` 文件的存放目录，主要影响动态引入的 `pages` 的存放路径
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5chunkdirectory
   * @default `chunk`
   */
  chunkDirectory?: string;
  /**
   * Webpack 配置
   */
  webpack?: WebpackConfiguration | ((config: WebpackConfiguration, webpack: Webpack) => WebpackConfiguration);
  /**
   * 预览服务的配置，可以更改端口等参数
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5devserver
   */
  devServer?: DevServerConfiguration;
  /**
   * 路由相关的配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5router
   */
  router?: PlatformH5Router;
  /**
   * 用于控制是否生成 `js、css` 对应的 `sourceMap`
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5enablesourcemap
   * @default watch 模式下为 true，否则为 false
   */
  enableSourceMap?: boolean;
  /**
   * `SourceMap` 类型
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5sourcemaptype
   * @default `cheap-module-eval-source-map`
   */
  sourceMapType?: SourceMapType;
  /**
   * 用于控制在 H5 端是否使用兼容性组件库
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5usehtmlcomponents
   * @default false
   */
  useHtmlComponents?: boolean;
  /**
   * `extract` 功能开关，开启后将使用 `mini-css-extract-plugin` 分离 `css` 文件
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5enableextract
   * @default watch 模式下为 false，否则为 true
   */
  enableExtract?: boolean;
  /**
   * 配置需要额外的经由 `Taro` 预设的 `postcss` 编译的模块
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5esnextmodules
   */
  esnextModules?: string[];
  /**
   * 配置 `postcss` 相关插件
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5postcss
   */
  postcss?: PostCSSOptions<'h5'>;
  /**
   * Web 编译过程的相关配置
   *
   * @since `Taro v3.6`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#h5compile
   */
  compile?: ICompileOptions;
  /**
   * 控制在 H5 端是否使用旧版本适配器
   *
   * @since `Taro v3.6.3`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#h5usedeprecatedadaptercomponent
   * @default false
   */
  useDeprecatedAdapterComponent?: boolean;
  /**
   * `html-webpack-plugin` 的具体配置
   *
   * @since `Taro v3.5`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5htmlpluginoption
   */
  htmlPluginOption?: HtmlWebpackPluginOptions;
  /**
   * 生成的代码是否要兼容旧版浏览器，值为 true 时，会去读取 package.json 的 browserslist 字段。
   * 只在 vite 编译模式下有效
   */
  legacy?: T extends 'vite' ? boolean : undefined;
  /**
   * 使用的编译工具。可选值：webpack5、vite
   */
  compiler?: Compiler$1<T>;
  [key: string]: any;
}
//#endregion
//#region src/config/platforms/rn.d.ts
/**
 * @internal
 */
type ProcessorOptionsWithAdditionalData<T, P extends 'less' | 'sass' | 'stylus'> = {
  additionalData?: LoaderAdditionalData<P>;
  options?: T;
};
/**
 * @see https://github.com/NervJS/taro/blob/main/packages/taro-rn-style-transformer/README.md#rnpostcss
 */
interface PlatformRNPostCSSOptions {
  /**
   * PostCSS 配置
   * @see https://github.com/postcss/postcss#options
   */
  options?: Record<string, any>;
  /**
   * 控制是否对 css value 进行 scalePx2dp 转换，pxtransform 配置 enable 才生效
   * @default true
   */
  scalable?: boolean;
  /**
   * `pxtransform.enable`
   * @default true
   */
  pxtransform?: ConfigurablePlugin<PostcssPxtransformOptions>;
  /**
   * `cssModules.enable`
   * @default false
   */
  cssModules?: ConfigurablePlugin<PostcssCssModulesOptions>;
  [key: string]: any;
}
interface PlatformRNResolve {
  /**
   * 配置多个 npm 包名的数组，将 npm 包当作项目文件处理
   */
  include: string[];
  [key: string]: any;
}
interface PlatformRNNativeComponents {
  /**
   * 外部依赖
   */
  external?: Array<string | RegExp> | ((array: Array<string | RegExp>) => Array<string | RegExp>);
  /**
   * 设置外部依赖，如果返回 `string`, 则将该值作为 `external`
   *
   * @description 默认将 `node_modules` 路径下的文件设置为外部依赖
   */
  externalResolve?: (importee: string, importer: string) => string;
  /**
   * 组件输出路径
   *
   * @default `dist`
   */
  output?: string;
  /**
   * 修改 `Rollup` 打包配置
   */
  modifyRollupConfig?: (config: RollupOptions, innerPlugins: {
    styleTransformer: any;
    taroResolver: any;
  }) => RollupOptions;
}
interface PlatformRN {
  /**
   * 设置 `RN bundle` 中注册应用的名称
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnappname
   */
  appName?: string;
  /**
   * `entry` 利用模块查找规则 `{name}.{platform}.{ext}` 自动区分平台
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnentry
   */
  entry?: string;
  /**
   * 设置 `Metro` 打包生成 `bundle` 的输出路径
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnoutput
   */
  output?: Record<string, string>;
  /**
   * `postcss` 相关配置，其他样式语言预处理后经过此配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnpostcss
   */
  postcss?: PlatformRNPostCSSOptions;
  /**
   * `sass` 相关配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnsass
   */
  sass?: ProcessorOptionsWithAdditionalData<DartSassOptions | NodeSassOptions, 'sass'>;
  /**
   * `less` 相关配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnless
   */
  less?: ProcessorOptionsWithAdditionalData<LessOptions, 'less'>;
  /**
   * `stylus` 相关配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnstylus
   */
  stylus?: ProcessorOptionsWithAdditionalData<StylusOptions, 'stylus'>;
  /**
   * `resolve` 处理依赖文件配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnresolve
   */
  resolve?: PlatformRNResolve;
  /**
   * 支持多 `className` 转换，以 `classname` 或 `style` 结尾的，提取前缀，然后根据前缀，再生成对应的 `xxxStyle`
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnenablemultipleclassname
   * @default false
   */
  enableMultipleClassName?: boolean;
  /**
   * 当标签 `style` 属性值是数组时转换成对象
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnenablemergestyle
   * @default false
   */
  enableMergeStyle?: boolean;
  /**
   * 将 `svg` 文件转换为组件引入
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rnenablesvgtransform
   * @default false
   */
  enableSvgTransform?: boolean;
  /**
   * 别名
   */
  alias?: Record<string, any>;
  /**
   * 设计稿尺寸
   */
  designWidth?: DesignWidth;
  /**
   * 设计稿尺寸换算规则
   */
  designRatio?: DesignRatio;
  /**
   * 原生组件编译配置
   */
  nativeComponents?: PlatformRNNativeComponents;
  [key: string]: any;
}
//#endregion
//#region src/config/platforms/mini.d.ts
interface PlatformMiniMinifyXML {
  /**
   * 是否合并 xml 文件中的空格
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#miniminifyxmlcollapsewhitespace
   * @default false
   */
  collapseWhitespace?: boolean;
}
interface PlatformMiniOptimizeMainPackage {
  enable?: boolean;
  exclude?: string[];
}
interface PlatformMiniExperimental {
  /**
   * 半编译模式，暂只支持 `React` 框架
   *
   * @since `Taro v3.6.23`
   * @see https://nervjs.github.io/taro-docs/docs/complier-mode
   * @default false
   */
  compileMode?: boolean | string;
  /**
   * 模版渲染时是否使用 wxs 等小程序脚本语言
   */
  useXsForTemplate?: boolean;
}
interface PlatformMiniRuntime {
  enableInnerHTML?: boolean;
  enableSizeAPIs?: boolean;
  enableAdjacentHTML?: boolean;
  enableTemplateContent?: boolean;
  enableCloneNode?: boolean;
  enableContains?: boolean;
  enableMutationObserver?: boolean;
}
/**
 * 小程序端专用配置
 *
 * @see https://nervjs.github.io/taro-docs/docs/config-detail#mini
 */
interface PlatformMini<T extends CompilerTypes = CompilerWebpackTypes> extends CommonWebpackConfigOptions<'mini'> {
  /**
   * 对于 `template` 模板不支持递归的小程序（如：微信、QQ、京东），Taro 会对所有模板循环 `baseLevel` 次，以支持同类模板的循环调用
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#minibaselevel
   */
  baseLevel?: number;
  /**
   * webpack 编译模式下，可用于修改、拓展 Webpack 的 output 选项，配置项参考[官方文档](https://webpack.js.org/configuration/output/)
   *
   * vite 编译模式下，用于修改、扩展 rollup 的 output，目前仅适配 chunkFileNames 和 assetFileNames 两个配置，修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/)
   */
  output?: T extends 'vite' ? IOutputEnhance & Pick<RollupOutputOptions, 'chunkFileNames'> : IOutputEnhance & WebpackConfiguration['output'];
  /**
   * 用于控制是否生成 `js、css` 对应的 `sourceMap`
   *
   * @default watch 模式下为 true，否则为 false
   */
  enableSourceMap?: boolean;
  /**
   * `SourceMap` 类型
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#minisourcemaptype
   * @default `cheap-module-source-map`
   */
  sourceMapType?: SourceMapType;
  /**
   * 关于压缩小程序 `xml` 文件的相关配置
   *
   * @since `Taro v3.0.8`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#miniminifyxml
   */
  minifyXML?: PlatformMiniMinifyXML;
  /**
   * 是否注入兼容微信小程序热重载的代码
   *
   * @since `Taro v3.4.0`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#minihot
   * @default false
   */
  hot?: boolean;
  /**
   * 指定 React 框架相关的代码是否使用开发环境（未压缩）代码，默认使用生产环境（压缩后）代码
   *
   * @since `Taro v3.0.8`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#minidebugreact
   * @default false
   */
  debugReact?: boolean;
  /**
   * 是否跳过第三方依赖 usingComponent 的处理，默认为自动处理第三方依赖的自定义组件
   *
   * @since `Taro v3.6.13`
   * @default false
   */
  skipProcessUsingComponents?: boolean;
  /**
   * 用于告诉 Taro 编译器需要抽取的公共文件
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#minicommonchunks
   */
  commonChunks?: string[] | ((commonChunks: string[]) => string[]);
  /**
   * 为某些页面单独指定需要引用的公共文件
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#miniaddchunkpages
   */
  addChunkPages?: (pages: Map<string, string[]>, pagesNames?: string[]) => void;
  /**
   * 优化主包的体积大小
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#minioptimizemainpackage
   */
  optimizeMainPackage?: PlatformMiniOptimizeMainPackage;
  /**
   * 配置 `postcss` 相关插件
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#minipostcss
   */
  postcss?: PostCSSOptions<'mini'>;
  /**
   * 实验特性
   */
  experimental?: PlatformMiniExperimental;
  /**
   * 小程序编译过程的相关配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail/#minicompile
   */
  compile?: ICompileOptions;
  /**
   * 使用的编译工具。可选值：webpack5、vite
   */
  compiler?: Compiler$1<T>;
  /**
   * 运行时选项，插件内部使用
   */
  runtime?: PlatformMiniRuntime;
  [key: string]: any;
}
//#endregion
//#region src/config/platforms/harmony.d.ts
interface PlatformHarmonyOhPackage {
  main?: string;
  dependencies?: {
    [name: string]: string;
  };
  devDependencies?: {
    [name: string]: string;
  };
  [k: string]: any;
}
interface PlatformHarmonyCompileModeSetting {
  componentReplace?: {
    [key: string]: {
      current_init: string;
      dependency_define: string;
    };
  };
}
interface PlatformHarmonyRouter {
  customRoutes?: Record<string, any>;
}
interface PlatformHarmony<T extends CompilerTypes = CompilerViteTypes> extends CommonWebpackConfigOptions<'harmony'> {
  /**
   * 项目地址
   */
  projectPath: string;
  /**
   * @default `entry`
   */
  hapName?: string;
  /**
   * @default `default`
   */
  name?: string;
  /**
   * oh-package.json 配置
   */
  ohPackage?: PlatformHarmonyOhPackage;
  /**
   * ohpm-cli
   *
   * @default `~/Library/Huawei/ohpm/bin/ohpm"`
   */
  ohpm?: string;
  /**
   * 核心依赖前缀
   * @description 用于告诉编译内容如何解析核心依赖，传入时将直接使用依赖前缀，同时不会为工程导入核心依赖
   */
  chorePackagePrefix?: string;
  /**
   * 公共文件
   */
  commonChunks?: string[] | ((commonChunks: string[]) => string[]);
  /**
   * 编译相关配置
   */
  compile?: ICompileOptions;
  /**
   * 半编译模式下的选项
   */
  compileModeSetting?: PlatformHarmonyCompileModeSetting;
  /**
   * 用于控制是否生成 js、css 对应的 sourceMap
   * @default `true` in when watch mode, otherwise `false`
   */
  enableSourceMap?: boolean;
  /**
   * Webpack sourceMap
   * @default `cheap-module-source-map`
   */
  sourceMapType?: SourceMapType;
  /**
   * 指定 React 框架相关的代码是否使用开发环境（未压缩）代码，默认使用生产环境（压缩后）代码
   */
  debugReact?: boolean;
  /**
   * webpack 编译模式下，可用于修改、拓展 Webpack 的 output 选项，配置项参考[官方文档](https://webpack.js.org/configuration/output/)
   *
   * vite 编译模式下，用于修改、扩展 rollup 的 output，目前仅适配 chunkFileNames 和 assetFileNames 两个配置，修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/)
   */
  output?: T extends CompilerViteTypes ? IOutputEnhance & Pick<RollupOutputOptions, 'chunkFileNames'> : IOutputEnhance & WebpackConfiguration['output'];
  /**
   * 路由配置
   */
  router?: PlatformHarmonyRouter;
  /**
   * 自定义 PostCSS 配置
   */
  postcss?: PostCSSOptions<'harmony'>;
  [key: string]: any;
}
//#endregion
//#region src/config/plugins/html.d.ts
/**
 * Options for `@tarojs/plugin-html`
 *
 * @see https://github.com/NervJS/taro/tree/main/packages/taro-plugin-html
 */
interface PluginHtmlOptions {
  pxtransformBlackList?: (string | RegExp)[];
  enableSizeAPIs?: boolean;
  modifyElements?: (inline: string[], block: string[]) => void;
}
//#endregion
//#region src/config/plugins/http.d.ts
/**
 * Options for `@tarojs/plugin-http`
 *
 * @see https://github.com/NervJS/taro/tree/main/packages/taro-plugin-http
 */
interface PluginHttpOptions {
  /**
   * 注入相关代码，支持 document.cookie 通过后端返回 Set-Cookie 响应头来设置 cookie
   *
   * @default false
   */
  enableCookie?: boolean;
  /**
   * 禁用掉 Blob 全局对象
   *
   * @default true
   */
  disabledBlob?: boolean;
  /**
   * 禁用掉 FormData 全局对象
   *
   * @default true
   */
  disabledFormData?: boolean;
}
//#endregion
//#region src/config/plugins/mock.d.ts
type HTTPMethod = LiteralUnion<'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'>;
interface PluginMockOptions {
  /**
   * 数据 Mock 服务地址
   * @default `127.0.0.1`
   */
  host?: string;
  /**
   * 数据 Mock 服务端口
   * @default 9527
   */
  port?: number;
  /**
   * 数据 Mock 接口，可以使用 `mock` 目录下文件
   * @see https://github.com/NervJS/taro-plugin-mock?tab=readme-ov-file#%E5%8F%82%E6%95%B0
   */
  mocks?: Record<`${HTTPMethod} ${string}`, Record<string, any>>;
}
//#endregion
//#region src/config/plugins/indie.d.ts
/**
 * Options for `@tarojs/plugin-indie`
 *
 * @see https://github.com/NervJS/taro-plugin-indie
 */
interface PluginIndieOptions {
  /**
   * 插件支持自定义小程序样式处理规则
   * @see https://github.com/NervJS/taro-plugin-indie?tab=readme-ov-file#1-pathstyleimportwithcustomrule
   */
  pathStyleImportWithCustomRule?: (filename: string) => boolean;
}
//#endregion
//#region src/config/plugins/inject.d.ts
/**
 * Options for `@tarojs/plugin-inject`
 *
 * @see https://github.com/NervJS/taro/tree/main/packages/taro-plugin-inject
 */
type VoidComponents = Set<string>;
type NestElements = Map<string, number>;
interface PluginInjectOptions {
  /**
   * 新增同步 API
   */
  syncApis?: string[];
  /**
   * 新增异步 API
   */
  asyncApis?: string[];
  /**
   * 修改、新增组件的属性
   */
  components?: Record<string, Record<string, any>>;
  /**
   * 新增组件时的名称映射
   */
  componentsMap?: Record<string, string>;
  /**
   * 设置第三方自定义组件的属性的默认值
   */
  thirdPartyComponents?: Record<string, Record<string, any>>;
  /**
   * 设置组件是否可以渲染子元素
   */
  voidComponents?: string[] | ((list: VoidComponents) => VoidComponents);
  /**
   * 设置组件模版的循环次数
   */
  nestElements?: Record<string, number> | ((elem: NestElements) => NestElements);
}
//#endregion
//#region src/config/plugins/miniCI.d.ts
/**
 * Options for `@tarojs/plugin-mini-ci`
 *
 * @see https://github.com/NervJS/taro/tree/main/packages/taro-plugin-mini-ci
 */
interface PluginMiniCIOptions {}
//#endregion
//#region src/config/plugins/platformXhs.d.ts
/**
 * Options for `@tarojs/plugin-platform-xhs`
 *
 * @see https://github.com/NervJS/taro-plugin-platform-xhs
 */
interface PluginPlatformXhsOptions {}
//#endregion
//#region src/config/plugins/platformKwai.d.ts
/**
 * Options for `@tarojs/plugin-platform-kwai`
 *
 * @see https://github.com/NervJS/taro-plugin-platform-kwai
 */
interface PluginPlatformKwaiOptions {}
//#endregion
//#region src/config/plugins/platformLark.d.ts
/**
 * Options for `@tarojs/plugin-platform-lark`
 *
 * @see https://github.com/NervJS/taro-plugin-platform-lark
 */
interface PluginPlatformLarkOptions {
  /**
   * Lark 小程序是否支持 PC 端的组件属性
   * @default false
   */
  pc?: boolean;
  /**
   * Lark 小程序编译时的入口文件
   * @see https://github.com/NervJS/taro-plugin-platform-lark?tab=readme-ov-file#%E6%8F%92%E4%BB%B6%E9%80%89%E9%A1%B9
   * @default undefined
   */
  entry?: string;
}
//#endregion
//#region src/config/plugins/platformNextJs.d.ts
/**
 * Options for `@tarojs/plugin-platform-nextjs`
 *
 * @see https://github.com/NervJS/tarojs-plugin-ssr
 */
interface PluginPlatformNextJsOptions {
  /**
   * 执行 taro build --type nextjs --watch 命令后，是否需要自动执行 next dev 命令
   * @default true
   */
  runNextjs?: boolean;
  /**
   * 是否启动后自动打开浏览器
   * @default true
   */
  browser?: boolean;
  /**
   * 插件编译阶段需要复制到 Next.js 中的附加文件
   */
  extraFiles?: string[];
}
//#endregion
//#region src/config/plugins/platformAlipayDd.d.ts
/**
 * Options for `@tarojs/plugin-platform-alipay-dd`
 *
 * @see https://github.com/NervJS/taro-plugin-platform-alipay-dd
 */
interface PluginPlatformAlipayDdOptions {}
//#endregion
//#region src/config/plugin.d.ts
interface OfficialPluginOptionsMap {
  '@tarojs/plugin-html': PluginHtmlOptions;
  '@tarojs/plugin-inject': PluginInjectOptions;
  '@tarojs/plugin-http': PluginHttpOptions;
  '@tarojs/plugin-mock': PluginMockOptions;
  '@tarojs/plugin-indie': PluginIndieOptions;
  '@tarojs/plugin-mini-ci': PluginMiniCIOptions;
  /**
   * Platform plugins
   */
  '@tarojs/plugin-platform-xhs': PluginPlatformXhsOptions;
  '@tarojs/plugin-platform-lark': PluginPlatformLarkOptions;
  '@tarojs/plugin-platform-kwai': PluginPlatformKwaiOptions;
  '@tarojs/plugin-platform-alipay-dd': PluginPlatformAlipayDdOptions;
  'tarojs-plugin-platform-nextjs': PluginPlatformNextJsOptions;
}
interface CustomPluginOptionsMap {}
type PluginsOptionsMap = CustomPluginOptionsMap & OfficialPluginOptionsMap;
type PluginName = keyof PluginsOptionsMap;
type PluginTuple<T extends PluginName = PluginName> = [T, () => Awaitable<ExcludeEmptyObjects<PluginsOptionsMap>[T]>] | [T, ExcludeEmptyObjects<PluginsOptionsMap>[T]] | [T];
type Plugin = PluginName | PluginTuple;
//#endregion
//#region src/config/preset.d.ts
/**
 * Taro 预设
 *
 * @see https://nervjs.github.io/taro-docs/docs/config-detail#presets
 */
type Preset<T = any> = string | [string, T] | [string];
//#endregion
//#region src/config/index.d.ts
type Framework = LiteralUnion<'none' | 'preact' | 'react' | 'solid' | 'vue3'>;
/**
 * Taro Configuration.
 *
 * @see https://nervjs.github.io/taro-docs/docs/config
 */
interface TaroConfig<T extends CompilerTypes = CompilerWebpackTypes> {
  /**
   * 项目名称
   */
  projectName?: string;
  /**
   * 项目创建日期
   */
  date?: string;
  /**
   * 设计稿尺寸, `v3.4.13` 后支持函数
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#designwidth
   * @default 750
   */
  designWidth?: DesignWidth;
  /**
   * 设计稿尺寸换算规则
   */
  deviceRatio?: DesignRatio;
  /**
   * 项目源码目录
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#sourceroot
   */
  sourceRoot?: string;
  /**
   * 项目产出目录
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#outputroot
   */
  outputRoot?: string;
  /**
   * 框架
   */
  framework?: Framework;
  /**
   * 编译工具
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#compiler
   */
  compiler?: Compiler$1<T>;
  /**
   * 全局变量设置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#defineconstants
   */
  defineConstants?: Record<string, string>;
  /**
   * 目录别名
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#alias
   */
  alias?: Record<string, string>;
  /**
   * 环境变量
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#env
   * @deprecated 建议使用 `.env` 文件
   */
  env?: Record<string, string>;
  /**
   * `Webpack5` 持久化缓存配置
   *
   * @since `Taro v3.5`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#cache
   */
  cache?: Cache;
  /**
   * 控制 `Taro` 编译日志的输出方式，目前只在 `Webpack5 compiler` 中支持
   *
   * @since `Taro v3.5`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#logger
   */
  logger?: Logger;
  /**
   * 文件拷贝配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#copy
   */
  copy?: Copy;
  /**
   * 用于控制对 `scss` 代码的编译行为
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#sass
   */
  sass?: TaroSassOptions;
  /**
   * Taro 插件配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#plugins
   */
  plugins?: Plugin[];
  /**
   * 插件预设集
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#presets
   */
  presets?: Preset[];
  /**
   * JS 压缩工具
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#jsminimizer
   * @default `terser`
   */
  jsMinimizer?: JSMinimizer;
  /**
   * 配置 `terser`
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#terser
   */
  terser?: TerserMinimizer;
  /**
   * 配置 `esbuild`
   *
   * @since `Taro v3.5`
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#esbuild
   */
  esbuild?: EsbuildMinimizer;
  /**
   * CSS 压缩工具
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#cssminimizer
   */
  cssMinimizer?: CSSMinimizer;
  /**
   * 配置 `csso` 工具以压缩 `CSS` 代码
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#csso
   */
  csso?: CSSOMinimizer;
  /**
   * H5 端专用配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#h5
   */
  h5?: PlatformH5;
  /**
   * ReactNative 端专用配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#rn
   */
  rn?: PlatformRN;
  /**
   * 小程序端专用配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#mini
   */
  mini?: PlatformMini;
  /**
   * 鸿蒙端专用配置
   *
   * @see https://nervjs.github.io/taro-docs/docs/config-detail#harmony
   */
  harmony?: PlatformHarmony<T>;
}
//#endregion
//#region src/index.d.ts
interface TaroConfigEnv {
  /**
   * 构建模式
   */
  mode: string;
  /**
   * 构建命令
   */
  command: string;
}
type WebpackMerge = (...configs: Array<object | null | undefined>) => object;
type TaroConfigFnObject<T extends CompilerTypes = CompilerWebpackTypes> = (merge: WebpackMerge, env: TaroConfigEnv) => TaroConfig<T>;
type TaroConfigFnPromise<T extends CompilerTypes = CompilerWebpackTypes> = (merge: WebpackMerge, env: TaroConfigEnv) => Promise<TaroConfig<T>>;
type TaroConfigFn<T extends CompilerTypes = CompilerWebpackTypes> = (merge: WebpackMerge, env: TaroConfigEnv) => TaroConfig<T> | Promise<TaroConfig<T>>;
type TaroConfigExport<T extends CompilerTypes = CompilerWebpackTypes> = TaroConfig<T> | Promise<TaroConfig<T>> | TaroConfigFnObject<T> | TaroConfigFnPromise<T> | TaroConfigFn<T>;
/**
 * Define a Taro config
 *
 * @param config - Taro config
 * @returns Taro config
 */
declare function defineConfig<T extends CompilerTypes = CompilerWebpackTypes>(config: TaroConfig<T>): TaroConfig<T>;
declare function defineConfig<T extends CompilerTypes = CompilerWebpackTypes>(config: Promise<TaroConfig<T>>): Promise<TaroConfig<T>>;
declare function defineConfig<T extends CompilerTypes = CompilerWebpackTypes>(config: TaroConfigFnObject<T>): TaroConfigFnObject<T>;
declare function defineConfig<T extends CompilerTypes = CompilerWebpackTypes>(config: TaroConfigExport<T>): TaroConfigExport<T>;
//#endregion
export { AutoprefixerOptions, BasePostCSSOptions, BaseWebpackConfigOptions, CSSLoaderExportType, CSSLoaderImport, CSSLoaderModulesExportLocalsConvention, CSSLoaderModulesObject, CSSLoaderModulesUnion, CSSLoaderOptions, CSSLoaderUrl, CSSMinimizer, CSSNanoConfig, CSSNanoOptions, CSSOMinimizer, Cache, CacheBuildDependencies, ChainableWebpackConfig, CommonWebpackConfigOptions, ConfigurablePlugin, Copy, CopyIgnore, CopyOptions, CopyPattern, CustomLoader, CustomPluginOptionsMap, DartSassOptions, Deprecation, DeprecationOrId, DeprecationStatus, Deprecations, DevServerConfiguration, BuildOptions as ESBuildBuildOptions, EsbuildMinimizer, EsbuildPluginOptions, FilterOptions, Framework, HtmlWebpackPluginOptions, ICompileOptions, IOutputEnhance, JSMinimizer, LessLoaderOptions, LessOptions, LessSourceMap, LoaderAdditionalData, Logger, LoggerWarnOptions, MiniCSSExtractPluginOptions, NodeSassOptions, OfficialPluginOptionsMap, ParseAstType, PlatformH5, PlatformH5Router, PlatformHarmony, PlatformHarmonyCompileModeSetting, PlatformHarmonyOhPackage, PlatformHarmonyRouter, PlatformMini, PlatformMiniExperimental, PlatformMiniMinifyXML, PlatformMiniOptimizeMainPackage, PlatformMiniRuntime, PlatformRN, PlatformRNNativeComponents, PlatformRNPostCSSOptions, PlatformRNResolve, PlatformUnion, Plugin, PluginName, PluginTuple, PluginsOptionsMap, PostCSSOptions, PostCSSUrlUrl, PostCSSUrlUrlAsset, PostCSSUrlUrlDir, PostcssCssModulesOptions, PostcssHtmlTransformOptions, PostcssHtmlTransformPlatform, PostcssPxtransformOptions, PostcssUrlHashOptions, PostcssUrlHashOptionsMethod, PostcssUrlOptions, Preset, RollupOptions, RollupOutputOptions, Config as SWCConfig, Options$1 as SWCOptions, SassLoaderOptions, SassLoaderSassOptions, SourceMapType, StyleLoaderInjectType, StyleLoaderOptions, StylusLoaderOptions, StylusLoaderStylusOptions, StylusOptions, StylusOptionsDefineItem, StylusOptionsResolveURL, TaroConfig, TaroConfigEnv, TaroConfigExport, TaroConfigFn, TaroConfigFnObject, TaroConfigFnPromise, TaroSassOptions, MinifyOptions$1 as TerserMinifyOptions, TerserMinimizer, URLLoaderOptions, Version, VitePlugin, Webpack, WebpackCompilation, WebpackCompiler, WebpackConfiguration, WebpackLoaderContext, WebpackMerge, defineConfig };