use serde::Deserialize;
use super::vue::VueVersion;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "lowercase")]
pub(crate) enum RawTemplateSyntaxConfig {
Standard,
Strict,
Quirks,
}
impl RawTemplateSyntaxConfig {
pub(crate) fn as_str(self) -> &'static str {
match self {
Self::Standard => "standard",
Self::Strict => "strict",
Self::Quirks => "quirks",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum JsxMode {
#[default]
Vdom,
Vapor,
}
impl JsxMode {
pub fn as_str(self) -> &'static str {
match self {
Self::Vdom => "vdom",
Self::Vapor => "vapor",
}
}
}
#[derive(Debug, Clone, Default, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub(crate) struct RawCompilerCompatibilityConfig {
pub(crate) vue_version: Option<VueVersion>,
pub(crate) host_compiler: Option<bool>,
}
#[derive(Debug, Clone, Default, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub(crate) struct RawCompilerConfig {
pub(crate) vapor: Option<bool>,
pub(crate) template_syntax: Option<RawTemplateSyntaxConfig>,
pub(crate) jsx_mode: Option<JsxMode>,
pub(crate) compatibility: RawCompilerCompatibilityConfig,
}