UNPKG

2.02 kBTypeScriptView Raw
1import { EditMode } from "@atomist/automation-client/lib/operations/edit/editModes";
2import { Project } from "@atomist/automation-client/lib/project/Project";
3import { NoParameters } from "@atomist/automation-client/lib/SmartParameters";
4import { TransformResult } from "./CodeTransform";
5import { ProjectOperationRegistration } from "./ProjectOperationRegistration";
6import { ProjectsOperationRegistration } from "./ProjectsOperationRegistration";
7import { PushAwareParametersInvocation } from "./PushAwareParametersInvocation";
8/**
9 * Signature to create an EditMode out of a PushAwareParametersInvocation and Project.
10 */
11export declare type TransformPresentation<PARAMS> = (papi: PushAwareParametersInvocation<PARAMS>, p: Project) => EditMode;
12/**
13 * Type for registering a project transform, which can make changes
14 * across projects
15 */
16export interface CodeTransformRegistration<PARAMS = NoParameters> extends ProjectOperationRegistration<PARAMS>, ProjectsOperationRegistration<PARAMS> {
17 /**
18 * How to present the transformation - would you like a Pull Request or a branch commit?
19 * What would you like in the commit message, or the title of the pull request?
20 * All these and more can be specified in the EditMode, which this function can
21 * choose based on the invocation of this command and the code itself.
22 *
23 * This defaults to a pull request with branch name derived from the transform name.
24 */
25 transformPresentation?: TransformPresentation<PARAMS>;
26 /**
27 * React to results from running transform across one or more projects
28 */
29 onTransformResults?(results: TransformResult[], ci: PushAwareParametersInvocation<PARAMS>): Promise<void>;
30}
31/**
32 * Signature of a decorator function that can add additional behavior
33 * to a CodeTransformRegistration.
34 */
35export declare type CodeTransformRegistrationDecorator<PARAMS> = (ctr: CodeTransformRegistration<PARAMS>) => CodeTransformRegistration<PARAMS>;
36//# sourceMappingURL=CodeTransformRegistration.d.ts.map
\No newline at end of file