@atomist/automation-client
Version:
Atomist API for software low-level client
33 lines • 1.76 kB
TypeScript
import { HandleCommand } from "../../HandleCommand";
import { OnCommand } from "../../onCommand";
import { Maker } from "../../util/constructionUtils";
import { CommandDetails } from "../CommandDetails";
import { BaseEditorOrReviewerParameters, EditorOrReviewerParameters } from "../common/params/BaseEditorOrReviewerParameters";
import { RepoFilter } from "../common/repoFilter";
import { EditMode } from "./editModes";
import { AnyProjectEditor } from "./projectEditor";
/**
* Either directly return an EditMode or a factory to return one from the context
*/
export declare type EditModeOrFactory<PARAMS> = EditMode | ((p: PARAMS) => EditMode);
/**
* Further details of an editor to allow selective customization
*/
export interface EditorCommandDetails<PARAMS = any> extends CommandDetails<PARAMS> {
editMode: EditModeOrFactory<PARAMS>;
repoFilter?: RepoFilter;
}
/**
* Create a handle function that edits one or many repos, following AllReposByDefaultParameters
* @param pe function returning a project editor instance appropriate for the parameters
* @param {string} name
* @param {string} details object allowing customization beyond reasonable defaults
* @return {HandleCommand}
*/
export declare function editorHandler<PARAMS extends EditorOrReviewerParameters>(pe: (params: PARAMS) => AnyProjectEditor, factory: Maker<PARAMS>, name: string, details?: Partial<EditorCommandDetails>): HandleCommand;
/**
* If owner and repo are required, edit just one repo. Otherwise edit all repos
* in the present team
*/
export declare function handleEditOneOrMany<PARAMS extends BaseEditorOrReviewerParameters>(pe: (params: PARAMS) => AnyProjectEditor, details: EditorCommandDetails): OnCommand<PARAMS>;
//# sourceMappingURL=editorToCommand.d.ts.map