1 | import WebpackChainConfig from 'webpack-chain';
|
2 | import { Config } from './commands/args';
|
3 | import { BabelRC } from './utils/babel-config';
|
4 | export declare type SetConfig = (config: Config) => Config | Promise<Config>;
|
5 | export declare type ModifyBundlerConfig<C = any> = (config: C, dev: boolean, args: Config) => C;
|
6 | export declare type ModifyBabelRC = (babelrc: BabelRC, args: Config) => BabelRC;
|
7 | export declare type ModifyFiles = (files: string[], args: Config) => string[];
|
8 | export declare type OnCreateWebpackChain = (config: WebpackChainConfig, dev: boolean, args: Config) => void;
|
9 | export declare type onPreCreateApp = <A>(app: A) => void;
|
10 | export declare type onCreateApp = <A>(app: A) => void;
|
11 | export declare type OnServerListening = <S>(server: S) => void;
|
12 | export declare type OnPreBuild = (args: Config) => void;
|
13 | export declare type OnPostBuild = (args: Config) => void;
|
14 | export declare type OnPreRender = () => void;
|
15 | export declare type OnPostRender = () => void;
|
16 | export interface PluginFactory {
|
17 | setConfig?: SetConfig;
|
18 | modifyBundlerConfig?: ModifyBundlerConfig;
|
19 | modifyBabelRc?: ModifyBabelRC;
|
20 | modifyFiles?: ModifyFiles;
|
21 | onCreateWebpackChain?: OnCreateWebpackChain;
|
22 | onPreCreateApp?: onPreCreateApp;
|
23 | onCreateApp?: onCreateApp;
|
24 | onServerListening?: OnServerListening;
|
25 | onPreBuild?: OnPreBuild;
|
26 | onPostBuild?: OnPostBuild;
|
27 | onPreRender?: OnPreRender;
|
28 | onPostRender?: OnPostRender;
|
29 | }
|
30 | export declare class Plugin<C = any> implements PluginFactory {
|
31 | static runPluginsMethod(plugins: Plugin[] | undefined): (method: keyof Plugin, ...args: any[]) => void;
|
32 | static propsOfPlugins(plugins: Plugin[]): (prop: keyof Plugin) => any[];
|
33 | static reduceFromPlugins<C>(plugins: Plugin[] | undefined): (method: keyof Plugin, initial: C, ...args: any[]) => C;
|
34 | static reduceFromPluginsAsync<C>(plugins: Plugin[] | undefined): (method: keyof Plugin, initial: C, ...args: any[]) => Promise<C>;
|
35 | readonly setConfig?: SetConfig;
|
36 | readonly modifyBundlerConfig?: ModifyBundlerConfig<C>;
|
37 | readonly modifyBabelRc?: ModifyBabelRC;
|
38 | readonly modifyFiles?: ModifyFiles;
|
39 | readonly onCreateWebpackChain?: OnCreateWebpackChain;
|
40 | readonly onPreCreateApp?: onPreCreateApp;
|
41 | readonly onCreateApp?: onCreateApp;
|
42 | readonly onServerListening?: OnServerListening;
|
43 | readonly onPreBuild?: OnPreBuild;
|
44 | readonly onPostBuild?: OnPostBuild;
|
45 | readonly onPreRender?: OnPreRender;
|
46 | readonly onPostRender?: OnPostRender;
|
47 | constructor(p: PluginFactory);
|
48 | }
|
49 | export declare function createPlugin<C = any>(factory: PluginFactory): Plugin<C>;
|