import { AnchorOptionsInterface } from "./anchor-options.interface"; import { Promise as p } from "es6-promise"; import { PageCourierData } from "../page-courier/page-courier-data"; /** * @description * A Utility class that manages caching for us. * It used the CachingFacadeInterface of iizuna. */ export declare abstract class PageCacheUtility { /** * @description * This variable is used to check if a page load is currently in progress. * @type {boolean} */ private static currentlyLoading; /** * @description * The queue contains all pages that should be loaded one by one. * The array is sorted by request ordering. * @type {Array} */ private static queue; /** * @description * Returns the caching facade with the currently highest priority * @return {CachingFacadeInterface} */ private static getCachingFacade; /** * @description * Either returns the stored document or: * - null if the url was not found in the cache * - null if the file in the cache is now invalid for caching -> cache should be refreshed * @param {string} url * @return {Promise} */ static getDataForUrl(url: string): p; /** * @description * Stores the passed target into the cache if the document is valid for caching * @param {string} url * @param {PageCourierData} targetContent * @return {Promise} */ static setDataForUrl(url: string, targetContent: PageCourierData): p; /** * @description * Adds a AnchorOptionsInterface into the queue and then pulls the item if no queue-request is already in progress * @param {AnchorOptionsInterface} options * @return {Promise} */ static queueAutomaticPageLoad(options: AnchorOptionsInterface): p; /** * @description * Loads the next item of the queue (if not empty) and then calls itself * @return {Promise} */ private static loadNextQueueItem; }