UNPKG

1.34 kBTypeScriptView Raw
1import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
2import { ProjectOperationCredentials } from "@atomist/automation-client/lib/operations/common/ProjectOperationCredentials";
3import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId";
4import { GitProject } from "@atomist/automation-client/lib/project/git/GitProject";
5import { CloneOptions } from "@atomist/automation-client/lib/spi/clone/DirectoryManager";
6/**
7 * Operation on loaded project
8 */
9export declare type WithLoadedProject<T = any> = (p: GitProject) => Promise<T>;
10export interface ProjectLoadingParameters {
11 credentials: ProjectOperationCredentials;
12 id: RemoteRepoRef;
13 cloneOptions?: CloneOptions;
14 context?: HandlerContext;
15 /** Return true to get optimized behavior for read only */
16 readOnly: boolean;
17 /**
18 * Explicitly configured target clone dir
19 */
20 cloneDir?: string;
21}
22/**
23 * Common interface for project loading that allows caching etc.
24 */
25export interface ProjectLoader {
26 /**
27 * Perform an action with the given project
28 * @param {ProjectLoadingParameters} params
29 * @param {WithLoadedProject<T>} action
30 */
31 doWithProject<T>(params: ProjectLoadingParameters, action: WithLoadedProject<T>): Promise<T>;
32}
33//# sourceMappingURL=ProjectLoader.d.ts.map
\No newline at end of file