import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId";
import { NoParameters } from "@atomist/automation-client/lib/SmartParameters";
import { ParameterPromptOptions } from "../context/parameterPrompt";
import { ParametersDefinition } from "../registration/ParametersDefinition";
import { SdmListener } from "./Listener";
import { ParametersInvocation } from "./ParametersInvocation";
/**
 * Context for a command
 */
export interface CommandListenerInvocation<PARAMS = NoParameters> extends ParametersInvocation<PARAMS> {
    commandName: string;
    /**
     * The repos this command relates to, if available.
     */
    ids?: RemoteRepoRef[];
    /**
     * If the intent was a regular expression, the matches to the supplied intent are found here
     */
    matches?: RegExpExecArray;
    /**
     * Prompt for additional parameters needed during execution of the command listener.
     *
     * Callers should wait for the returned Promise to resolve. It will resolve with the requested
     * parameters if those have already been collected. If not, a parameter prompt request to the backend
     * will be sent and the Promise will reject. Once the new parameters are collected, a new
     * command invocation will be sent and the command listener will restart.
     *
     * This requires that any state that gets created before calling promptFor can be re-created when
     * re-entering the listener function. Also any action taken before calling promptFor needs to be
     * implemented using idempotency patterns.
     */
    promptFor<NEWPARAMS>(parameters: ParametersDefinition<NEWPARAMS>, options?: ParameterPromptOptions): Promise<NEWPARAMS>;
}
export declare type CommandListener<PARAMS = NoParameters> = SdmListener<CommandListenerInvocation<PARAMS>>;
//# sourceMappingURL=CommandListener.d.ts.map