UNPKG

1.28 kBTypeScriptView Raw
1import { Project } from "@atomist/automation-client/lib/project/Project";
2import { StatefulPushListenerInvocation } from "../dsl/goalContribution";
3import { PredicateMapping } from "./PredicateMapping";
4/**
5 * Special PushMapping. Return true if we like this push. Used in goal setting etc.
6 */
7export interface PushTest extends PredicateMapping<StatefulPushListenerInvocation> {
8}
9/**
10 * Test against a project
11 */
12export declare type ProjectPredicate = (p: Project) => Promise<boolean>;
13/**
14 * Convenient factory function for PushTest instances
15 * @param {string} name
16 * @param mapping test function
17 * @return {PushTest}
18 */
19export declare function pushTest(name: string, mapping: (p: StatefulPushListenerInvocation) => Promise<boolean>): PushTest;
20/**
21 * PushTest that also exposes the ProjectPredicate it is
22 * based on
23 */
24export interface PredicatePushTest extends PushTest {
25 predicate: ProjectPredicate;
26}
27/**
28 * Convenient factory function for PushTest instances based on project predicates.
29 * Also exposes project predicate
30 * @param {string} name
31 * @param predicate test function for projects
32 * @return {PushTest}
33 */
34export declare function predicatePushTest(name: string, predicate: ProjectPredicate): PredicatePushTest;
35//# sourceMappingURL=PushTest.d.ts.map
\No newline at end of file