using Microsoft.Extensions.Hosting;
namespace LanMountainDesktop.AirAppSdk;
///
/// Provides runtime context and services for an AirApp.
/// The host hands an implementation to and exposes it
/// through the per-AirApp service container.
///
public interface IAirAppRuntimeContext
{
///
/// Gets the manifest of this AirApp.
///
AirAppManifest Manifest { get; }
///
/// Gets the directory that contains the loaded AirApp package.
///
string AirAppDirectory { get; }
///
/// Gets the data directory for this AirApp.
/// Use this directory to store persistent user data.
///
string DataDirectory { get; }
///
/// Gets the cache directory for this AirApp.
/// Use this directory to store temporary cached data.
///
string CacheDirectory { get; }
///
/// Gets the service provider for dependency injection.
///
IServiceProvider Services { get; }
///
/// Gets a snapshot of the host-provided properties for this AirApp.
///
IReadOnlyDictionary Properties { get; }
///
/// Gets the host application lifetime manager.
///
IHostApplicationLifetime Lifetime { get; }
///
/// Gets the message bus for inter-AirApp communication.
///
IAirAppMessageBus MessageBus { get; }
///
/// Gets the appearance context for theme and styling.
///
IAirAppAppearanceContext Appearance { get; }
///
/// Gets the logger for this AirApp.
///
IAirAppLogger Logger { get; }
///
/// Resolve a service from the AirApp service provider.
///
T? GetService();
///
/// Try to read a host-provided property.
///
bool TryGetProperty(string key, out T? value);
///
/// Opens a window defined by this AirApp.
///
/// Window identifier
/// The opened window instance
Task OpenWindowAsync(string windowId);
///
/// Closes a window by its identifier.
///
/// Window identifier
void CloseWindow(string windowId);
///
/// Register a desktop component (internal use by ).
///
void RegisterComponent(AirAppComponentOptions options);
///
/// Register a window (internal use by ).
///
void RegisterWindow(string id, string name, Type windowType);
///
/// Register a service (internal use by ).
///
void RegisterService()
where TService : class
where TImplementation : class, TService;
}