use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn run(toml: &str) -> Result<String, JsValue> {
crate::api::run_toml(toml)
.map(|o| o.json)
.map_err(|e| JsValue::from_str(&e))
}
#[wasm_bindgen]
pub fn chart_svg(toml: &str) -> Result<String, JsValue> {
crate::api::run_toml(toml)
.map(|o| o.svg)
.map_err(|e| JsValue::from_str(&e))
}
#[wasm_bindgen]
pub fn summary(toml: &str) -> Result<String, JsValue> {
crate::api::run_toml(toml)
.map(|o| o.summary)
.map_err(|e| JsValue::from_str(&e))
}
#[wasm_bindgen]
pub fn version() -> String {
env!("CARGO_PKG_VERSION").to_string()
}