import { AsyncParallelHook, AsyncSeriesHook, HookMap } from 'tapable';
import type { CommandLineParameter } from '@rushstack/ts-command-line';
import type { ITelemetryData } from '../logic/Telemetry';
import type { PhasedCommandHooks } from './PhasedCommandHooks';
import type { Subspace } from '../api/Subspace';
/**
 * Information about the currently executing command provided to plugins.
 * @beta
 */
export interface IRushCommand {
    /**
     * The name of this command, as seen on the command line
     */
    readonly actionName: string;
}
/**
 * Information about the currently executing global script command (as defined in command-line.json) provided to plugins.
 * @beta
 */
export interface IGlobalCommand extends IRushCommand {
    /**
     * Get a parameter by its long name (e.g. "--output-path") that was defined in command-line.json for this command.
     * If the parameter was not defined or not provided on the command line, this will throw.
     */
    getCustomParametersByLongName<TParameter extends CommandLineParameter>(longName: string): TParameter;
    /**
     * Call this from a plugin hook to indicate that the command has been fully handled
     * by the plugin. When set, the default shell command execution will be skipped.
     */
    setHandled(): void;
}
/**
 * Information about the currently executing phased script command (as defined in command-line.json, or default "build" or "rebuild") provided to plugins.
 * @beta
 */
export interface IPhasedCommand extends IRushCommand {
    /**
     * Hooks into the execution of the current phased command
     * @alpha
     */
    readonly hooks: PhasedCommandHooks;
    /**
     * An abort controller that can be used to abort the command.
     * Long-lived plugins should listen to the signal to handle any cleanup logic.
     * @alpha
     */
    readonly sessionAbortController: AbortController;
}
/**
 * Hooks into the lifecycle of the Rush process invocation that plugins may tap into.
 *
 * @beta
 */
export declare class RushLifecycleHooks {
    /**
     * The hook to run before executing any Rush CLI Command.
     */
    readonly initialize: AsyncSeriesHook<IRushCommand>;
    /**
     * The hook to run before executing any global Rush CLI Command (defined in command-line.json).
     */
    readonly runAnyGlobalCustomCommand: AsyncSeriesHook<IGlobalCommand>;
    /**
     * A hook map to allow plugins to hook specific named global commands (defined in command-line.json) before execution.
     */
    readonly runGlobalCustomCommand: HookMap<AsyncSeriesHook<IGlobalCommand>>;
    /**
     * The hook to run before executing any phased Rush CLI Command (defined in command-line.json, or the default "build" or "rebuild").
     */
    readonly runAnyPhasedCommand: AsyncSeriesHook<IPhasedCommand>;
    /**
     * A hook map to allow plugins to hook specific named phased commands (defined in command-line.json) before execution.
     */
    readonly runPhasedCommand: HookMap<AsyncSeriesHook<IPhasedCommand>>;
    /**
     * The hook to run between preparing the common/temp folder and invoking the package manager during "rush install" or "rush update".
     */
    readonly beforeInstall: AsyncSeriesHook<[
        command: IRushCommand,
        subspace: Subspace,
        variant: string | undefined
    ]>;
    /**
     * The hook to run after a successful install.
     */
    readonly afterInstall: AsyncSeriesHook<[
        command: IRushCommand,
        subspace: Subspace,
        variant: string | undefined
    ]>;
    /**
     * A hook to allow plugins to hook custom logic to process telemetry data.
     */
    readonly flushTelemetry: AsyncParallelHook<[ReadonlyArray<ITelemetryData>]>;
}
//# sourceMappingURL=RushLifeCycle.d.ts.map