using System.Collections.Generic;
using System.Threading.Tasks;
namespace Infrastructure.Configuration;
///
/// Interface for configuration providers
///
public interface IConfigurationProvider
{
///
/// Checks if a configuration file exists.
///
bool FileExists(string fileName);
///
/// Reads a configuration from storage asynchronously. Returns a default instance if the configuration doesn't exist.
///
Task ReadConfigurationAsync(string fileName) where T : class, new();
///
/// Reads a configuration from storage synchronously. Returns a default instance if the configuration doesn't exist.
///
T ReadConfiguration(string fileName) where T : class, new();
///
/// Writes a configuration to storage asynchronously
///
Task WriteConfigurationAsync(string fileName, T configuration) where T : class;
///
/// Writes a configuration to storage synchronously
///
bool WriteConfiguration(string fileName, T configuration) where T : class;
///
/// Updates a specific property in a configuration asynchronously
///
Task UpdateConfigurationPropertyAsync(string fileName, string propertyPath, T value);
///
/// Updates a specific property in a configuration synchronously
///
bool UpdateConfigurationProperty(string fileName, string propertyPath, T value);
///
/// Merges configuration values asynchronously
///
Task MergeConfigurationAsync(string fileName, T newValues) where T : class;
///
/// Merges configuration values synchronously
///
bool MergeConfiguration(string fileName, T newValues) where T : class;
///
/// Deletes a configuration asynchronously
///
Task DeleteConfigurationAsync(string fileName);
///
/// Deletes a configuration synchronously
///
bool DeleteConfiguration(string fileName);
///
/// Lists all available configuration files
///
IEnumerable ListConfigurationFiles();
}