#pragma warning disable CS1591 using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Plugins; using MediaBrowser.Model.Events; using MediaBrowser.Model.Updates; namespace MediaBrowser.Common.Updates { public interface IInstallationManager : IDisposable { event EventHandler PackageInstalling; event EventHandler PackageInstallationCompleted; event EventHandler PackageInstallationFailed; event EventHandler PackageInstallationCancelled; /// /// Occurs when a plugin is uninstalled. /// event EventHandler PluginUninstalled; /// /// Occurs when a plugin is updated. /// event EventHandler PluginUpdated; /// /// Occurs when a plugin is installed. /// event EventHandler PluginInstalled; /// /// Gets the completed installations. /// IEnumerable CompletedInstallations { get; } /// /// Parses a plugin manifest at the supplied URL. /// /// The URL to query. /// The cancellation token. /// Task{IReadOnlyList{PackageInfo}}. Task> GetPackages(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. /// All plugins matching the requirements. IEnumerable FilterPackages( IEnumerable availablePackages, string name = null, Guid guid = default); /// /// 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. /// All compatible versions ordered from newest to oldest. IEnumerable GetCompatibleVersions( IEnumerable availablePackages, string name = null, Guid guid = default, Version minVersion = 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); } }