@atomist/sdm
Version:
Atomist Software Delivery Machine SDK
35 lines • 1.28 kB
TypeScript
import { Project } from "@atomist/automation-client/lib/project/Project";
import { StatefulPushListenerInvocation } from "../dsl/goalContribution";
import { PredicateMapping } from "./PredicateMapping";
/**
* Special PushMapping. Return true if we like this push. Used in goal setting etc.
*/
export interface PushTest extends PredicateMapping<StatefulPushListenerInvocation> {
}
/**
* Test against a project
*/
export declare type ProjectPredicate = (p: Project) => Promise<boolean>;
/**
* Convenient factory function for PushTest instances
* @param {string} name
* @param mapping test function
* @return {PushTest}
*/
export declare function pushTest(name: string, mapping: (p: StatefulPushListenerInvocation) => Promise<boolean>): PushTest;
/**
* PushTest that also exposes the ProjectPredicate it is
* based on
*/
export interface PredicatePushTest extends PushTest {
predicate: ProjectPredicate;
}
/**
* Convenient factory function for PushTest instances based on project predicates.
* Also exposes project predicate
* @param {string} name
* @param predicate test function for projects
* @return {PushTest}
*/
export declare function predicatePushTest(name: string, predicate: ProjectPredicate): PredicatePushTest;
//# sourceMappingURL=PushTest.d.ts.map