use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::fmt;
#[derive(Debug, Deserialize, JsonSchema)]
pub struct EvalJsParams {
pub code: String,
pub webview_label: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum SnapshotFormat {
Compact,
Json,
}
impl fmt::Display for SnapshotFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Compact => f.write_str("compact"),
Self::Json => f.write_str("json"),
}
}
}
#[derive(Debug, Deserialize, JsonSchema)]
pub struct SnapshotParams {
pub webview_label: Option<String>,
pub format: Option<SnapshotFormat>,
}