UNPKG

785 BTypeScriptView Raw
1import Config from '@cli-engine/config';
2import { ICommandInfo } from './command';
3import { IPluginModule, IPluginPJSON } from './plugins/plugin';
4export declare abstract class Hook<T extends keyof IHooks> {
5 protected config: Config;
6 protected options: IHooks[T];
7 constructor(config: Config, options?: IHooks[T]);
8 abstract run(): Promise<void>;
9}
10export interface IHooks {
11 init: {};
12 update: {};
13 'plugins:parse': {
14 module: IPluginModule;
15 pjson: IPluginPJSON;
16 };
17 prerun: {
18 Command: ICommandInfo;
19 argv: string[];
20 };
21}
22export declare class Hooks {
23 private config;
24 constructor(config: Config);
25 run<T extends keyof IHooks>(event: T, options?: IHooks[T]): Promise<void>;
26 private isLegacyHook<T>(Hook);
27}