UNPKG

1.76 kBTypeScriptView Raw
1import { Goals } from "../goal/Goals";
2import { PushListenerInvocation } from "../listener/PushListener";
3import { PushTest } from "../mapping/PushTest";
4import { PredicateMappingTerm } from "../mapping/support/PredicateMappingTerm";
5import { PushRule } from "../mapping/support/PushRule";
6import { GoalComponent } from "./GoalComponent";
7/**
8 * PushRule implementation exposed in DSL. Continues fluent API.
9 */
10export declare class GoalSetterMapping<P extends PushListenerInvocation = PushListenerInvocation> extends PushRule<Goals> {
11 private goalsName;
12 get label(): string;
13 constructor(guard1: PushTest, guards: PushTest[], reason?: string);
14 setGoals(goalComponent: GoalComponent): this;
15 /**
16 * Set goals dynamically, depending on this push
17 * @param {(inv: P) => GoalComponent} f
18 * @return {this}
19 */
20 setGoalsWhen(f: (inv: P) => GoalComponent | Promise<GoalComponent>): this;
21 /**
22 * Prevent setting any further goals on this push. Ordering matters:
23 * goals may previously have been set.
24 * @param name name of the empty Goals. Default is "No Goals"
25 */
26 setNoMoreGoals(name?: string): void;
27}
28/**
29 * Simple GoalSetter DSL. Allows use of booleans and functions
30 * returning boolean in predicate expressions
31 * @param {PushTest} guard1
32 * @param {PushTest} guards
33 */
34export declare function whenPushSatisfies<P extends PushListenerInvocation = PushListenerInvocation>(guard1: PredicateMappingTerm<P>, ...guards: Array<PredicateMappingTerm<P>>): GoalSetterMapping<P>;
35/**
36 * PushRule that matches every push
37 * @type {GoalSetterMapping}
38 */
39export declare function onAnyPush<P extends PushListenerInvocation = PushListenerInvocation>(): GoalSetterMapping<P>;
40//# sourceMappingURL=goalDsl.d.ts.map
\No newline at end of file