UNPKG

2.62 kBTypeScriptView Raw
1import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId";
2import { ProjectPersister } from "@atomist/automation-client/lib/operations/generate/generatorUtils";
3import { RepoCreationParameters } from "@atomist/automation-client/lib/operations/generate/RepoCreationParameters";
4import { SeedDrivenGeneratorParameters } from "@atomist/automation-client/lib/operations/generate/SeedDrivenGeneratorParameters";
5import { Project } from "@atomist/automation-client/lib/project/Project";
6import { NoParameters } from "@atomist/automation-client/lib/SmartParameters";
7import { Maker } from "@atomist/automation-client/lib/util/constructionUtils";
8import { CommandListenerInvocation } from "../listener/CommandListener";
9import { ParametersInvocation } from "../listener/ParametersInvocation";
10import { ProjectOperationRegistration } from "./ProjectOperationRegistration";
11/**
12 * Starting point before transformation. Normally the coordinates of a
13 * seed project, but can also be an in memory project or a function that
14 * computes a RemoteRepoRef or Project from the parameters.
15 */
16export declare type StartingPoint<PARAMS> = Project | RemoteRepoRef | ((pi: PARAMS & CommandListenerInvocation<PARAMS>) => (RemoteRepoRef | Project | Promise<Project>));
17/**
18 * Action that executes after the project has been generated and pushed
19 * to the remote repository.
20 */
21export declare type ProjectAction<PARAMS> = (p: Project, pi: PARAMS & ParametersInvocation<PARAMS>) => Promise<void>;
22/**
23 * Register a project creation operation
24 */
25export interface GeneratorRegistration<PARAMS = NoParameters> extends ProjectOperationRegistration<PARAMS, SeedDrivenGeneratorParameters> {
26 /**
27 * Starting point before transformation. Normally the coordinates of a
28 * seed project, but can also be in memory.
29 * The alternative is to get this from a config object.
30 */
31 startingPoint?: StartingPoint<PARAMS>;
32 /**
33 * Strategy for persisting projects. Useful in testing.
34 */
35 projectPersister?: ProjectPersister;
36 /**
37 * Allow customization of the target for this repo,
38 * e.g. to target a different source control system.
39 */
40 fallbackTarget?: Maker<RepoCreationParameters>;
41 /**
42 * Hooks that get executed after a successful project generation.
43 * Note: these hooks fire after the project has been generated and
44 * pushed to the remote repository.
45 */
46 afterAction?: ProjectAction<PARAMS & SeedDrivenGeneratorParameters> | Array<ProjectAction<PARAMS & SeedDrivenGeneratorParameters>>;
47}
48//# sourceMappingURL=GeneratorRegistration.d.ts.map
\No newline at end of file