/** * 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 { /** Target on which we ran the action, if there is one. */ readonly target: T; /** Whether or not the action succeeded. */ readonly success: boolean; /** Error that occurred, if any */ readonly error?: Error; /** Description of step that errored, if one did. */ readonly errorStep?: string; } /** Test if an object is an ActionResult */ export declare function isActionResult(a: any): a is ActionResult; /** * @deprecated * Convenient implementation of ActionResult */ export declare class SimpleActionResult implements ActionResult { readonly target: T; readonly success: boolean; constructor(target: T, success: boolean); } /** * Helper to create a successful ActionResult object. * * @param t Target for action * @return {ActionResult} with success: true */ export declare function successOn(t: T): ActionResult; /** * Helper to create a failed ActionResult object. * * @param t Target for action * @param err Error that occurred. * @param f Function that failed, should have a name property. * @return {ActionResult} with success: true */ export declare function failureOn(t: T, err: Error, f?: any): ActionResult; //# sourceMappingURL=ActionResult.d.ts.map