using System; using System.Collections.Generic; using System.Linq.Expressions; using StardewModdingAPI.Toolkit.Framework.Clients.Wiki; namespace StardewModdingAPI.Web.Framework.Caching.Wiki { /// Encapsulates logic for accessing the mod data cache. internal interface IWikiCacheRepository { /********* ** Methods *********/ /// Get the cached wiki metadata. /// The fetched metadata. bool TryGetWikiMetadata(out CachedWikiMetadata metadata); /// Whether cached data is stale. /// The date when the data was updated. /// The age in minutes before data is considered stale. bool IsStale(DateTimeOffset lastUpdated, int cacheMinutes); /// Get the cached wiki mods. /// A filter to apply, if any. IEnumerable GetWikiMods(Expression> filter = null); /// Save data fetched from the wiki compatibility list. /// The current stable Stardew Valley version. /// The current beta Stardew Valley version. /// The mod data. /// The stored metadata record. /// The stored mod records. void SaveWikiData(string stableVersion, string betaVersion, IEnumerable mods, out CachedWikiMetadata cachedMetadata, out CachedWikiMod[] cachedMods); } }