use dprint_plugin_typescript::{configuration::Configuration as Cfg, format_text};
use std::path::Path;
pub struct Fmt(Cfg);
impl Fmt {
pub fn from_cfg(cfg: Cfg) -> Self {
Fmt(cfg)
}
pub fn into_cfg(self) -> Cfg {
self.0
}
pub fn format_text(&self, path: &Path, content: &str) -> Result<Option<String>, String> {
format_text(path, content, &self.0).map_err(|e| e.to_string())
}
}