@atomist/automation-client
Version:
Atomist API for software low-level client
29 lines • 1.01 kB
TypeScript
/**
* Result of running an action, optionally on a target.
* Instances may add further information beyond boolean success or failure.
* Useful when promise chaining, to allow results to be included along with the target.
*/
export interface ActionResult<T = undefined> {
/**
* Target on which we ran the action, if there is one.
*/
readonly target: T;
/**
* Whether or not the action succeeded.
*/
readonly success: boolean;
readonly error?: Error;
readonly errorStep?: string;
}
export declare function isActionResult(a: any): a is ActionResult;
/**
* Convenient implementation of ActionResult
*/
export declare class SimpleActionResult<T> implements ActionResult<T> {
readonly target: T;
readonly success: boolean;
constructor(target: T, success: boolean);
}
export declare function successOn<T>(t: T): ActionResult<T>;
export declare function failureOn<T>(t: T, err: Error, f?: any): ActionResult<T>;
//# sourceMappingURL=ActionResult.d.ts.map