UNPKG

1.55 kBTypeScriptView Raw
1import { HandleCommand } from "../../HandleCommand";
2import { HandlerContext } from "../../HandlerContext";
3import { Maker } from "../../util/constructionUtils";
4import { CommandDetails } from "../CommandDetails";
5import { ProjectAction } from "../common/projectAction";
6import { RepoRef } from "../common/RepoId";
7import { AnyProjectEditor } from "../edit/projectEditor";
8import { ProjectPersister } from "./generatorUtils";
9import { SeedDrivenGeneratorParameters } from "./SeedDrivenGeneratorParameters";
10export declare type EditorFactory<P> = (params: P, ctx: HandlerContext) => AnyProjectEditor<P>;
11/**
12 * Further details of a generator to allow selective customization
13 */
14export interface GeneratorCommandDetails<P extends SeedDrivenGeneratorParameters> extends CommandDetails {
15 redirecter: (r: RepoRef) => string;
16 projectPersister?: ProjectPersister;
17 afterAction?: ProjectAction<P>;
18}
19/**
20 * Create a generator function wrapping the given transform
21 *
22 * DEPRECATED: use the one in @atomist/sdm
23 *
24 * @param {AnyProjectEditor} editorFactory editor for the transformation
25 * @param factory construction function
26 * @param {string} name name of the generator
27 * @param {string} details object allowing customization beyond reasonable defaults
28 * @return {HandleCommand}
29 */
30export declare function generatorHandler<P extends SeedDrivenGeneratorParameters>(editorFactory: EditorFactory<P>, factory: Maker<P>, name: string, details?: Partial<GeneratorCommandDetails<P>>): HandleCommand;
31//# sourceMappingURL=generatorToCommand.d.ts.map
\No newline at end of file