import * as Config from '.'; export interface Hooks { [event: string]: object; init: { id: string | undefined; argv: string[]; }; prerun: { Command: Config.Command.Class; argv: string[]; }; update: {}; 'command_not_found': { id: string; }; 'plugins:preinstall': { plugin: { name: string; tag: string; type: 'npm'; }; }; } export declare type HookKeyOrOptions = K extends (keyof Hooks) ? Hooks[K] : K; export declare type Hook = (this: Hook.Context, options: HookKeyOrOptions & { config: Config.IConfig; }) => any; export declare namespace Hook { type Init = Hook<{ id: string | undefined; argv: string[]; }>; type PluginsPreinstall = Hook<{ name: string; tag: string; type: 'npm'; }>; type Prerun = Hook<{ Command: Config.Command.Class; argv: string[]; }>; type Update = Hook<{}>; type CommandNotFound = Hook<{ id: string; }>; interface Context { config: Config.IConfig; exit(code?: number): void; error(message: string | Error, options?: { code?: string; exit?: number; }): void; warn(message: string): void; log(message?: any, ...args: any[]): void; debug(...args: any[]): void; } }