import ClientResponse from '~/Contracts/ClientResponse'; import GuardInterface from '~/Contracts/Guard'; import Products from '~/Contracts/Products'; import Recommendation from '~/Contracts/Recommendation'; import Storage from '~/Storage'; import Trending from '~/Trending'; abstract class Guard implements GuardInterface { /** * * * @type {Products} */ protected products!: Products; /** * * * @type {Storage} */ protected storage!: Storage; /** * * * @param {Products} products * @param {Storage} storage * @return {Promise} */ public boot(products: Products, storage: Storage) { this.products = products; this.storage = storage; return this; } /** * * * @param {ClientResponse} response * @return {boolean} */ public abstract check(response: ClientResponse): boolean; /** * * * @param {Recommendation} recommendation * @return {Trending | null} */ public abstract contingency(recommendation: Recommendation): Trending | null; /** * * * @return {boolean} */ public abstract retry(): boolean; } export default Guard;