use std::borrow::Cow;
use std::collections::HashMap;
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, tsify::Tsify)]
#[serde(rename_all = "camelCase")]
#[tsify(into_wasm_abi, from_wasm_abi)]
pub struct RenderOptions {
pub disable_comments: bool,
pub social_icon_origin: Option<String>,
pub fonts: HashMap<String, String>,
}
impl From<RenderOptions> for mrml::prelude::render::RenderOptions {
fn from(value: RenderOptions) -> Self {
Self {
disable_comments: value.disable_comments,
social_icon_origin: value.social_icon_origin.map(Cow::Owned),
fonts: value
.fonts
.into_iter()
.map(|(key, value)| (key, Cow::Owned(value)))
.collect(),
}
}
}