hooks.d.ts 841 B

123456789101112131415161718
  1. import { HookFn, HookInput, HookName, IConfig, IProject, IShell } from '../definitions';
  2. export interface HookDeps {
  3. readonly config: IConfig;
  4. readonly project: IProject;
  5. readonly shell: IShell;
  6. }
  7. export 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. }
  16. export declare function addHook(baseDir: string, hooks: string | string[] | undefined, hook: string): string[];
  17. export declare function removeHook(baseDir: string, hooks: string | string[] | undefined, hook: string): string[];
  18. export declare function locateHook(baseDir: string, hooks: string[], hook: string): number;