1#![allow(clippy::empty_docs)]
2
3use std::borrow::Cow;
4use std::collections::HashMap;
5
6#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, tsify::Tsify)]
7#[serde(rename_all = "camelCase")]
8#[tsify(into_wasm_abi, from_wasm_abi)]
9pub struct RenderOptions {
11 pub disable_comments: bool,
14 pub social_icon_origin: Option<String>,
16 pub fonts: HashMap<String, String>,
18}
19
20impl From<RenderOptions> for mrml::prelude::render::RenderOptions {
21 fn from(value: RenderOptions) -> Self {
22 Self {
23 disable_comments: value.disable_comments,
24 social_icon_origin: value.social_icon_origin.map(Cow::Owned),
25 fonts: value
26 .fonts
27 .into_iter()
28 .map(|(key, value)| (key, Cow::Owned(value)))
29 .collect(),
30 }
31 }
32}