/** * The following code is modified based on * https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/stats * * MIT Licensed * Author Tobias Koppers @sokra * Copyright (c) JS Foundation and other contributors * https://github.com/webpack/webpack/blob/main/LICENSE */ import type { JsStats, JsStatsCompilation, JsStatsError } from '@rspack/binding'; import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.js'; import type { Compilation } from '../Compilation.js'; import { type GroupConfig } from '../util/smartGrouping.js'; export type KnownStatsFactoryContext = { type: string; makePathsRelative?: ((arg0: string) => string) | undefined; compilation: Compilation; cachedGetErrors?: ((arg0: Compilation) => JsStatsError[]) | undefined; cachedGetWarnings?: ((arg0: Compilation) => JsStatsError[]) | undefined; getStatsCompilation: (compilation: Compilation) => JsStatsCompilation; getInner: (compilation: Compilation) => JsStats; }; export type StatsFactoryContext = KnownStatsFactoryContext & Record; type Hooks = Readonly<{ extract: HookMap>; filter: HookMap>; filterSorted: HookMap>; groupResults: HookMap[], StatsFactoryContext], undefined>>; filterResults: HookMap>; sort: HookMap number)[], StatsFactoryContext ], undefined>>; sortResults: HookMap number)[], StatsFactoryContext ], undefined>>; result: HookMap>; merge: HookMap>; getItemName: HookMap>; getItemFactory: HookMap>; }>; type CacheHookMap = Map[]>; type CallFn = (...args: any[]) => any; export declare class StatsFactory { hooks: Hooks; private _caches; private _inCreate; constructor(); _getAllLevelHooks(hookMap: HookMap, cache: CacheHookMap, type: string): any[]; _forEachLevel(hookMap: HookMap, cache: CacheHookMap, type: string, fn: CallFn): any; _forEachLevelWaterfall(hookMap: HookMap, cache: CacheHookMap, type: string, data: any, fn: CallFn): any; _forEachLevelFilter(hookMap: HookMap, cache: CacheHookMap, type: string, items: any[], fn: CallFn, forceClone: boolean): any[]; create(type: string, data: any, baseContext: Omit): any; private _create; } export {};