UNPKG

841 BTypeScriptView Raw
1import { HookFn, HookInput, HookName, IConfig, IProject, IShell } from '../definitions';
2export interface HookDeps {
3 readonly config: IConfig;
4 readonly project: IProject;
5 readonly shell: IShell;
6}
7export declare abstract class Hook {
8 protected readonly e: HookDeps;
9 abstract readonly name: HookName;
10 get script(): string;
11 constructor(e: HookDeps);
12 run(input: HookInput): Promise<void>;
13 protected loadHookFn(p: string): Promise<HookFn | undefined>;
14 private generateCTXEnvironment;
15}
16export declare function addHook(baseDir: string, hooks: string | string[] | undefined, hook: string): string[];
17export declare function removeHook(baseDir: string, hooks: string | string[] | undefined, hook: string): string[];
18export declare function locateHook(baseDir: string, hooks: string[], hook: string): number;