UNPKG

1.29 kBTypeScriptView Raw
1import { SdmContext } from "../context/SdmContext";
2import { Goals } from "../goal/Goals";
3import { PushListenerInvocation } from "../listener/PushListener";
4import { Mapping } from "./Mapping";
5/**
6 * A GoalSetter decides what goals to run depending on repo contents and characteristics
7 * of the push. It is fundamental to determining the flow after the push:
8 * for example: do we want to run a code scan?; do we want to build?; do
9 * we want to deploy?
10 * @returns Goals or undefined if it doesn't like the push or
11 * understand the repo
12 */
13export declare type GoalSetter<F extends SdmContext = PushListenerInvocation> = Mapping<F, Goals>;
14export declare enum GoalSettingCompositionStyle {
15 FirstMatch = "take the first one",
16 AllMatches = "take all the ones that match"
17}
18/**
19 * Some (composed) mappings contain information about their internal structure.
20 *
21 * It only extends Mapping<F,V> because it's expected to apply only to those
22 */
23export interface GoalSettingStructure<F, V> extends Mapping<F, V> {
24 structure: {
25 compositionStyle: GoalSettingCompositionStyle;
26 components: Array<Mapping<F, V>>;
27 };
28}
29export declare function hasGoalSettingStructure<F, V>(m: Mapping<F, V>): m is GoalSettingStructure<F, V>;
30//# sourceMappingURL=GoalSetter.d.ts.map
\No newline at end of file