UNPKG

@atomist/sdm

Version:

Atomist Software Delivery Machine SDK

36 lines 2.02 kB
import { EditMode } from "@atomist/automation-client/lib/operations/edit/editModes"; import { Project } from "@atomist/automation-client/lib/project/Project"; import { NoParameters } from "@atomist/automation-client/lib/SmartParameters"; import { TransformResult } from "./CodeTransform"; import { ProjectOperationRegistration } from "./ProjectOperationRegistration"; import { ProjectsOperationRegistration } from "./ProjectsOperationRegistration"; import { PushAwareParametersInvocation } from "./PushAwareParametersInvocation"; /** * Signature to create an EditMode out of a PushAwareParametersInvocation and Project. */ export declare type TransformPresentation<PARAMS> = (papi: PushAwareParametersInvocation<PARAMS>, p: Project) => EditMode; /** * Type for registering a project transform, which can make changes * across projects */ export interface CodeTransformRegistration<PARAMS = NoParameters> extends ProjectOperationRegistration<PARAMS>, ProjectsOperationRegistration<PARAMS> { /** * How to present the transformation - would you like a Pull Request or a branch commit? * What would you like in the commit message, or the title of the pull request? * All these and more can be specified in the EditMode, which this function can * choose based on the invocation of this command and the code itself. * * This defaults to a pull request with branch name derived from the transform name. */ transformPresentation?: TransformPresentation<PARAMS>; /** * React to results from running transform across one or more projects */ onTransformResults?(results: TransformResult[], ci: PushAwareParametersInvocation<PARAMS>): Promise<void>; } /** * Signature of a decorator function that can add additional behavior * to a CodeTransformRegistration. */ export declare type CodeTransformRegistrationDecorator<PARAMS> = (ctr: CodeTransformRegistration<PARAMS>) => CodeTransformRegistration<PARAMS>; //# sourceMappingURL=CodeTransformRegistration.d.ts.map