/** * Will add a method to the provided object which will store the last value * returned successfully by calling `method`. * The original method will be decorated, you can restore the original one by * calling `.restore()` property of that method. * Keep in mind that this will break the sync version. * * @example * addSyncMethod(server, 'getStatus', 'getStatusSync'); * server.getStatus(); * // Later... * // If `server.getStatus()` has ben fulfilled this will return the last successful value * server.getStatusSync() * * @param {Object} object Object to add the method to. * @param {String} method The original method to hook. * @returns {Object} The object passed as argument. */ export default function addSyncMethod(object: T, method: keyof T, name?: string): T;