#![warn(missing_docs)]
pub mod astro;
pub mod data;
pub mod dto;
pub mod error;
pub mod i18n;
pub mod models;
pub mod prompt;
pub mod star;
pub mod utils;
#[cfg(feature = "python")]
mod python;
pub mod ffi;
#[cfg(target_arch = "wasm32")]
pub mod wasm;
pub use astro::builder::{by_lunar, by_solar};
pub use astro::horoscope::get_horoscope;
pub use data::types::*;
pub use error::IztroError;
pub use models::astrolabe::Astrolabe;
pub use models::horoscope::HoroscopeData;
pub use prompt::{astrolabe_to_prompt, horoscope_to_prompt};
pub fn by_solar_json(
solar_date: &str,
time_index: u8,
gender: Gender,
fix_leap: bool,
language: Language,
config: Config,
) -> Result<String, IztroError> {
let astrolabe = by_solar(solar_date, time_index, gender, fix_leap, language, config)?;
Ok(serde_json::to_string(&astrolabe.to_dto()).unwrap())
}
pub fn by_lunar_json(
lunar_date: &str,
time_index: u8,
gender: Gender,
is_leap_month: bool,
fix_leap: bool,
language: Language,
config: Config,
) -> Result<String, IztroError> {
let astrolabe = by_lunar(
lunar_date,
time_index,
gender,
is_leap_month,
fix_leap,
language,
config,
)?;
Ok(serde_json::to_string(&astrolabe.to_dto()).unwrap())
}