/** * 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 { HookMap, SyncBailHook, SyncWaterfallHook } from "tapable"; import { GroupConfig } from "../util/smartGrouping"; import type { Compilation } from "../Compilation"; import { JsStats, JsStatsError, JsStatsWarning } from "@rspack/binding"; export type KnownStatsFactoryContext = { type: string; makePathsRelative?: ((arg0: string) => string) | undefined; compilation?: Compilation | undefined; cachedGetErrors?: ((arg0: Compilation) => JsStatsError[]) | undefined; cachedGetWarnings?: ((arg0: Compilation) => JsStatsWarning[]) | undefined; getInner: (compilation: Compilation) => JsStats; }; export type StatsFactoryContext = KnownStatsFactoryContext & Record; type Hooks = Readonly<{ extract: HookMap>; filter: HookMap>; filterSorted: HookMap>; groupResults: HookMap>; 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 {};