import type { WebpackStats } from "./common-types"; interface StatsAssetLike { name?: string; } export interface WebpackStatsJson { /** Compilation name. `MultiStats.toJson()` sets this on every child. */ name?: string; entrypoints?: Record; } | undefined>; publicPath?: string; /** Present on the object returned by `MultiStats.toJson()`. */ children?: WebpackStatsJson[]; } /** * The parts of `webpack.MultiStats` this module uses. webpack does not export a * public type for `MultiStats`. */ export interface MultiStatsLike { toJson(options?: unknown): WebpackStatsJson; } export interface ScriptUrlOptions { entrypoint?: string; /** Compilation name. Required when several children share an entrypoint. */ compilation?: string; /** Entrypoint names to omit, for example the renderer entry on an error page. */ excludeEntrypoints?: string[]; } /** * Get the public URLs of the JavaScript assets for one entrypoint. * * Works with single and multi-compilation stats. When more than one compilation * defines the entrypoint, pass `compilation` to choose between them; combining * several compilations' scripts is never implicit. An unknown entrypoint or * compilation name throws rather than returning an empty list. */ export declare function getScriptUrlsFromStats(stats: WebpackStatsJson, { entrypoint, compilation, excludeEntrypoints }?: ScriptUrlOptions): string[]; /** * Get the public URLs of the JavaScript assets for an entrypoint. * * Inside `mapStatsToParams` the stats are already client-only: the plugin only * collects compilations that use `statsCollectorPlugin`. The stats webpack * passes to its build callback include every compilation, including the * renderer, so pass a compilation name there. * * @example * mapStatsToParams: ({ webpackStats }) => ({ * scripts: getEntrypointScriptUrls(webpackStats), * }) */ export declare function getEntrypointScriptUrls(webpackStats: WebpackStats | MultiStatsLike, entrypoint?: string, compilation?: string): string[]; export {};