#nullable enable
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
namespace MediaBrowser.Common.Plugins
{
///
/// Defines the .
///
public interface IPluginManager
{
///
/// Gets the Plugins.
///
IList Plugins { get; }
///
/// Creates the plugins.
///
void CreatePlugins();
///
/// Returns all the assemblies.
///
/// An IEnumerable{Assembly}.
IEnumerable LoadAssemblies();
///
/// Registers the plugin's services with the DI.
/// Note: DI is not yet instantiated yet.
///
/// A instance.
void RegisterServices(IServiceCollection serviceCollection);
///
/// Saves the manifest back to disk.
///
/// The to save.
/// The path where to save the manifest.
/// True if successful.
bool SaveManifest(PluginManifest manifest, string path);
///
/// Imports plugin details from a folder.
///
/// Folder of the plugin.
void ImportPluginFrom(string folder);
///
/// Disable the plugin.
///
/// The of the plug to disable.
void FailPlugin(Assembly assembly);
///
/// Disable the plugin.
///
/// The of the plug to disable.
void DisablePlugin(LocalPlugin plugin);
///
/// Enables the plugin, disabling all other versions.
///
/// The of the plug to disable.
void EnablePlugin(LocalPlugin plugin);
///
/// Attempts to find the plugin with and id of .
///
/// Id of plugin.
/// The version of the plugin to locate.
/// A if located, or null if not.
LocalPlugin? GetPlugin(Guid id, Version? version = null);
///
/// Removes the plugin.
///
/// The plugin.
/// Outcome of the operation.
bool RemovePlugin(LocalPlugin plugin);
}
}