//! Arc Package Manager Library
//!
//! A library for managing pacman and flatpak packages with intelligent package matching
//! and filtering based on configuration rules.

pub mod config;
pub mod error;
pub mod flatpak;
pub mod pacman;
pub mod package_manager;
pub mod progress;

pub use config::ArcConfig;
pub use error::{ArcError, Result};
pub use package_manager::PackageManager;
pub use progress::{ProgressCallback, ProgressState, ProgressTracker};

/// Represents a package that can be installed
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Package {
    Pacman(String),
    Flatpak(String),
}

impl Package {
    /// Returns the package name
    pub fn name(&self) -> &str {
        match self {
            Package::Pacman(name) => name,
            Package::Flatpak(name) => name,
        }
    }

    /// Returns true if this is a pacman package
    pub fn is_pacman(&self) -> bool {
        matches!(self, Package::Pacman(_))
    }

    /// Returns true if this is a flatpak package
    pub fn is_flatpak(&self) -> bool {
        matches!(self, Package::Flatpak(_))
    }
}
