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