using System;
using System.Collections.Generic;
using NuGet.Versioning;
using Velopack.Logging;
namespace Velopack.Locators
{
    /// 
    /// An interface describing where Velopack can find key folders and files.
    /// 
    public interface IVelopackLocator
    {
        ///  The unique application Id. This is used in various app paths. 
        string? AppId { get; }
        ///  
        /// The root directory of the application. On Windows, this folder contains all 
        /// the application files, but that may not be the case on other operating systems. 
        /// 
        string? RootAppDir { get; }
        ///  The directory in which nupkg files are stored for this application. 
        string? PackagesDir { get; }
        ///  The directory in which versioned application files are stored. 
        string? AppContentDir { get; }
        ///  The temporary directory for this application. 
        string? AppTempDir { get; }
        ///  The path to the current Update.exe or similar on other operating systems. 
        string? UpdateExePath { get; }
        ///  The currently installed version of the application, or null if the app is not installed. 
        SemanticVersion? CurrentlyInstalledVersion { get; }
        ///  The path from  to this executable. 
        string? ThisExeRelativePath { get; }
        ///  The release channel this package was built for. 
        string? Channel { get; }
        
        ///  The logging interface to use for Velopack diagnostic messages. 
        IVelopackLogger Log { get; }
        
        /// 
        /// A flag indicating if this is a portable build, and that the settings should be self-contained in the package.
        /// On Windows, this is true for portable builds, and false for non-portable builds which were installed by Setup.exe
        /// On OSX and Linux, this is always false, because settings and application files should be stored in the user's 
        /// home directory.
        /// 
        bool IsPortable { get; }
        
        /// 
        /// Provides an abstraction for dealing with the dotnet Process API. This is used to start processes and
        /// get information about the current process.
        /// 
        IProcessImpl Process { get; }
        
        /// 
        /// Finds .nupkg files in the PackagesDir and returns a list of ReleaseEntryName objects.
        /// 
        List GetLocalPackages();
        /// 
        /// Finds latest .nupkg file in the PackagesDir or null if not found.
        /// 
        VelopackAsset? GetLatestLocalFullPackage();
        /// 
        /// Unique identifier for this user which is used to calculate whether this user is eligible for 
        /// staged roll outs.
        /// 
        Guid? GetOrCreateStagedUserId();
    }
}