@atomist/sdm
Version:
Atomist Software Delivery Machine SDK
33 lines • 1.35 kB
TypeScript
import { PushListenerInvocation } from "../../listener/PushListener";
import { GoalSettingCompositionStyle, GoalSettingStructure } from "../GoalSetter";
import { PushMapping } from "../PushMapping";
/**
* Use to execute a rule set for any push to resolve to an object.
* The value from the first matching rule will be used.
*/
export declare class PushRules<V> implements PushMapping<V>, GoalSettingStructure<PushListenerInvocation, V> {
readonly name: string;
private readonly rules;
choices: Array<PushMapping<V>>;
get structure(): {
components: Array<PushMapping<V>>;
compositionStyle: GoalSettingCompositionStyle;
};
/**
* Return all possible values
* @param {string} name
* @param {Array<PushMapping<V>>} rules Array of rules.
* Passing an empty array will result in an instance that always maps to undefined,
* and is not an error.
*/
constructor(name: string, rules?: Array<PushMapping<V>>);
/**
* Return a PushRules with a subset of the rules of this one
* @param {(p: PushMapping<V>) => boolean} predicate
* @return {PushRules<V>}
*/
filter(predicate: (p: PushMapping<V>) => boolean): PushRules<V>;
add(rules: Array<PushMapping<V>>): void;
mapping(pi: PushListenerInvocation): Promise<V>;
}
//# sourceMappingURL=PushRules.d.ts.map