UNPKG

1.19 kBTypeScriptView Raw
1import { IAction, IActionConstructor, TemplateFormat } from "./actions/base";
2import { IWebpackStats } from "./interfaces/webpack-stats";
3interface IActions {
4 [key: string]: (opts: IActionConstructor) => IAction;
5}
6export declare const ACTIONS: IActions;
7export interface IRenderOptions extends IActionConstructor {
8 action: "duplicates" | "sizes" | "versions";
9 format: TemplateFormat;
10 stats: IWebpackStats;
11 ignoredPackages: (string | RegExp)[];
12}
13/**
14 * Get action instance.
15 *
16 * @param name {String} name of action
17 * @param opts {Object} action options
18 * @param opts.stats {Object} webpack stats object
19 * @returns {Promise<IAction>} action instance
20 */
21export declare const actions: (name: string, opts: IActionConstructor) => Promise<IAction>;
22/**
23 * Render action to final template format.
24 *
25 * @param opts {IRenderOpts} action + render options
26 * @param opts.action {String} name of action
27 * @param opts.format {Object} output format
28 * @param opts.stats {Object} webpack stats object
29 * @returns {Promise<string>} Rendered result
30 */
31export declare const render: ({ action, format, stats, ignoredPackages }: IRenderOptions) => Promise<string>;
32export {};