using System;
using StardewModdingAPI.Toolkit.Framework.UpdateData;
using StardewModdingAPI.Web.Framework.ModRepositories;
namespace StardewModdingAPI.Web.Framework.Caching.Mods
{
/// Encapsulates logic for accessing the mod data cache.
internal interface IModCacheRepository : ICacheRepository
{
/*********
** Methods
*********/
/// Get the cached mod data.
/// The mod site to search.
/// The mod's unique ID within the .
/// The fetched mod.
/// Whether to update the mod's 'last requested' date.
bool TryGetMod(ModRepositoryKey site, string id, out CachedMod mod, bool markRequested = true);
/// Save data fetched for a mod.
/// The mod site on which the mod is found.
/// The mod's unique ID within the .
/// The mod data.
/// The stored mod record.
void SaveMod(ModRepositoryKey site, string id, ModInfoModel mod, out CachedMod cachedMod);
/// Delete data for mods which haven't been requested within a given time limit.
/// The minimum age for which to remove mods.
void RemoveStaleMods(TimeSpan age);
}
}