using IronLicensing.Client.Models; namespace IronLicensing.Client; public interface ILicenseManager { // State LicenseInfo? CurrentLicense { get; } LicenseStatus Status { get; } bool IsLicensed { get; } bool IsTrial { get; } int TrialDaysRemaining { get; } // Events event EventHandler? LicenseChanged; event EventHandler? ValidationCompleted; // Operations Task ValidateAsync(string? licenseKey = null); Task ActivateAsync(string licenseKey); Task DeactivateAsync(); Task StartPurchaseAsync(string tierId, string customerEmail); // Feature Gating bool HasFeature(string featureKey); Task HasFeatureAsync(string featureKey); void RequireFeature(string featureKey); // Trial Task StartTrialAsync(string email); // Cache management Task ClearCacheAsync(); } public class LicenseChangedEventArgs : EventArgs { public LicenseInfo? OldLicense { get; init; } public LicenseInfo? NewLicense { get; init; } } public class LicenseValidationEventArgs : EventArgs { public bool Success { get; init; } public LicenseInfo? License { get; init; } public string? ErrorCode { get; init; } public string? ErrorMessage { get; init; } }