1 | import { IModule } from "../interfaces/modules";
|
2 | import { IWebpackStats, IWebpackStatsAsset, IWebpackStatsAssets, IWebpackStatsChunk, IWebpackStatsModules } from "../interfaces/webpack-stats";
|
3 | export interface IActionConstructor {
|
4 | stats: IWebpackStats;
|
5 | ignoredPackages?: (string | RegExp)[];
|
6 | }
|
7 | export interface IModulesByAsset {
|
8 | [asset: string]: {
|
9 | asset: IWebpackStatsAsset;
|
10 | mods: IModule[];
|
11 | };
|
12 | }
|
13 | export declare const nodeModulesParts: (name: string) => string[];
|
14 | export declare const _isNodeModules: (name: string) => boolean;
|
15 | export declare const _normalizeWebpackPath: (identifier: string, name?: string | undefined) => string;
|
16 | export declare const _getBaseName: (name: string) => string | null;
|
17 | export declare abstract class Action {
|
18 | stats: IWebpackStats;
|
19 | private _data?;
|
20 | private _modules?;
|
21 | private _assets?;
|
22 | private _template?;
|
23 | private _ignoredPackages;
|
24 | constructor({ stats, ignoredPackages }: IActionConstructor);
|
25 | validate(): Promise<IAction>;
|
26 | getData(): Promise<object>;
|
27 | get modules(): IModule[];
|
28 | shouldBail(): Promise<boolean>;
|
29 | protected ignorePackage(baseName: string): boolean;
|
30 | protected getSourceMods(mods: IWebpackStatsModules, parentChunks?: IWebpackStatsChunk[]): IModule[];
|
31 | get assets(): IModulesByAsset;
|
32 | protected getSourceAssets(assets: IWebpackStatsAssets): IModulesByAsset;
|
33 | get template(): ITemplate;
|
34 | protected abstract _getData(): Promise<object>;
|
35 | protected abstract _createTemplate(): ITemplate;
|
36 | }
|
37 | export declare type IAction = Action;
|
38 | interface ITemplateConstructor {
|
39 | action: IAction;
|
40 | }
|
41 | export declare enum TemplateFormat {
|
42 | json = "json",
|
43 | text = "text",
|
44 | tsv = "tsv"
|
45 | }
|
46 | export interface ITemplate {
|
47 | json(): Promise<string>;
|
48 | text(): Promise<string>;
|
49 | tsv(): Promise<string>;
|
50 | render(format: TemplateFormat): Promise<string>;
|
51 | }
|
52 | export declare abstract class Template implements ITemplate {
|
53 | protected action: IAction;
|
54 | constructor({ action }: ITemplateConstructor);
|
55 | json(): Promise<string>;
|
56 | abstract text(): Promise<string>;
|
57 | abstract tsv(): Promise<string>;
|
58 | render(format: TemplateFormat): Promise<string>;
|
59 | protected trim(str: string, num: number): string;
|
60 | }
|
61 | export {};
|