import Promise = require("bluebird"); import { AbstractAction } from "./AbstractAction"; /** * This is simply a wrapper for the AbstractAction that allows to to wrap * the .execute() function in a promise. This is useful when we which to interpret any callback * errors. * */ export declare abstract class AbstractPromiseAction extends AbstractAction { protected returnValue: ReturnType; protected _resolve: (value?: ReturnType) => void; protected _reject: (error?: any) => void; /** * Returns the action as a promise using the ReturnType as specified by the subclass. * * Do *not* use this in conjunction with `execute()`. * * @returns {Promise|Promise} */ asPromise(): Promise; /** * We override the doAfterExecute(..) function in order to reject or resolve the promise * * @param err */ protected doAfterExecute(err?: Error): void; }