using Artemis.Core; using Artemis.UI.Shared.Utilities; using Artemis.WebClient.Workshop.Handlers.InstallationHandlers; using Artemis.WebClient.Workshop.Handlers.UploadHandlers; using Artemis.WebClient.Workshop.Models; namespace Artemis.WebClient.Workshop.Services; /// /// Provides an interface for managing workshop services. /// public interface IWorkshopService { /// /// Gets the icon for a specific entry. /// /// The ID of the entry. /// The cancellation token. /// A stream containing the icon. Task GetEntryIcon(long entryId, CancellationToken cancellationToken); /// /// Sets the icon for a specific entry. /// /// The ID of the entry. /// The stream containing the icon. /// The cancellation token. /// An API result. Task SetEntryIcon(long entryId, Stream icon, CancellationToken cancellationToken); /// /// Uploads an image for a specific entry. /// /// The ID of the entry. /// The image upload request. /// The cancellation token. /// An API result. Task UploadEntryImage(long entryId, ImageUploadRequest request, CancellationToken cancellationToken); /// /// Deletes an image by its ID. /// /// The ID of the image. /// The cancellation token. Task DeleteEntryImage(Guid id, CancellationToken cancellationToken); /// /// Gets the status of the workshop. /// /// The cancellation token. /// The status of the workshop. Task GetWorkshopStatus(CancellationToken cancellationToken); /// /// Validates the status of the workshop. /// /// The cancellation token. /// A boolean indicating whether the workshop is reachable. Task ValidateWorkshopStatus(CancellationToken cancellationToken); /// /// Navigates to a specific entry. /// /// The ID of the entry. /// The type of the entry. Task NavigateToEntry(long entryId, EntryType entryType); /// /// Installs a specific entry. /// /// The entry to install. /// The release of the entry. /// The progress of the installation. /// The cancellation token. Task InstallEntry(IEntrySummary entry, IRelease release, Progress progress, CancellationToken cancellationToken); /// /// Uninstalls a specific entry. /// /// The installed entry to uninstall. /// The cancellation token. Task UninstallEntry(InstalledEntry installedEntry, CancellationToken cancellationToken); /// /// Gets all installed entries. /// /// A list of all installed entries. List GetInstalledEntries(); /// /// Gets a specific installed entry. /// /// The ID of the entry. /// The installed entry. InstalledEntry? GetInstalledEntry(long entryId); /// /// Gets the installed plugin entry for a specific plugin. /// /// The plugin. /// The installed entry. InstalledEntry? GetInstalledEntryByPlugin(Plugin plugin); /// /// Gets the installed plugin entry for a specific profile. /// /// The profile. /// The installed entry. InstalledEntry? GetInstalledEntryByProfile(ProfileConfiguration profileConfiguration); /// /// Removes a specific installed entry for storage. /// /// The installed entry to remove. void RemoveInstalledEntry(InstalledEntry installedEntry); /// /// Saves a specific installed entry to storage. /// /// The installed entry to save. void SaveInstalledEntry(InstalledEntry entry); /// /// Initializes the workshop service. /// void Initialize(); /// /// Represents the status of the workshop. /// public record WorkshopStatus(bool IsReachable, string Message); public event EventHandler? OnInstalledEntrySaved; public event EventHandler? OnEntryUninstalled; public event EventHandler? OnEntryInstalled; }