/* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn fix:special` to update */ import { Buffer } from "buffer"; import { CompiledAliasOptions } from "enhanced-resolve/types/AliasUtils"; import { ResolveOptions as ResolveOptionsImport, UserResolveOptions } from "enhanced-resolve/types/ResolverFactory"; import { ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentPattern, AssignmentProperty, AwaitExpression, BigIntLiteral, BinaryExpression, BlockStatement, BreakStatement, CatchClause, ChainExpression, ClassBody, ClassDeclaration, ClassExpression, Comment as CommentImport, ConditionalExpression, ContinueStatement, DebuggerStatement, Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, ExportSpecifier, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, Identifier, IfStatement, ImportDeclaration, ImportDefaultSpecifier, ImportExpression as ImportExpressionImport, ImportNamespaceSpecifier, ImportSpecifier, LabeledStatement, LogicalExpression, MaybeNamedClassDeclaration, MaybeNamedFunctionDeclaration, MemberExpression, MetaProperty, MethodDefinition, NewExpression, ObjectExpression, ObjectPattern, PrivateIdentifier, Program, Property, PropertyDefinition, RegExpLiteral, RestElement, ReturnStatement, SequenceExpression, SimpleCallExpression, SimpleLiteral, SourceLocation, SpreadElement, StaticBlock, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateElement, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclarator, WhileStatement, WithStatement, YieldExpression } from "estree"; import { FileHandle } from "fs/promises"; import { Server as ServerImportHttp, ServerOptions as ServerOptionsImportHttp } from "http"; import { Server as ServerImportHttps, ServerOptions as ServerOptionsImportHttps } from "https"; import { Session as SessionImportInspectorClass_1, Session as SessionImportInspectorClass_2 } from "inspector"; import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema"; import { ListenOptions } from "net"; import { ExtendedSchema, ValidationErrorConfiguration, validate as validateFunction } from "schema-utils"; import { default as ValidationError } from "schema-utils/declarations/ValidationError"; import { AsArray, AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, AsyncSeriesWaterfallHook, HookMap, IfSet, MultiHook, SyncBailHook, SyncHook, SyncWaterfallHook, TapOptions, TypedHookMap } from "tapable"; import { Context as ContextImport } from "vm"; import { addScopesToSourceMap, collectSourceScopes, createScopeCollector, createScopesWriter, encodeScopes } from "webpack-sources/types/helpers/scopes"; import { originalPositionFor } from "webpack-sources/types/helpers/sourceMap"; import { disableDualStringBufferCaching, enableDualStringBufferCaching, enterStringInterningRange, exitStringInterningRange, internString, isDualStringBufferCachingEnabled } from "webpack-sources/types/helpers/stringBufferUtils"; type Profile = import("inspector").Profiler.Profile; type SetSamplingIntervalParameterType = import("inspector").Profiler.SetSamplingIntervalParameterType; type StopReturnType = import("inspector").Profiler.StopReturnType; declare interface Abortable { signal?: AbortSignal; } /** * Represents AbstractLibraryPlugin. */ declare class AbstractLibraryPlugin { /** * Creates an instance of AbstractLibraryPlugin. */ constructor(__0: AbstractLibraryPluginOptions); /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Returns preprocess as needed by overriding. */ parseOptions(library: LibraryOptions): T; /** * Finish entry module. */ finishEntryModule( module: Module, entryName: string, libraryContext: LibraryContext ): void; /** * Embed in runtime bailout. */ embedInRuntimeBailout( module: Module, renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): undefined | string; /** * Strict runtime bailout. */ strictRuntimeBailout( renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): undefined | string; /** * Processes the provided chunk. */ runtimeRequirements( chunk: Chunk, set: Set, libraryContext: LibraryContext ): void; /** * Returns source with library export. */ render( source: Source, renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): Source; /** * Renders source with library export. */ renderStartup( source: Source, module: Module, renderContext: StartupRenderContext, libraryContext: LibraryContext ): Source; /** * Renders module content. */ renderModuleContent( source: Source, module: Module, renderContext: ModuleRenderContext, libraryContext: Omit, "options"> ): Source; /** * Processes the provided chunk. */ chunkHash( chunk: Chunk, hash: Hash, chunkHashContext: ChunkHashContext, libraryContext: LibraryContext ): void; static COMMON_LIBRARY_NAME_MESSAGE: string; } /** * Defines the abstract library plugin options type used by this module. */ declare interface AbstractLibraryPluginOptions { /** * name of the plugin */ pluginName: string; /** * used library type */ type: string; } type AdditionalData = exports.AdditionalDataKnown & Record; type AfterContextResolveData = ContextResolveData & ContextOptions & { resource: string | string[]; resourceQuery?: string; resourceFragment?: string; resolveDependencies: ( fs: InputFileSystem, options: ContextModuleOptions, callback: ( err: null | Error, dependencies?: ContextElementDependency[] ) => void ) => void; }; declare class AggressiveMergingPlugin { /** * Creates an instance of AggressiveMergingPlugin. */ constructor(options?: AggressiveMergingPluginOptions); options: AggressiveMergingPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } /** * Defines the aggressive merging plugin options type used by this module. */ declare interface AggressiveMergingPluginOptions { /** * minimal size reduction to trigger merging */ minSizeReduce?: number; } declare class AggressiveSplittingPlugin { /** * Creates an instance of AggressiveSplittingPlugin. */ constructor(options?: AggressiveSplittingPluginOptions); options: AggressiveSplittingPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Was chunk recorded. */ static wasChunkRecorded(chunk: Chunk): boolean; } declare interface AggressiveSplittingPluginOptions { /** * Extra cost for each chunk (Default: 9.8kiB). */ chunkOverhead?: number; /** * Extra cost multiplicator for entry chunks (Default: 10). */ entryChunkMultiplicator?: number; /** * Byte, max size of per file (Default: 50kiB). */ maxSize?: number; /** * Byte, split point. (Default: 30kiB). */ minSize?: number; } type AnalyzableForm = "import" | "url" | "url-runtime" | "url-inline" | "wasm" | "wasm-relative"; type AnyLoaderContext = NormalModuleLoaderContext & LoaderRunnerMutableContext & LoaderRunnerReadonlyContext & LoaderPluginLoaderContext & HotModuleReplacementPluginLoaderContext; /** * The parts of a language that names none: every node type has every part. */ declare interface AnyParts { types: number; field: number; flag: number; part: number; text: number; fields: Record; flags: Record; parts: Record; texts: Record; items: Record; } /** * Defines the argument type used by this module. */ declare interface Argument { description?: string; simpleType: SimpleType; multiple: boolean; configs: ArgumentConfig[]; } /** * Defines the argument config type used by this module. */ declare interface ArgumentConfig { description?: string; negatedDescription?: string; path: string; multiple: boolean; type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset"; values?: EnumValue[]; } /** * Defines the asset type used by this module. */ declare interface Asset { /** * the filename of the asset */ name: string; /** * source of the asset */ source: Source; /** * info about the asset */ info: AssetInfo; } declare abstract class AssetBytesGenerator extends Generator { /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: AssetNormalModule, generateContext: GenerateContext ): null | Source; } declare abstract class AssetBytesParser extends Parser {} declare interface AssetDependencyMeta { sourceType: "asset-url" | "css-url"; } /** * Defines the asset emitted info type used by this module. */ declare interface AssetEmittedInfo { content: Buffer; source: Source; compilation: Compilation; outputPath: string; targetPath: string; } type AssetFilterItemTypes = string | RegExp | ((name: string, asset: StatsAsset) => boolean); declare abstract class AssetGenerator extends Generator { dataUrlOptions?: | AssetGeneratorDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => string); filename?: string | TemplatePathFn; publicPath?: string | TemplatePathFn; outputPath?: string | TemplatePathFn; emit?: boolean; binary?: boolean; /** * Returns mime type. */ getMimeType(module: AssetNormalModule): string; /** * Generates data uri. */ generateDataUri(module: AssetNormalModule, renderedSource?: Source): string; /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: AssetNormalModule, generateContext: GenerateContext ): null | Source; } /** * Options object for data url generation. */ declare interface AssetGeneratorDataUrlOptions { /** * Asset encoding (defaults to base64). */ encoding?: false | "base64"; /** * Asset mimetype (getting from file extension by default). */ mimetype?: string; } type AssetGeneratorOptions = AssetInlineGeneratorOptions & AssetResourceGeneratorOptions; type AssetInfo = exports.KnownAssetInfo & Record; /** * Generator options for asset/inline modules. */ declare interface AssetInlineGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * The options for data url generator. */ dataUrl?: | AssetGeneratorDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => string); } type AssetModuleBuildInfo = exports.KnownBuildInfo & Record & KnownNormalModuleBuildInfo & KnownAssetModuleBuildInfo; declare class AssetModulesPlugin { /** * Creates an instance of AssetModulesPlugin. */ constructor(options: AssetModulesPluginOptions); options: AssetModulesPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } /** * Represents the asset modules plugin runtime component. */ declare interface AssetModulesPluginOptions { sideEffectFree?: boolean; } type AssetNormalModule = NormalModule & { buildInfo?: AssetModuleBuildInfo }; declare abstract class AssetParser extends Parser { dataUrlCondition?: | boolean | AssetParserDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => boolean); } /** * Options object for DataUrl condition. */ declare interface AssetParserDataUrlOptions { /** * Maximum size of asset that should be inline as modules. Default: 8kb. */ maxSize?: number; } /** * Parser options for asset modules. */ declare interface AssetParserOptions { /** * The condition for inlining the asset as DataUrl. */ dataUrlCondition?: | AssetParserDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => boolean); } /** * Generator options for asset/resource modules. */ declare interface AssetResourceGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR. */ emit?: boolean; /** * The filename of asset modules as relative path inside the 'output.path' directory. */ filename?: string | TemplatePathFn; /** * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there. */ outputPath?: string | TemplatePathFn; /** * The 'publicPath' specifies the public URL address of the output files when referenced in a browser. */ publicPath?: string | TemplatePathFn; } declare abstract class AssetSourceGenerator extends Generator { /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: AssetNormalModule, generateContext: GenerateContext ): null | Source; } declare abstract class AssetSourceParser extends Parser {} /** * Where an asset which is a symbolic link points, as the link itself spells it. */ declare interface AssetSymlink { /** * what the link points at, left as it is written */ target: string; /** * whether it points at a directory, which is what Windows needs in order to create one */ isDirectory: boolean; } /** * Access and modification times an asset carries onto the file it is written to. */ declare interface AssetTimestamps { /** * last access time, in milliseconds */ atime: number; /** * last modification time, in milliseconds */ mtime: number; } declare class AsyncDependenciesBlock extends DependenciesBlock { constructor( groupOptions: null | string | GroupOptionsAsyncDependenciesBlock, loc?: null | SyntheticDependencyLocation | RealDependencyLocation, request?: null | string ); groupOptions: GroupOptionsAsyncDependenciesBlock; loc?: null | SyntheticDependencyLocation | RealDependencyLocation; request?: null | string; chunkName?: null | string; get circular(): boolean; module: void; } /** * Represents AsyncQueue. */ declare abstract class AsyncQueue { hooks: { beforeAdd: AsyncSeriesHook<[T]>; added: SyncHook<[T]>; beforeStart: AsyncSeriesHook<[T]>; started: SyncHook<[T]>; result: SyncHook< [T, undefined | null | WebpackError, undefined | null | R] >; }; /** * Returns context of execution. */ getContext(): string; /** * Updates context using the provided value. */ setContext(value: string): void; /** * Processes the provided item. */ add(item: T, callback: CallbackAsyncQueue): void; /** * Processes the provided item. */ invalidate(item: T): void; /** * Waits for an already started item */ waitFor(item: T, callback: CallbackAsyncQueue): void; /** * Describes how this stop operation behaves. */ stop(): void; /** * Increase parallelism. */ increaseParallelism(): void; /** * Decrease parallelism. */ decreaseParallelism(): void; /** * Checks whether this async queue is processing. */ isProcessing(item: T): boolean; /** * Checks whether this async queue is queued. */ isQueued(item: T): boolean; /** * Checks whether this async queue is done. */ isDone(item: T): boolean; clear(): void; } declare class AsyncWebAssemblyModulesPlugin { /** * Creates an instance of AsyncWebAssemblyModulesPlugin. */ constructor(options: AsyncWebAssemblyModulesPluginOptions); options: AsyncWebAssemblyModulesPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Renders the newly generated source from rendering. */ renderModule( module: Module, renderContext: WebAssemblyRenderContext, hooks: CompilationHooks ): Source; static getCompilationHooks: (compilation: Compilation) => CompilationHooks; } /** * Defines the async web assembly modules plugin options type used by this module. */ declare interface AsyncWebAssemblyModulesPluginOptions { /** * mangle imports */ mangleImports?: boolean; } declare abstract class AsyncWebAssemblyParser extends Parser {} /** * Records modules from one compilation and adds them back as prefetch * dependencies in the next compilation. */ declare class AutomaticPrefetchPlugin { constructor(); /** * Registers hooks that remember previously built normal modules and enqueue * them as `PrefetchDependency` requests during the next make phase. */ apply(compiler: Compiler): void; } type AuxiliaryComment = string | LibraryCustomUmdCommentObject; /** * Defines the backend api type used by this module. */ declare interface BackendApi { dispose: (callback: (err?: null | Error) => void) => void; module: (module: Module) => ModuleResult; } /** * Prepends or appends banner text to emitted assets that match the configured * file filters. */ declare class BannerPlugin { /** * Normalizes banner options and compiles the configured banner source into a * function that can render per-asset banner text. */ constructor(options: BannerPluginArgument); options: BannerPluginOptions; banner: (data: { hash?: string; /** * Wraps banner text in a JavaScript block comment, preserving multi-line * formatting and escaping accidental comment terminators. */ chunk: Chunk; filename: string; }) => string; /** * Validates the configured options and injects rendered banner comments into * matching compilation assets at the configured process-assets stage. */ apply(compiler: Compiler): void; } type BannerPluginArgument = | string | BannerPluginOptions | ((data: { hash?: string; /** * Wraps banner text in a JavaScript block comment, preserving multi-line * formatting and escaping accidental comment terminators. */ chunk: Chunk; filename: string; }) => string); declare interface BannerPluginOptions { /** * Specifies the banner. */ banner: | string | ((data: { hash?: string; /** * Wraps banner text in a JavaScript block comment, preserving multi-line * formatting and escaping accidental comment terminators. */ chunk: Chunk; filename: string; }) => string); /** * If true, the banner will only be added to the entry chunks. */ entryOnly?: boolean; /** * Exclude all modules matching any of these conditions. */ exclude?: string | RegExp | ((str: string) => boolean) | RuleGlob | Rule[]; /** * If true, banner will be placed at the end of the output. */ footer?: boolean; /** * Include all modules matching any of these conditions. */ include?: string | RegExp | ((str: string) => boolean) | RuleGlob | Rule[]; /** * If true, banner will not be wrapped in a comment. */ raw?: boolean; /** * Specifies the stage when add a banner. */ stage?: number; /** * Include all modules that pass test assertion. */ test?: string | RegExp | ((str: string) => boolean) | RuleGlob | Rule[]; } declare interface BaseResolveRequest { /** * path */ path: string | false; /** * content */ context?: ContextResolver; /** * description file path */ descriptionFilePath?: string; /** * description file root */ descriptionFileRoot?: string; /** * description file data */ descriptionFileData?: JsonObjectResolver; /** * tsconfig paths map */ tsconfigPathsMap?: null | TsconfigPathsMap; /** * relative path */ relativePath?: string; /** * true when need to ignore symlinks, otherwise false */ ignoreSymlinks?: boolean; /** * true when full specified, otherwise false */ fullySpecified?: boolean; /** * package id the request was resolved to in the package map, to be propagated to resolutions made from the resulting file (`@experimental`, see the `packageMap` option) */ packageId?: string; /** * inner request for internal usage */ __innerRequest?: string; /** * inner request for internal usage */ __innerRequest_request?: string; /** * inner relative path for internal usage */ __innerRequest_relativePath?: string; /** * internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring */ __restrictionsMarker?: { blocked: boolean }; } declare interface BasenameCacheEntry { /** * cached dirname function */ fn: (maybePath: string, suffix?: string) => string; /** * the underlying cache map */ cache: Map>; } /** * An instance is allocated for a large share of walked expressions, so the * boolean facts live in one packed flags slot and the scalar/identifier * fields in five slots shared by type, with accessors keeping every public * field readable. This shrinks instances from 224 to 144 bytes on V8. */ declare abstract class BasicEvaluatedExpression { quasis?: BasicEvaluatedExpression[]; parts?: BasicEvaluatedExpression[]; items?: BasicEvaluatedExpression[]; options?: BasicEvaluatedExpression[]; prefix?: null | BasicEvaluatedExpression; postfix?: null | BasicEvaluatedExpression; wrappedInnerExpressions?: BasicEvaluatedExpression[]; expression?: | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; /** * The expression's node in the syntax tree, for a reader that walks or * evaluates it by id during the same parse, before its object is read. * @experimental the `{ path: true }` tap option; unstable API */ get expressionNode(): number; /** * Served lazily from the attached expression when not set explicitly: * `evaluateExpression`'s plain results share the expression's range, and * most evaluations never read it, so the node's range array is only * materialized on demand. */ range?: [number, number]; type: number; truthy: boolean; falsy: boolean; nullish?: boolean; sideEffects: boolean; bool?: boolean; number?: number; bigint?: bigint; regExp?: RegExp; string?: string; templateStringKind?: "cooked" | "raw"; array?: string[]; identifier?: string | VariableInfo; rootInfo?: string | VariableInfo; getMembers?: () => string[]; getMembersOptionals?: () => boolean[]; getMemberRanges?: () => [number, number][]; isUnknown(): boolean; isNull(): boolean; isUndefined(): boolean; isString(): boolean; isNumber(): boolean; isBigInt(): boolean; isBoolean(): boolean; isRegExp(): boolean; isConditional(): boolean; isArray(): boolean; isConstArray(): boolean; isIdentifier(): boolean; isWrapped(): boolean; isTemplateString(): boolean; /** * Is expression a primitive or an object type value? */ isPrimitiveType(): undefined | boolean; /** * Is expression a runtime or compile-time value? */ isCompileTimeValue(): boolean; /** * As compile time value. */ asCompileTimeValue(): undefined | null | string | number | bigint | boolean | RegExp | string[]; isTruthy(): boolean; isFalsy(): boolean; isNullish(): undefined | boolean; /** * Can this expression have side effects? */ couldHaveSideEffects(): boolean; /** * Creates a boolean representation of this evaluated expression. */ asBool(): undefined | boolean; /** * Creates a nullish coalescing representation of this evaluated expression. */ asNullish(): undefined | boolean; /** * Creates a string representation of this evaluated expression. */ asString(): undefined | string; /** * Updates string using the provided string. */ setString(string: string): BasicEvaluatedExpression; setUndefined(): BasicEvaluatedExpression; setNull(): BasicEvaluatedExpression; /** * Set's the value of this expression to a number */ setNumber(number: number): BasicEvaluatedExpression; /** * Set's the value of this expression to a BigInt */ setBigInt(bigint: bigint): BasicEvaluatedExpression; /** * Set's the value of this expression to a boolean */ setBoolean(bool: boolean): BasicEvaluatedExpression; /** * Set's the value of this expression to a regular expression */ setRegExp(regExp: RegExp): BasicEvaluatedExpression; /** * Set's the value of this expression to a particular identifier and its members. */ setIdentifier( identifier: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals?: () => boolean[], getMemberRanges?: () => [number, number][] ): BasicEvaluatedExpression; /** * Wraps an array of expressions with a prefix and postfix expression. */ setWrapped( prefix?: null | BasicEvaluatedExpression, postfix?: null | BasicEvaluatedExpression, innerExpressions?: BasicEvaluatedExpression[] ): BasicEvaluatedExpression; /** * Stores the options of a conditional expression. */ setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Adds the provided basic evaluated expression to the basic evaluated expression. */ addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Set's the value of this expression to an array of expressions. */ setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Set's the value of this expression to an array of strings. */ setArray(array: string[]): BasicEvaluatedExpression; /** * Set's the value of this expression to a processed/unprocessed template string. Used * for evaluating TemplateLiteral expressions in the JavaScript Parser. */ setTemplateString( quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[], kind: "cooked" | "raw" ): BasicEvaluatedExpression; setTruthy(): BasicEvaluatedExpression; setFalsy(): BasicEvaluatedExpression; /** * Set's the value of the expression to nullish. */ setNullish(value: boolean): BasicEvaluatedExpression; /** * Set's the range for the expression. */ setRange(range: [number, number]): BasicEvaluatedExpression; /** * Set whether or not the expression has side effects. */ setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression; /** * Set the expression node for the expression. */ setExpression( expression?: | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement ): BasicEvaluatedExpression; /** * Set's the expression to a node of a syntax tree, its object made only * when `expression` is first read. */ setNode(tree: ColumnarSyntaxTree, node: number): BasicEvaluatedExpression; } type BeforeContextResolveData = ContextResolveData & ContextOptions; /** * Defines the bind cache type used by this module. */ declare interface BindCache { (cache: object): BindCacheResultFn; } /** * Defines the bind cache result fn type used by this module. */ declare interface BindCacheResultFn { (value: string): T; } declare interface Bootstrap { header: string[]; beforeStartup: string[]; startup: string[]; afterStartup: string[]; allowInlineStartup: boolean; exportsAwaited: boolean; } /** * Which disjunction branch a named group sits in, so that the same name in two * alternatives of one disjunction is allowed and a repeat in one is not. */ declare abstract class BranchID { parent: null | BranchID; base: BranchID; walk: number; taken: null | BranchID; /** * Two branches are separated when some disjunction they both sit under took * a different alternative for each, so nothing can match both. */ separatedFrom(alt: BranchID): boolean; sibling(): BranchID; } type BufferEncoding = | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; type BufferEncodingOption = "buffer" | { encoding: "buffer" }; declare interface BufferEntry { map?: null | RawSourceMap; bufferedMap?: null | BufferedMap; scopes?: ScopesReplay; } type BufferSerializableType = Buffer | (() => BufferSerializableType[] | Promise); declare interface BufferedMap { /** * version */ version: number; /** * sources */ sources: string[]; /** * name */ names: string[]; /** * source root */ sourceRoot?: string; /** * sources content */ sourcesContent?: ("" | Buffer)[]; /** * mappings */ mappings?: Buffer; /** * file */ file: string; } declare interface BuffersSerializerContext { logger?: Logger; retainedBuffer?: (x: Buffer) => Buffer; } type BuildDependencyItem = | string | { /** * Request to a dependency (resolved as directory relative to the context directory). */ dependency: string; /** * When true, the dependency may be missing. Existence changes invalidate the cache. */ optional?: boolean; }; /** * What a build recorded for stats and the performance hints to report, kept on the build info so a module restored from the cache still has it. */ declare interface BuildDiagnostics { /** * what parser plugins reported as optimization bailouts, replayed into the module graph of every compilation that reuses the module */ optimizationBailouts?: string[]; /** * the statement whose side effect keeps the module in the bundle, as `type at location` */ sideEffectStatement?: string; /** * how many `#__PURE__` annotations sit where the parser does not read them */ ineffectivePureAnnotations?: number; /** * how many times the module reads `this` at its top level */ topLevelThis?: number; /** * true when the module calls `eval` directly */ usesEval?: boolean; /** * reasons why the module is not cacheable (e.g. paths of loaders that marked it) */ notCacheableReasons?: string[]; } type BuildInfo = exports.KnownBuildInfo & Record; type BuildMeta = exports.KnownBuildMeta & Record; type BuiltAssetModule = NormalModule & { buildInfo: AssetModuleBuildInfo; buildMeta: BuildMeta; }; type BuiltAsyncWasmModule = NormalModule & { buildInfo: NormalModuleBuildInfo; buildMeta: BuildMeta; }; type BuiltCssModule = NormalModule & { buildInfo: CssModuleBuildInfo; buildMeta: CssModuleBuildMeta; }; type BuiltHtmlModule = NormalModule & { buildInfo: HtmlModuleBuildInfo; buildMeta: BuildMeta; }; type BuiltJavascriptModule = NormalModule & { buildInfo: JavascriptModuleBuildInfo; buildMeta: JavascriptModuleBuildMeta; }; type BuiltJsonModule = NormalModule & { buildInfo: JsonModuleBuildInfo; buildMeta: BuildMeta; }; type BuiltSyncWasmModule = NormalModule & { buildInfo: NormalModuleBuildInfo; buildMeta: SyncWasmModuleBuildMeta; }; type BuiltinEmbeddedRendererOptions = Pick< CssProcessOptions, | "environment" | "convertLengthUnits" | "convertApproximateColors" | "dropOverriddenDeclarations" | "rewriteCustomProperties" | "transforms" | "unusedSymbols" | "pseudoClasses" > & BuiltinSvgOptions; declare interface BuiltinSvgOptions { /** * minify an SVG `data:` URL as the `.svg` assets are, with their `optimization.minimize.xml` switches when given, wherever that is shorter (default false) */ svg?: boolean | OptimizationMinimizeXml; /** * called with what the CSS minifier throws on a body, which is then left as written */ reportError?: (error: Error) => void; } declare class BunTargetPlugin { constructor(); /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare abstract class ByTypeGenerator< TModule extends NormalModule = NormalModule > extends Generator { map: { [index: string]: undefined | Generator }; generateError?: ( error: Error, module: NormalModule, generateContext: GenerateContext ) => null | Source; } declare const CIRCULAR_CONNECTION: unique symbol; /** * Abstract cache interface backed by tapable hooks for reading, writing, idle * transitions, and shutdown across webpack cache implementations. */ declare class Cache { /** * Initializes the cache lifecycle hooks implemented by cache backends. */ constructor(); hooks: { get: AsyncSeriesBailHook< [string, null | Etag, GotHandler[]], ComplexSerializableType >; store: AsyncParallelHook<[string, null | Etag, ComplexSerializableType]>; storeBuildDependencies: AsyncParallelHook< [Iterable, Iterable] >; beginIdle: SyncHook<[]>; endIdle: AsyncParallelHook<[]>; shutdown: AsyncParallelHook<[]>; }; /** * Retrieves a cached value and lets registered `gotHandlers` observe the * result before the caller receives it. */ get( identifier: string, etag: null | Etag, callback: CallbackCacheCache ): void; /** * Stores a cache entry for the identifier and etag through the registered * cache backend hooks. */ store( identifier: string, etag: null | Etag, data: T, callback: CallbackCacheCache ): void; /** * Persists the set of build dependencies required to determine whether the * cache can be restored in a future compilation. */ storeBuildDependencies( dependencies: Iterable, optionalDependencies: Iterable, callback: CallbackCacheCache ): void; /** * Signals that webpack is entering an idle phase and cache backends may flush * or compact pending work. */ beginIdle(): void; /** * Signals that webpack is leaving the idle phase and waits for cache * backends to finish any asynchronous resume work. */ endIdle(callback: CallbackCacheCache): void; /** * Shuts down every registered cache backend and waits for cleanup to finish. */ shutdown(callback: CallbackCacheCache): void; static STAGE_MEMORY: number; static STAGE_DEFAULT: number; static STAGE_DISK: number; static STAGE_NETWORK: number; } declare abstract class CacheFacade { /** * Returns whether a cache backend is active. */ isEnabled(): boolean; /** * Returns child cache. */ getChildCache(name: string): CacheFacade; /** * Returns item cache. */ getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade; /** * Gets lazy hashed etag. */ getLazyHashedEtag(obj: HashableObject): Etag; /** * Merges the provided values into a single result. */ mergeEtags(a: Etag, b: Etag): Etag; /** * Returns value. */ get( identifier: string, etag: null | Etag, callback: CallbackCacheCacheFacade ): void; /** * Returns promise with the data. */ getPromise(identifier: string, etag: null | Etag): Promise; /** * Processes the provided identifier. */ store( identifier: string, etag: null | Etag, data: T, callback: CallbackCacheCacheFacade ): void; /** * Stores the provided identifier. */ storePromise( identifier: string, etag: null | Etag, data: T ): Promise; /** * Processes the provided identifier. */ provide( identifier: string, etag: null | Etag, computer: (callback: CallbackNormalErrorCache) => void, callback: CallbackNormalErrorCache ): void; /** * Returns promise with the data. */ providePromise( identifier: string, etag: null | Etag, computer: () => T | Promise ): Promise; } /** * Defines the cache group source type used by this module. */ declare interface CacheGroupSource { key: string; priority?: number; getName?: ( module: Module, chunks: Chunk[], key: string ) => undefined | string; chunksFilter?: (chunk: Chunk) => undefined | boolean; enforce?: boolean; minSize: SplitChunksSizes; minSizeReduction: SplitChunksSizes; minRemainingSize: SplitChunksSizes; enforceSizeThreshold: SplitChunksSizes; maxAsyncSize: SplitChunksSizes; maxInitialSize: SplitChunksSizes; minChunks?: number; maxAsyncRequests?: number; maxInitialRequests?: number; filename?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); idHint?: string; automaticNameDelimiter?: string; reuseExistingChunk?: boolean; usedExports?: boolean; } /** * Defines the cache groups context type used by this module. */ declare interface CacheGroupsContext { moduleGraph: ModuleGraph; chunkGraph: ChunkGraph; } type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions; declare interface CachedData { /** * source */ source?: boolean; /** * buffer */ buffer: Buffer; /** * size */ size?: number; /** * maps */ maps: Map; /** * hash */ hash?: (string | Buffer)[]; } declare class CachedSource extends Source { constructor(source: Source | (() => Source), cachedData?: CachedData); getCachedData(): CachedData; originalLazy(): Source | (() => Source); original(): Source; streamChunks( options: OptionsStreamChunks, onChunk: ( chunk: undefined | string, generatedLine: number, generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number, nameIndex: number ) => void, onSource: ( sourceIndex: number, source: null | string, sourceContent?: string, scopeBindings?: Map ) => void, onName: (nameIndex: number, name: string) => void ): GeneratedSourceInfo; } declare interface CalculatedStringResult { range?: [number, number]; value: string; code: boolean; conditional: false | CalculatedStringResult[]; } type CallExpression = SimpleCallExpression | NewExpression; declare interface CallExpressionInfo { type: "call"; call: CallExpression; calleeName: string; rootInfo: string | VariableInfo; getCalleeMembers: () => string[]; name: string; getMembers: () => string[]; getMembersOptionals: () => boolean[]; getMemberRanges: () => [number, number][]; } /** * Defines the callback callback. */ declare interface CallbackAsyncQueue { (err?: null | WebpackError, result?: null | T): void; } /** * Creates a callback wrapper that waits for a fixed number of completions and * forwards the first error immediately. */ declare interface CallbackCacheCache { /** * Creates a callback wrapper that waits for a fixed number of completions and * forwards the first error immediately. */ (err: null | Error, result?: T): void; } /** * Defines the callback cache callback. */ declare interface CallbackCacheCacheFacade { (err?: null | Error, result?: T): void; } /** * Defines the callback normal error cache callback. */ declare interface CallbackNormalErrorCache { (err?: null | Error, result?: T): void; } /** * Creates a multi compiler. */ declare interface CallbackWebpackFunction_1 { /** * Creates a multi compiler. */ (err: null | Error, result?: T): void; } /** * Creates a multi compiler. */ declare interface CallbackWebpackFunction_2 { /** * Creates a multi compiler. */ (err: null | Error, result?: T): R; } /** * A split `maxInitialRequests`/`maxAsyncRequests` refused, recorded for * `performance.splitChunksCapped`. */ declare interface CappedSplit { /** * the cache group whose split was refused */ cacheGroup: string; /** * the chunk it would have been taken out of */ chunk: Chunk; /** * the option that refused it */ limit: "maxAsyncRequests" | "maxInitialRequests"; /** * the value that option had */ maxRequests: number; /** * how many modules the split would have moved */ modules: number; } type Cell = undefined | T; type Child = string | Source | SourceLike; /** * A Chunk is a unit of encapsulation for Modules. * Chunks are "rendered" into bundles that get emitted when the build completes. */ declare class Chunk { /** * Creates an instance of Chunk. */ constructor(name?: null | string, backCompat?: boolean); id: null | string | number; ids: null | ChunkId[]; debugId: number; name?: null | string; idNameHints: SortableSet; preventIntegration: boolean; filenameTemplate?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); cssFilenameTemplate?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); runtime: RuntimeSpec; files: Set; auxiliaryFiles: Set; rendered: boolean; hash?: string; contentHash: Record; contentHashFull: Record; renderedHash?: string; chunkReason?: string; extraAsync: boolean; /** * Returns entry module. * @deprecated */ get entryModule(): Module; /** * Checks whether this chunk has an entry module. * @deprecated */ hasEntryModule(): boolean; /** * Adds the provided module to the chunk. * @deprecated */ addModule(module: Module): boolean; /** * Removes the provided module from the chunk. * @deprecated */ removeModule(module: Module): void; /** * Gets the number of modules in this chunk. * @deprecated */ getNumberOfModules(): number; /** * @deprecated */ get modulesIterable(): Iterable; /** * Compares this chunk with another chunk. * @deprecated */ compareTo(otherChunk: Chunk): 0 | 1 | -1; /** * Checks whether this chunk contains the module. * @deprecated */ containsModule(module: Module): boolean; /** * Returns the modules for this chunk. * @deprecated */ getModules(): Module[]; /** * Removes this chunk from the chunk graph and chunk groups. * @deprecated */ remove(): void; /** * Moves a module from this chunk to another chunk. * @deprecated */ moveModule(module: Module, otherChunk: Chunk): void; /** * Integrates another chunk into this chunk when possible. * @deprecated */ integrate(otherChunk: Chunk): boolean; /** * Checks whether this chunk can be integrated with another chunk. * @deprecated */ canBeIntegrated(otherChunk: Chunk): boolean; /** * Checks whether this chunk is empty. * @deprecated */ isEmpty(): boolean; /** * Returns the total size of all modules in this chunk. * @deprecated */ modulesSize(): number; /** * Returns the estimated size for the requested source type. * @deprecated */ size(options?: ChunkSizeOptions): number; /** * Returns the integrated size with another chunk. * @deprecated */ integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number; /** * Gets chunk module maps. * @deprecated */ getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps; /** * Checks whether this chunk contains a matching module in the graph. * @deprecated */ hasModuleInGraph( filterFn: (m: Module) => boolean, filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; /** * Returns the chunk map information. * @deprecated */ getChunkMaps(realHash: boolean): ChunkMaps; /** * Checks whether this chunk has runtime. */ hasRuntime(): boolean; /** * Returns whether this chunk carries a hot update rather than regular output. */ isHotUpdate(): boolean; /** * Checks whether it can be initial. */ canBeInitial(): boolean; /** * Checks whether this chunk is only initial. */ isOnlyInitial(): boolean; /** * Gets entry options. */ getEntryOptions(): undefined | EntryOptions; /** * Adds the provided chunk group to the chunk. */ addGroup(chunkGroup: ChunkGroup): void; /** * Removes the provided chunk group from the chunk. */ removeGroup(chunkGroup: ChunkGroup): void; /** * Checks whether this chunk is in group. */ isInGroup(chunkGroup: ChunkGroup): boolean; /** * Gets number of groups. */ getNumberOfGroups(): number; /** * Gets groups iterable. */ get groupsIterable(): SortableSet; /** * Disconnects from groups. */ disconnectFromGroups(): void; /** * Processes the provided new chunk. */ split(newChunk: Chunk): void; /** * Updates the hash with the data contributed by this instance. */ updateHash(hash: Hash, chunkGraph: ChunkGraph): void; /** * Gets all async chunks. */ getAllAsyncChunks(): Set; /** * Gets all initial chunks. */ getAllInitialChunks(): Set; /** * Gets all referenced chunks. */ getAllReferencedChunks(): Set; /** * Gets all referenced async entrypoints. */ getAllReferencedAsyncEntrypoints(): Set; /** * Checks whether this chunk has async chunks. */ hasAsyncChunks(): boolean; /** * Gets child ids by orders. */ getChildIdsByOrders( chunkGraph: ChunkGraph, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): Record; /** * Gets children of type in order. */ getChildrenOfTypeInOrder( chunkGraph: ChunkGraph, type: string ): undefined | ChunkChildOfTypeInOrder[]; /** * Gets child ids by orders map. */ getChildIdsByOrdersMap( chunkGraph: ChunkGraph, includeDirectChildren?: boolean, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): ChunkChildIdsByOrdersMapByData; /** * Checks whether this chunk contains the chunk graph. */ hasChildByOrder( chunkGraph: ChunkGraph, type: string, includeDirectChildren?: boolean, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; } declare interface ChunkChildIdsByOrdersMap { [index: string]: ChunkId[]; } declare interface ChunkChildIdsByOrdersMapByData { [index: string]: ChunkChildIdsByOrdersMap; } declare interface ChunkChildOfTypeInOrder { onChunks: Chunk[]; chunks: Set; } declare interface ChunkConditionMap { [index: number]: boolean; [index: string]: boolean; } type ChunkFilenameTemplate = string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); declare class ChunkGraph { /** * Creates an instance of ChunkGraph. */ constructor(moduleGraph: ModuleGraph, hashFunction?: HashFunction); moduleGraph: ModuleGraph; buildTimeExecution: boolean; /** * Connects chunk and module. */ connectChunkAndModule(chunk: Chunk, module: Module): void; /** * Disconnects chunk and module. */ disconnectChunkAndModule(chunk: Chunk, module: Module): void; /** * Processes the provided chunk. */ disconnectChunk(chunk: Chunk): void; /** * Processes the provided chunk. */ attachModules(chunk: Chunk, modules: Iterable): void; /** * Attach runtime modules. */ attachRuntimeModules(chunk: Chunk, modules: Iterable): void; /** * Attach full hash modules. */ attachFullHashModules(chunk: Chunk, modules: Iterable): void; /** * Attach dependent hash modules. */ attachDependentHashModules( chunk: Chunk, modules: Iterable ): void; /** * Processes the provided old module. */ replaceModule(oldModule: Module, newModule: Module): void; /** * Checks whether this chunk graph is module in chunk. */ isModuleInChunk(module: Module, chunk: Chunk): boolean; /** * Checks whether this chunk graph is module in chunk group. */ isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean; /** * Checks whether this chunk graph is entry module. */ isEntryModule(module: Module): boolean; /** * Gets module chunks iterable. */ getModuleChunksIterable(module: Module): Iterable; /** * Gets ordered module chunks iterable. */ getOrderedModuleChunksIterable( module: Module, sortFn: (a: Chunk, b: Chunk) => 0 | 1 | -1 ): Iterable; /** * Gets module chunks. */ getModuleChunks(module: Module): Chunk[]; /** * Gets number of module chunks. */ getNumberOfModuleChunks(module: Module): number; /** * Gets module runtimes. */ getModuleRuntimes(module: Module): RuntimeSpecSet; /** * Gets number of chunk modules. */ getNumberOfChunkModules(chunk: Chunk): number; /** * Gets number of chunk full hash modules. */ getNumberOfChunkFullHashModules(chunk: Chunk): number; /** * Gets chunk modules iterable. */ getChunkModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk modules iterable by source type. */ getChunkModulesIterableBySourceType( chunk: Chunk, sourceType: string ): undefined | Iterable; /** * Sets chunk module source types. */ setChunkModuleSourceTypes( chunk: Chunk, module: Module, sourceTypes: ReadonlySet ): void; /** * Gets chunk module source types. */ getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet; /** * Gets module source types. */ getModuleSourceTypes(module: Module): ReadonlySet; /** * Gets ordered chunk modules iterable. */ getOrderedChunkModulesIterable( chunk: Chunk, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): Iterable; /** * Gets ordered chunk modules iterable by source type. */ getOrderedChunkModulesIterableBySourceType( chunk: Chunk, sourceType: string, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): undefined | Iterable; /** * Gets chunk modules. */ getChunkModules(chunk: Chunk): Module[]; /** * Gets ordered chunk modules. */ getOrderedChunkModules( chunk: Chunk, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): Module[]; /** * Gets chunk module id map. */ getChunkModuleIdMap( chunk: Chunk, filterFn: (m: Module) => boolean, includeAllChunks?: boolean ): ChunkModuleIdMapEs5Alias_2; /** * Gets chunk module rendered hash map. */ getChunkModuleRenderedHashMap( chunk: Chunk, filterFn: (m: Module) => boolean, hashLength?: number, includeAllChunks?: boolean ): ChunkModuleHashMap; /** * Gets chunk condition map. */ getChunkConditionMap( chunk: Chunk, filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): ChunkConditionMap; /** * Checks whether this chunk graph contains the chunk. */ hasModuleInGraph( chunk: Chunk, filterFn: (m: Module) => boolean, filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; /** * Compares the provided values and returns their ordering. */ compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1; /** * Gets chunk modules size. */ getChunkModulesSize(chunk: Chunk): number; /** * Gets chunk modules sizes. */ getChunkModulesSizes(chunk: Chunk): Record; /** * Gets chunk root modules. */ getChunkRootModules(chunk: Chunk): Module[]; /** * Returns total size of the chunk. */ getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number; /** * Gets integrated chunks size. */ getIntegratedChunksSize( chunkA: Chunk, chunkB: Chunk, options?: ChunkSizeOptions ): number; /** * Checks whether it can chunks be integrated. */ canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean; /** * Processes the provided chunk a. */ integrateChunks( chunkA: Chunk, chunkB: Chunk, namedChunks?: Map ): void; /** * Upgrade dependent to full hash modules. */ upgradeDependentToFullHashModules(chunk: Chunk): void; /** * Checks whether this chunk graph is entry module in chunk. */ isEntryModuleInChunk(module: Module, chunk: Chunk): boolean; /** * Connects chunk and entry module. */ connectChunkAndEntryModule( chunk: Chunk, module: Module, entrypoint: Entrypoint ): void; /** * Connects chunk and runtime module. */ connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; /** * Adds full hash module to chunk. */ addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void; /** * Adds dependent hash module to chunk. */ addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void; /** * Disconnects chunk and entry module. */ disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void; /** * Disconnects chunk and runtime module. */ disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; /** * Disconnects entry module. */ disconnectEntryModule(module: Module): void; /** * Disconnects entries. */ disconnectEntries(chunk: Chunk): void; /** * Gets number of entry modules. */ getNumberOfEntryModules(chunk: Chunk): number; /** * Gets number of runtime modules. */ getNumberOfRuntimeModules(chunk: Chunk): number; /** * Gets chunk entry modules iterable. */ getChunkEntryModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk entry dependent chunks iterable. */ getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable; /** * Gets runtime chunk dependent chunks iterable. */ getRuntimeChunkDependentChunksIterable(chunk: Chunk): Iterable; /** * Checks whether this chunk graph contains the chunk. */ hasChunkEntryDependentChunks(chunk: Chunk): boolean; /** * Gets chunk runtime modules iterable. */ getChunkRuntimeModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk runtime modules in order. */ getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[]; /** * Gets chunk full hash modules iterable. */ getChunkFullHashModulesIterable( chunk: Chunk ): undefined | Iterable; /** * Gets chunk full hash modules set. */ getChunkFullHashModulesSet( chunk: Chunk ): undefined | ReadonlySet; /** * Gets chunk dependent hash modules iterable. */ getChunkDependentHashModulesIterable( chunk: Chunk ): undefined | Iterable; /** * Gets chunk entry modules with chunk group iterable. */ getChunkEntryModulesWithChunkGroupIterable( chunk: Chunk ): Iterable<[Module, undefined | Entrypoint]>; /** * Gets block chunk group. */ getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup; /** * Connects block and chunk group. */ connectBlockAndChunkGroup( depBlock: AsyncDependenciesBlock, chunkGroup: ChunkGroup ): void; /** * Disconnects chunk group. */ disconnectChunkGroup(chunkGroup: ChunkGroup): void; /** * Returns the id of the module. */ getModuleId(module: Module): null | string | number; /** * Updates module id using the provided module. */ setModuleId(module: Module, id: ModuleId): void; /** * Returns the id of the runtime. */ getRuntimeId(runtime: string): RuntimeId; /** * Updates runtime id using the provided runtime. */ setRuntimeId(runtime: string, id: RuntimeId): void; /** * Checks whether this chunk graph contains the module. */ hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean; /** * Returns hash. */ getModuleHash(module: Module, runtime: RuntimeSpec): string; /** * Gets rendered module hash. */ getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string; /** * Sets module hashes. */ setModuleHashes( module: Module, runtime: RuntimeSpec, hash: string, renderedHash: string ): void; /** * Adds module runtime requirements. */ addModuleRuntimeRequirements( module: Module, runtime: RuntimeSpec, items: Set, transferOwnership?: boolean ): void; /** * Adds chunk runtime requirements. */ addChunkRuntimeRequirements(chunk: Chunk, items: Set): void; /** * Adds tree runtime requirements. */ addTreeRuntimeRequirements(chunk: Chunk, items: Iterable): void; /** * Gets module runtime requirements. */ getModuleRuntimeRequirements( module: Module, runtime: RuntimeSpec ): ReadonlySet; /** * Gets chunk runtime requirements. */ getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet; /** * Gets module graph hash. */ getModuleGraphHash( module: Module, runtime: RuntimeSpec, withConnections?: boolean ): string; /** * Gets module graph hash big int. */ getModuleGraphHashBigInt( module: Module, runtime: RuntimeSpec, withConnections?: boolean ): bigint; /** * Gets tree runtime requirements. */ getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet; /** * Gets chunk graph for module. * @deprecated */ static getChunkGraphForModule( module: Module, deprecateMessage: string, deprecationCode: string ): ChunkGraph; /** * Sets chunk graph for module. * @deprecated */ static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void; /** * Clear chunk graph for module. * @deprecated */ static clearChunkGraphForModule(module: Module): void; /** * Gets chunk graph for chunk. * @deprecated */ static getChunkGraphForChunk( chunk: Chunk, deprecateMessage: string, deprecationCode: string ): ChunkGraph; /** * Sets chunk graph for chunk. * @deprecated */ static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void; /** * Clear chunk graph for chunk. * @deprecated */ static clearChunkGraphForChunk(chunk: Chunk): void; } /** * Represents a connected group of chunks along with the parent/child * relationships, async blocks, and traversal metadata webpack tracks for it. */ declare abstract class ChunkGroup { groupDebugId: number; options: ChunkGroupOptions; chunks: Chunk[]; origins: OriginRecord[]; index?: number; /** * Merges additional options into the chunk group. * Order-based options are combined by taking the higher priority, while * unsupported conflicts surface as an explicit error. */ addOptions(options: ChunkGroupOptions): void; /** * Returns the configured name of the chunk group, if one was assigned. * Updates the configured name of the chunk group. */ name?: null | string; /** * Returns a debug-only identifier derived from the group's member chunk * debug ids. This is primarily useful in diagnostics and assertions. */ get debugId(): string; /** * Returns an identifier derived from the ids of the chunks currently in * the group. */ get id(): string; /** * Moves a chunk to the front of the group or inserts it when it is not * already present. */ unshiftChunk(chunk: Chunk): boolean; /** * Inserts a chunk directly before another chunk that already belongs to the * group, preserving the rest of the ordering. */ insertChunk(chunk: Chunk, before: Chunk): boolean; /** * Appends a chunk to the group when it is not already a member. */ pushChunk(chunk: Chunk): boolean; /** * Replaces one member chunk with another while preserving the group's * ordering and avoiding duplicates. */ replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean; /** * Removes a chunk from this group. */ removeChunk(chunk: Chunk): boolean; /** * Indicates whether this chunk group is loaded as part of the initial page * load instead of being created lazily. */ isInitial(): boolean; /** * Returns whether this chunk group is an entrypoint, an async one (e.g. a worker) included. */ isEntrypoint(): boolean; /** * Adds a child chunk group to the current group. */ addChild(group: ChunkGroup): boolean; /** * Returns the child chunk groups reachable from this group. */ getChildren(): ChunkGroup[]; getNumberOfChildren(): number; get childrenIterable(): SortableSet; /** * Removes a child chunk group and clears the corresponding parent link on * the removed child. */ removeChild(group: ChunkGroup): boolean; /** * Records a parent chunk group relationship. */ addParent(parentChunk: ChunkGroup): boolean; /** * Returns the parent chunk groups that can lead to this group. */ getParents(): ChunkGroup[]; getNumberOfParents(): number; /** * Checks whether the provided group is registered as a parent. */ hasParent(parent: ChunkGroup): boolean; get parentsIterable(): SortableSet; /** * Removes a parent chunk group and clears the reverse child relationship. */ removeParent(chunkGroup: ChunkGroup): boolean; /** * Registers an async entrypoint that is rooted in this chunk group. */ addAsyncEntrypoint(entrypoint: Entrypoint): boolean; get asyncEntrypointsIterable(): SortableSet; /** * Returns the async dependency blocks that create or reference this group. */ getBlocks(): AsyncDependenciesBlock[]; getNumberOfBlocks(): number; /** * Checks whether an async dependency block is associated with this group. */ hasBlock(block: AsyncDependenciesBlock): boolean; /** * Exposes the group's async dependency blocks as an iterable. */ get blocksIterable(): Iterable; /** * Associates an async dependency block with this chunk group. */ addBlock(block: AsyncDependenciesBlock): boolean; /** * Records where this chunk group originated from in user code. * The origin is used for diagnostics, ordering, and reporting. */ addOrigin( module: null | Module, loc: DependencyLocation, request: string ): void; /** * Collects the emitted files produced by every chunk in the group. */ getFiles(): string[]; /** * Disconnects this group from its parents, children, and chunks. * Child groups are reconnected to this group's parents so the surrounding * graph remains intact after removal. */ remove(): void; sortItems(): void; /** * Sorting predicate which allows current ChunkGroup to be compared against another. * Sorting values are based off of number of chunks in ChunkGroup. */ compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1; /** * Aggregates per-block `*Order` options for the blocks that bridge this * chunk group to the given child chunk group. `*Order` options are tied to * the originating `import()` call and must not be sourced from the child's * shared options, otherwise a webpackPrefetch/Preload directive from one * parent would leak into other parents that share the child by name. */ getChildOrderOptions( childGroup: ChunkGroup, chunkGraph: ChunkGraph ): Record; /** * Groups child chunk groups by their `*Order` options and sorts each group * by descending order and deterministic chunk-group comparison. */ getChildrenByOrders( moduleGraph: ModuleGraph, chunkGraph: ChunkGraph ): Record; /** * Stores the module's top-down traversal index within this group. */ setModulePreOrderIndex(module: Module, index: number): void; /** * Returns the module's top-down traversal index within this group. */ getModulePreOrderIndex(module: Module): undefined | number; /** * Stores the module's bottom-up traversal index within this group. */ setModulePostOrderIndex(module: Module, index: number): void; /** * Returns the module's bottom-up traversal index within this group. */ getModulePostOrderIndex(module: Module): undefined | number; checkConstraints(): void; getModuleIndex: (module: Module) => undefined | number; getModuleIndex2: (module: Module) => undefined | number; } declare interface ChunkGroupInfoWithName { name: string; chunkGroup: ChunkGroup; } type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string }; /** * Defines the chunk hash context type used by this module. */ declare interface ChunkHashContext { /** * results of code generation */ codeGenerationResults: CodeGenerationResults; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; } declare interface ChunkHashes { [index: number]: string; [index: string]: string; } type ChunkId = string | number; declare interface ChunkInjectedModuleIds { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } /** * Defines the chunk maps type used by this module. * @deprecated */ declare interface ChunkMaps { hash: Record; contentHash: Record>; name: Record; } declare interface ChunkModuleHashMap { [index: number]: IdToHashMap; [index: string]: IdToHashMap; } declare interface ChunkModuleHashes { [index: string]: string; } /** * Defines the chunk module id map type used by this module. */ declare interface ChunkModuleIdMapEs5Alias_1 { [index: number]: ChunkId[]; [index: string]: ChunkId[]; } declare interface ChunkModuleIdMapEs5Alias_2 { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } declare class ChunkModuleIdRangePlugin { /** * Creates an instance of ChunkModuleIdRangePlugin. */ constructor(options: ChunkModuleIdRangePluginOptions); options: ChunkModuleIdRangePluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } /** * Defines the chunk module id range plugin options type used by this module. */ declare interface ChunkModuleIdRangePluginOptions { /** * the chunk name */ name: string; /** * order */ order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex"; /** * start id */ start?: number; /** * end id */ end?: number; } declare interface ChunkModuleIds { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } /** * Defines the chunk module maps type used by this module. * @deprecated */ declare interface ChunkModuleMaps { id: ChunkModuleIdMapEs5Alias_1; hash: chunkModuleHashMap; } type ChunkName = null | string; /** * Defines the chunk path data type used by this module. */ declare interface ChunkPathData { id: string | number; name?: string; hash: string; hashWithLength?: (length: number) => string; /** * builds `[chunkhash:]` per chunk in the runtime chunk-filename map */ hashWithDigest?: (digest: string, length?: number) => string; contentHash?: Record; contentHashWithLength?: Record string>; /** * builds `[contenthash:]` per chunk in the runtime chunk-filename map */ contentHashWithDigest?: Record< string, (digest: string, length?: number) => string >; } /** * Adds runtime support for chunk prefetch and preload relationships discovered * in the chunk graph. */ declare class ChunkPrefetchPreloadPlugin { constructor(); /** * Registers compilation hooks that emit the runtime modules responsible for * scheduling chunk prefetch and preload requests. */ apply(compiler: Compiler): void; } /** * Defines the chunk render context type used by this module. */ declare interface ChunkRenderContextCssModulesPlugin { /** * the chunk */ chunk?: Chunk; /** * the chunk graph */ chunkGraph?: ChunkGraph; /** * results of code generation */ codeGenerationResults?: CodeGenerationResults; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * undo path to css file */ undoPath: string; /** * compilation hash */ hash?: string; /** * moduleFactoryCache */ moduleFactoryCache: WeakMap; /** * content */ moduleSourceContent: Source; /** * another module of the chunk comes after this one */ followed?: boolean; } /** * Defines the chunk render context type used by this module. */ declare interface ChunkRenderContextJavascriptModulesPlugin { /** * the chunk */ chunk: Chunk; /** * the dependency templates */ dependencyTemplates: DependencyTemplates; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; /** * results of code generation */ codeGenerationResults: CodeGenerationResults; /** * init fragments for the chunk */ chunkInitFragments: InitFragment[]; /** * rendering in strict context */ strictMode?: boolean; /** * entry module inlined at the chunk top level instead of the registry */ inlinedEntryModule?: Module; /** * rendered body of the inlined entry module */ inlinedEntrySource?: Source; } declare interface ChunkRetainedDependencyIds { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } declare interface ChunkRuntime { [index: number]: string; [index: string]: string; } declare interface ChunkSiblingIds { [index: number]: ChunkId[]; [index: string]: ChunkId[]; } /** * Represents the module hash info runtime component. */ declare interface ChunkSizeOptions { /** * constant overhead for a chunk */ chunkOverhead?: number; /** * multiplicator for initial chunks */ entryChunkMultiplicator?: number; } declare abstract class ChunkTemplate { hooks: Readonly<{ renderManifest: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( renderManifestEntries: RenderManifestEntry[], renderManifestOptions: RenderManifestOptions ) => RenderManifestEntry[] ) => void; }; modules: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContextJavascriptModulesPlugin ) => Source ) => void; }; render: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContextJavascriptModulesPlugin ) => Source ) => void; }; renderWithEntry: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: (source: Source, chunk: Chunk) => Source ) => void; }; hash: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: (hash: Hash) => void ) => void; }; hashForChunk: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( hash: Hash, chunk: Chunk, chunkHashContext: ChunkHashContext ) => void ) => void; }; }>; get outputOptions(): OutputNormalizedWithDefaults; } /** * Advanced options for cleaning assets. */ declare interface CleanOptions { /** * Log the assets that should be removed instead of deleting them. */ dry?: boolean; /** * Keep these assets. */ keep?: string | RegExp | GlobCondition | ((path: string) => undefined | boolean); } declare class CleanPlugin { constructor(options?: CleanOptions); options: CleanOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; static getCompilationHooks: (compilation: Compilation) => { /** * When returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config. * @since 5.20.0 */ keep: SyncBailHook<[string], boolean | void>; }; } declare interface ClearCacheOptions { /** * drop cached source maps (default `true`) */ maps?: boolean; /** * drop cached source/buffer copies (default `true`) */ source?: boolean; /** * drop the parsed object form of cached source maps on `SourceMapSource` instances (default `false` — re-parsing JSON is significantly more expensive than `toString`). Only takes effect when a serialized form (buffer or string) is also retained, so the data remains recoverable. */ parsedMap?: boolean; } /** * Defines the code gen map overloads type used by this module. */ declare interface CodeGenMapOverloads { get: ( key: K ) => undefined | CodeGenValue; set: ( key: K, value: CodeGenValue ) => CodeGenerationResultData; has: (key: keyof exports.AllCodeGenerationSchemas) => boolean; delete: (key: keyof exports.AllCodeGenerationSchemas) => boolean; } type CodeGenValue = K extends keyof exports.AllCodeGenerationSchemas ? exports.AllCodeGenerationSchemas[K] : never; /** * Defines the code generation context type used by this module. */ declare interface CodeGenerationContext { /** * the dependency templates */ dependencyTemplates: DependencyTemplates; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; /** * the runtimes code should be generated for */ runtime: RuntimeSpec; /** * all runtimes code should be generated for */ runtimes: RuntimeSpec[]; /** * when in concatenated module, information about other concatenated modules */ concatenationScope?: ConcatenationScope; /** * code generation results of other modules (need to have a codeGenerationDependency to use that) */ codeGenerationResults?: CodeGenerationResults; /** * the compilation */ compilation?: Compilation; /** * source types */ sourceTypes?: ReadonlySet; } declare interface CodeGenerationJob { module: Module; hash: string; runtime: RuntimeSpec; runtimes: RuntimeSpec[]; } /** * Defines the code generation result type used by this module. */ declare interface CodeGenerationResult { /** * the resulting sources for all source types */ sources: Map; /** * the resulting data for all source types */ data?: CodeGenerationResultData; /** * the runtime requirements */ runtimeRequirements: null | ReadonlySet; /** * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided) */ hash?: string; } type CodeGenerationResultData = Omit< Map< keyof exports.AllCodeGenerationSchemas, | string | AssetInfo | string[] | Record | Set | [{ shareScope: string; initStage: number; init: string }] | InitFragment[] | { javascript?: string; "asset-url"?: string } | Map >, "get" | "set" | "has" | "delete" > & CodeGenMapOverloads; /** * Stores code generation results keyed by module and runtime so later stages * can retrieve emitted sources, metadata, and derived hashes. */ declare abstract class CodeGenerationResults { map: Map>; /** * Returns the code generation result for a module/runtime pair, rejecting * ambiguous lookups where no unique runtime-independent result exists. */ get(module: Module, runtime: RuntimeSpec): CodeGenerationResult; /** * Reports whether a module has a stored result for the requested runtime, or * a single unambiguous result when no runtime is specified. */ has(module: Module, runtime: RuntimeSpec): boolean; /** * Returns a generated source of the requested source type from a stored code * generation result. */ getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source; /** * Returns the runtime requirements captured during code generation for the * requested module/runtime pair. */ getRuntimeRequirements( module: Module, runtime: RuntimeSpec ): null | ReadonlySet; /** * Returns a metadata entry recorded during code generation. */ getData( module: Module, runtime: RuntimeSpec, key: K ): undefined | CodeGenValue; /** * Returns a stable hash for the generated sources and runtime requirements, * computing and caching it on first access. */ getHash(module: Module, runtime: RuntimeSpec): string; /** * Stores a code generation result for a module/runtime pair, creating the * per-module runtime map when needed. */ add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void; } type CodeValue = | undefined | null | string | number | bigint | boolean | CallableFunction | NewableFunction | RegExp | RuntimeValue | { [index: string]: RecursiveArrayOrRecord< | undefined | null | string | number | bigint | boolean | CallableFunction | NewableFunction | RegExp | RuntimeValue >; } | RecursiveArrayOrRecord< | undefined | null | string | number | bigint | boolean | CallableFunction | NewableFunction | RegExp | RuntimeValue >[]; type CodeValuePrimitive = | undefined | null | string | number | bigint | boolean | CallableFunction | NewableFunction | RegExp; type CollectedComment = CommentImport & { start: number; end: number }; declare interface Colors { reset: (value?: unknown) => string; bold: (value?: unknown) => string; dim: (value?: unknown) => string; italic: (value?: unknown) => string; underline: (value?: unknown) => string; inverse: (value?: unknown) => string; hidden: (value?: unknown) => string; strikethrough: (value?: unknown) => string; black: (value?: unknown) => string; red: (value?: unknown) => string; green: (value?: unknown) => string; yellow: (value?: unknown) => string; blue: (value?: unknown) => string; magenta: (value?: unknown) => string; cyan: (value?: unknown) => string; white: (value?: unknown) => string; gray: (value?: unknown) => string; bgBlack: (value?: unknown) => string; bgRed: (value?: unknown) => string; bgGreen: (value?: unknown) => string; bgYellow: (value?: unknown) => string; bgBlue: (value?: unknown) => string; bgMagenta: (value?: unknown) => string; bgCyan: (value?: unknown) => string; bgWhite: (value?: unknown) => string; blackBright: (value?: unknown) => string; redBright: (value?: unknown) => string; greenBright: (value?: unknown) => string; yellowBright: (value?: unknown) => string; blueBright: (value?: unknown) => string; magentaBright: (value?: unknown) => string; cyanBright: (value?: unknown) => string; whiteBright: (value?: unknown) => string; bgBlackBright: (value?: unknown) => string; bgRedBright: (value?: unknown) => string; bgGreenBright: (value?: unknown) => string; bgYellowBright: (value?: unknown) => string; bgBlueBright: (value?: unknown) => string; bgMagentaBright: (value?: unknown) => string; bgCyanBright: (value?: unknown) => string; bgWhiteBright: (value?: unknown) => string; } /** * Defines the colors options type used by this module. */ declare interface ColorsOptions { /** * force use colors */ useColor?: boolean; } /** * A JavaScript syntax tree held as a struct of arrays: a node is an integer * id from 1, `0` is no node, and it reads as the CSS and HTML paths do. */ declare abstract class ColumnarSyntaxTree { /** * Hands the columns back once nothing reads the tree: the next tree reuses * small ones, and a large one's ArrayBuffers are freed at once, where they * would otherwise outlast the parse into the work after it. */ release(): void; /** * Forgets every node, keeping the columns for the next tree. */ reset(): void; add(type: number, start: number, end: number): number; /** * Sets one field of a node: a child node, an array of them for a list, * `0` or null where ESTree has null. */ set( node: number, name: string, value?: | null | string | number | bigint | boolean | RegExp | { cooked?: null | string; raw: string } | (null | number)[] ): void; /** * Writes a node from its record, each slot a child node, a list from * `addList` or a value from `addValue`, `0` or left out for none. */ addNode( type: number | TreeTypeCode, start: number, end: number, flags: number, slot0?: null | number, slot1?: null | number, slot2?: null | number, slot3?: null | number ): TreeNode; /** * `addNode` for a node whose record holds no slot, as `this`. */ addNode0( type: number | TreeTypeCode, start: number, end: number, flags: number ): TreeNode; /** * `addNode` for a node whose record holds two slots, as a member * expression or a call does, written without reading its slot count. */ addNode2( type: number | TreeTypeCode, start: number, end: number, flags: number, slot0: number, slot1: number ): TreeNode; /** * `addNode` for a literal, its value and raw text written in place, as a * parse writes one for every string and number. */ addLiteralNode( start: number, end: number, value: TreeValue, raw: string ): TreeNode<"Literal">; /** * `addNode` for a node whose record is one value, as an identifier's name. */ addValueNode( type: number | TreeTypeCode, start: number, end: number, value: TreeValue ): TreeNode; addValue( value?: | null | string | number | bigint | boolean | RegExp | { cooked?: null | string; raw: string } ): number; addList(items: number[], count: number): number; /** * Retypes a node whose record the new type reads the same, as an * expression the parser then reads as a pattern. */ setType(node: number, type: number): void; /** * Sets the slot a node's record holds a part in. */ setPart(part: number, node: number, text: string): void; /** * Writes a parsed node and everything under it, children before their * parent in source order, as the parser writes; a child already written * stands as its id. */ addEstree(root: EstreeInput, input?: string, skipUnknown?: boolean): number; /** * Writes a node a plugin built while this tree is read into it, keeping * the lazy objects already made reading the columns the write may grow. */ appendEstree(object: EstreeInput, input: string): number; /** * Grows the columns once to hold this many more nodes, slots, lists and * list items, where writing a tree of a known size would double them, * copying each column every time. */ reserve(nodes: number, slots: number, lists: number, items: number): void; /** * The ESTree object of a node of this tree, the same object each time: * the lazy one once `lazyEstree` was asked for, else as `toEstreeObject` * builds it without options. */ estree( node: number ): | null | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; /** * The ESTree object of a node of this tree as `toEstreeObject` builds it, * the same object for the same options. A long node reads each child from * the tree when its field is first read: a release copies what they read. */ estreeObject( node: number, options?: EstreeObjectOptions, input?: string ): | null | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; /** * A node's ESTree object, as `estree` makes it: a path's way to an object * for code that still reads one. */ object( node: number ): | null | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; /** * The lazy ESTree object of a node: it builds a child's object the first * time its field is read, so a node nothing reads gets none. From then on * `estree` serves these objects for every node of this tree. */ lazyEstree( node: number ): | null | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | Program | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; /** * Records that the legacy `assert` keyword opens a declaration's attributes. */ markLegacyAssert(node: number): void; legacyAssert(node: number): boolean; /** * Where the text reads `` comment before a tag wins over it, and either way the name is also the stem the chunk's file is emitted under. * @since 5.112.0 */ chunkName?: string | ((data: HtmlChunkNameData) => string); /** * How a page's CSS modules — `