using DeepDrftContent.Services.FileDatabase.Models; using IndexType = DeepDrftContent.Services.FileDatabase.Services.IndexType; namespace DeepDrftContent.Services.FileDatabase.Abstractions; /// /// Interface for creating index instances /// public interface IIndexFactory { /// /// Loads an existing index of the specified type /// Task LoadIndexAsync(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(IndexType type, IIndex index); /// /// Creates index instance from data /// IIndex CreateIndexFromData(IndexType type, object indexData); }