UNPKG

1.3 kBTypeScriptView Raw
1import { Configuration } from "@atomist/automation-client/lib/configuration";
2import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent";
3import { SdmGoalKey } from "../../api/goal/SdmGoalMessage";
4export declare function mapKeyToGoal<T extends SdmGoalKey>(goals: T[]): (k: SdmGoalKey) => T;
5export declare function goalKeyEquals(a: SdmGoalKey, b: SdmGoalKey): boolean;
6export declare function goalKeyString(gk: SdmGoalKey): string;
7/**
8 * Read and parse goal event data. If the goal event has no data,
9 * return an empty object. Note: this purposely only works if the
10 * data field is stringified JSON.
11 *
12 * @param sdmGoal
13 * @return JSON parsed goal event data property
14 */
15export declare function goalData(sdmGoal: SdmGoalEvent): any;
16/**
17 * Return a shallow merge the provided `data` and the goal event data
18 * property, parsed as JSON. Properties in `data` take precedence
19 * over those in the parsed goal event data object.
20 *
21 * @param data
22 * @param sdmGoal
23 * @return shallow merge of data and SDM goal event data property
24 */
25export declare function mergeGoalData(data: any, sdmGoal: SdmGoalEvent): any;
26/**
27 * Return configured SDM goal timeout or default value, 10 minutes.
28 */
29export declare function sdmGoalTimeout(cfg?: Configuration): number;
30//# sourceMappingURL=sdmGoal.d.ts.map
\No newline at end of file