/** * Copyright (c) 2017-present A. Matías Quezada */ /** * Decorates a promise-returning-function to cache the last returned value. * The returned function will have a `cached` method which will return the * value used to fulfill the last successful call. * * @example * getServerStatus = syncVersion(getServerStatus); * getServerStatus() * // later... * // if the promise has been fulfilled this will return the value * getServerStatus.cached() * * @param {Function} fn Function to decorate. * @returns {Function} Decorated function */ export default function syncVersion(fn: (...args: any[]) => Promise): ICached; export declare type ICached Promise, U> = T & { cached(): U; };