import type { BaseProgram } from "./";
import type { Command, Config, ExtendedOption } from "../config";
import type { Run } from "../run";
import type { BaseArgs, BaseConfig } from './types';
import { AsyncSeriesHook, AsyncSeriesWaterfallHook, SyncHook } from 'tapable';
type TConfig<TProgram extends BaseProgram> = TProgram extends BaseProgram<infer T> ? Config<T> : BaseConfig;
type TArgs<TProgram extends BaseProgram> = TProgram extends BaseProgram<BaseConfig, infer T> ? T : BaseArgs;
export declare function hooks<TRun extends Run, TConfig extends BaseConfig, TArgs extends BaseArgs>(name: string): {
    Command: SyncHook<[Command, ExtendedOption[]], void, import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs when current program config
     * was completely resolved but not merged with args.<br/>
     * **Config can't be modified here.**
     *
     * @usage Best place to validate that config doesn't store any secret data.
     *
     * @prop config - completely built config specified for current program.
     * @prop args - program call args.
     */
    RawConfig: AsyncSeriesHook<[DeepFrozen<TConfig>, TArgs], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series **waterfall** hook which runs when current program config
     * was completely resolved and merged with args.<br/>
     * **Config can be modified here.**
     *
     * @usage Best place to normalize final config data.<br/>
     *
     * @prop config - completely built config specified for current program.
     * @prop args - previously merged to config program call args.
     */
    Config: AsyncSeriesWaterfallHook<[TConfig, TArgs], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs before start of any Run type.<br/>
     *
     * @usage Best place to subscribe on Run services hooks.
     *
     * @prop run - [Run](../run) constructed context.
     */
    BeforeAnyRun: AsyncSeriesHook<[TRun], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs after all entries processing.<br/>
     *
     * @usage Best place to emit additional assets on output fs.
     *
     * @prop run - [Run](../run) constructed context.
     */
    AfterAnyRun: AsyncSeriesHook<[TRun], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series **waterfall** hook which runs when current program fails with error.<br/>
     * If someone from handlers will return `undefined`, then error will be ignored.
     *
     * @usage Best place to handle uncaught program errors.<br/>
     *
     * @prop error - thrown error or undefined.
     */
    Error: AsyncSeriesWaterfallHook<[unknown], import("tapable").UnsetAdditionalOptions>;
};
declare const withHooks: <T extends ClassType<any>>(Target: T, { kind }: ClassDecoratorContext<abstract new (...args: any) => any>) => T;
declare function getHooks<TRun extends Run = Run, TProgram extends BaseProgram = BaseProgram>(holder: TProgram): {
    Command: SyncHook<[Command, ExtendedOption[]], void, import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs when current program config
     * was completely resolved but not merged with args.<br/>
     * **Config can't be modified here.**
     *
     * @usage Best place to validate that config doesn't store any secret data.
     *
     * @prop config - completely built config specified for current program.
     * @prop args - program call args.
     */
    RawConfig: AsyncSeriesHook<[DeepFrozen<TConfig<TProgram>>, TArgs<TProgram>], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series **waterfall** hook which runs when current program config
     * was completely resolved and merged with args.<br/>
     * **Config can be modified here.**
     *
     * @usage Best place to normalize final config data.<br/>
     *
     * @prop config - completely built config specified for current program.
     * @prop args - previously merged to config program call args.
     */
    Config: AsyncSeriesWaterfallHook<[TConfig<TProgram>, TArgs<TProgram>], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs before start of any Run type.<br/>
     *
     * @usage Best place to subscribe on Run services hooks.
     *
     * @prop run - [Run](../run) constructed context.
     */
    BeforeAnyRun: AsyncSeriesHook<[TRun], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series hook which runs after all entries processing.<br/>
     *
     * @usage Best place to emit additional assets on output fs.
     *
     * @prop run - [Run](../run) constructed context.
     */
    AfterAnyRun: AsyncSeriesHook<[TRun], import("tapable").UnsetAdditionalOptions>;
    /**
     * Async series **waterfall** hook which runs when current program fails with error.<br/>
     * If someone from handlers will return `undefined`, then error will be ignored.
     *
     * @usage Best place to handle uncaught program errors.<br/>
     *
     * @prop error - thrown error or undefined.
     */
    Error: AsyncSeriesWaterfallHook<[unknown], import("tapable").UnsetAdditionalOptions>;
};
export { getHooks, withHooks };
