using DeepDrftContent.FileDatabase.Models;
using IndexType = DeepDrftContent.FileDatabase.Services.IndexType;
using Services_IndexType = DeepDrftContent.FileDatabase.Services.IndexType;
namespace DeepDrftContent.FileDatabase.Abstractions;
///
/// Interface for creating index instances
///
public interface IIndexFactory
{
///
/// Loads an existing index of the specified type
///
Task LoadIndexAsync(Services_IndexType type, string rootPath);
///
/// Creates a directory index
///
Task CreateDirectoryIndexAsync(string rootPath);
///
/// Loads existing directory index or creates new one if loading fails
///
Task LoadOrCreateDirectoryIndexAsync(string rootPath);
///
/// Creates a vault index with the specified vault type
///
Task CreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
///
/// Loads existing vault index or creates new one with the specified vault type if loading fails
///
Task LoadOrCreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
}
///
/// Interface for creating index data objects
///
public interface IIndexDataFactory
{
///
/// Creates index data for serialization
///
object CreateIndexData(Services_IndexType type, IIndex index);
///
/// Creates index instance from data
///
IIndex CreateIndexFromData(Services_IndexType type, object indexData);
}