#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Updates;
namespace MediaBrowser.Common.Updates
{
public interface IInstallationManager : IDisposable
{
///
/// Gets the completed installations.
///
IEnumerable CompletedInstallations { get; }
///
/// Parses a plugin manifest at the supplied URL.
///
/// Name of the repository.
/// The URL to query.
/// The cancellation token.
/// Task{IReadOnlyList{PackageInfo}}.
Task> GetPackages(string manifestName, string manifest, CancellationToken cancellationToken = default);
///
/// Gets all available packages.
///
/// The cancellation token.
/// Task{IReadOnlyList{PackageInfo}}.
Task> GetAvailablePackages(CancellationToken cancellationToken = default);
///
/// Returns all plugins matching the requirements.
///
/// The available packages.
/// The name of the plugin.
/// The id of the plugin.
/// The version of the plugin.
/// All plugins matching the requirements.
IEnumerable FilterPackages(
IEnumerable availablePackages,
string name = null,
Guid guid = default,
Version specificVersion = null);
///
/// Returns all compatible versions ordered from newest to oldest.
///
/// The available packages.
/// The name.
/// The guid of the plugin.
/// The minimum required version of the plugin.
/// The specific version of the plugin to install.
/// All compatible versions ordered from newest to oldest.
IEnumerable GetCompatibleVersions(
IEnumerable availablePackages,
string name = null,
Guid guid = default,
Version minVersion = null,
Version specificVersion = null);
///
/// Returns the available plugin updates.
///
/// The cancellation token.
/// The available plugin updates.
Task> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
///
/// Installs the package.
///
/// The package.
/// The cancellation token.
/// .
Task InstallPackage(InstallationInfo package, CancellationToken cancellationToken = default);
///
/// Uninstalls a plugin.
///
/// The plugin.
void UninstallPlugin(IPlugin plugin);
///
/// Cancels the installation.
///
/// The id of the package that is being installed.
/// Returns true if the install was cancelled.
bool CancelInstallation(Guid id);
}
}