/** * Options for cache parsing. */ export type WPEnvCacheOptions = { /** * Path to the work directory located in ~/.wp-env. */ workDirectoryPath: string; }; /** * This function can be used to compare a possible new cache value against an * existing cache value. For example, we can use this to check if the configuration * has changed in a new run of wp-env start. * * @param {string} key A unique identifier for the cache. * @param {any} value The value to check against the existing cache. * @param {WPEnvCacheOptions} options Parsing options * * @return {boolean} If true, the value is different from the cache which exists. */ export function didCacheChange(key: string, value: any, options: WPEnvCacheOptions): boolean; /** * This function persists the given cache value to the cache file. It creates the * file if it does not exist yet, and overwrites the existing cache value for the * given key if it already exists. * * @param {string} key A unique identifier for the cache. * @param {any} value The value to persist. * @param {WPEnvCacheOptions} options Parsing options */ export function setCache(key: string, value: any, options: WPEnvCacheOptions): Promise; /** * This function retrieves the cache associated with the given key from the file. * Returns undefined if the key does not exist or if the cache file has not been * created yet. * * @param {string} key The unique identifier for the cache value. * @param {WPEnvCacheOptions} options Parsing options * * @return {any?} The cache value. Undefined if it has not been set or if the cache * file has not been created. */ export function getCache(key: string, options: WPEnvCacheOptions): any | null; /** * Returns the data stored in the cache file as a JS object. Instead of throwing * an error, simply returns an empty object if the file cannot be retrieved. * * @param {WPEnvCacheOptions} options Parsing options * * @return {Object} The data from the cache file. Empty if the file does not exist. */ export function getCacheFile({ workDirectoryPath }: WPEnvCacheOptions): Object;