#pragma warning disable CS1591 #pragma warning disable SA1600 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; } /// /// 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 version of the plugin. /// The minimum required version of the plugin. /// The classification of updates. /// All compatible versions ordered from newest to oldest. IEnumerable GetCompatibleVersions( IEnumerable availableVersions, Version minVersion = null, ReleaseChannel releaseChannel = ReleaseChannel.Stable); /// /// 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 classification. /// All compatible versions ordered from newest to oldest. IEnumerable GetCompatibleVersions( IEnumerable availablePackages, string name = null, Guid guid = default, Version minVersion = null, ReleaseChannel releaseChannel = ReleaseChannel.Stable); /// /// Returns the available plugin updates. /// /// The cancellation token. /// The available plugin updates. IAsyncEnumerable GetAvailablePluginUpdates(CancellationToken cancellationToken = default); /// /// Installs the package. /// /// The package. /// The cancellation token. /// . Task InstallPackage(VersionInfo 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); } }