import WebpackChainConfig from 'webpack-chain'; import { Config } from './commands/args'; import { BabelRC } from './utils/babel-config'; export declare type SetConfig = (config: Config) => Config | Promise; export declare type ModifyBundlerConfig = (config: C, dev: boolean, args: Config) => C; export declare type ModifyBabelRC = (babelrc: BabelRC, args: Config) => BabelRC; export declare type ModifyFiles = (files: string[], args: Config) => string[]; export declare type OnCreateWebpackChain = (config: WebpackChainConfig, dev: boolean, args: Config) => void; export declare type onPreCreateApp = (app: A) => void; export declare type onCreateApp = (app: A) => void; export declare type OnServerListening = (server: S) => void; export declare type OnPreBuild = (args: Config) => void; export declare type OnPostBuild = (args: Config) => void; export declare type OnPreRender = () => void; export declare type OnPostRender = () => void; export interface PluginFactory { setConfig?: SetConfig; modifyBundlerConfig?: ModifyBundlerConfig; modifyBabelRc?: ModifyBabelRC; modifyFiles?: ModifyFiles; onCreateWebpackChain?: OnCreateWebpackChain; onPreCreateApp?: onPreCreateApp; onCreateApp?: onCreateApp; onServerListening?: OnServerListening; onPreBuild?: OnPreBuild; onPostBuild?: OnPostBuild; onPreRender?: OnPreRender; onPostRender?: OnPostRender; } export declare class Plugin implements PluginFactory { static runPluginsMethod(plugins: Plugin[] | undefined): (method: keyof Plugin, ...args: any[]) => void; static propsOfPlugins(plugins: Plugin[]): (prop: keyof Plugin) => any[]; static reduceFromPlugins(plugins: Plugin[] | undefined): (method: keyof Plugin, initial: C, ...args: any[]) => C; static reduceFromPluginsAsync(plugins: Plugin[] | undefined): (method: keyof Plugin, initial: C, ...args: any[]) => Promise; readonly setConfig?: SetConfig; readonly modifyBundlerConfig?: ModifyBundlerConfig; readonly modifyBabelRc?: ModifyBabelRC; readonly modifyFiles?: ModifyFiles; readonly onCreateWebpackChain?: OnCreateWebpackChain; readonly onPreCreateApp?: onPreCreateApp; readonly onCreateApp?: onCreateApp; readonly onServerListening?: OnServerListening; readonly onPreBuild?: OnPreBuild; readonly onPostBuild?: OnPostBuild; readonly onPreRender?: OnPreRender; readonly onPostRender?: OnPostRender; constructor(p: PluginFactory); } export declare function createPlugin(factory: PluginFactory): Plugin;