UNPKG

2.02 kBTypeScriptView Raw
1import { ExecuteGoal, GoalInvocation } from "../../api/goal/GoalInvocation";
2import { ReportProgress } from "../../api/goal/progress/ReportProgress";
3import { AutofixRegistration } from "../../api/registration/AutofixRegistration";
4import { TransformPresentation } from "../../api/registration/CodeTransformRegistration";
5import { ProgressTest } from "../goal/progress/progress";
6/**
7 * Parameters that includes the current GoalInvocation
8 */
9export interface GoalInvocationParameters {
10 /** Current goal invocation the autofixes are running */
11 goalInvocation: GoalInvocation;
12}
13/**
14 * Execute autofixes against this push
15 * Throw an error on failure
16 * @param {AutofixRegistration[]} registrations
17 * @return ExecuteGoal
18 */
19export declare function executeAutofixes(registrations: AutofixRegistration[], transformPresentation?: TransformPresentation<GoalInvocationParameters>, extractAuthor?: ExtractAuthor): ExecuteGoal;
20/**
21 * Filter any provided autofixes whose results were included in the commits of the current push.
22 * @param {AutofixRegistration[]} autofixes
23 * @param {GoalInvocation} gi
24 * @returns {AutofixRegistration[]}
25 */
26export declare function filterImmediateAutofixes(autofixes: AutofixRegistration[], gi: GoalInvocation): AutofixRegistration[];
27/**
28 * Generate a commit message for the provided autofix.
29 * @param {AutofixRegistration} autofix
30 * @returns {string}
31 */
32export declare function generateCommitMessageForAutofix(autofix: AutofixRegistration): string;
33export declare const AutofixProgressTests: ProgressTest[];
34/**
35 * Default ReportProgress for running autofixes
36 */
37export declare const AutofixProgressReporter: ReportProgress;
38/**
39 * Extract author information from the current goal invocation
40 */
41export declare type ExtractAuthor = (gi: GoalInvocation) => Promise<{
42 name: string;
43 email: string;
44} | undefined>;
45export declare const NoOpExtractAuthor: ExtractAuthor;
46export declare const DefaultExtractAuthor: ExtractAuthor;
47//# sourceMappingURL=executeAutofixes.d.ts.map
\No newline at end of file