use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Frame {
pub id: String,
pub parent_id: Option<String>,
pub loader_id: String,
pub name: Option<String>,
pub url: String,
pub security_origin: Option<String>,
pub mime_type: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FrameTree {
pub frame: Frame,
pub child_frames: Option<Vec<FrameTree>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Default)]
#[serde(rename_all = "lowercase")]
pub enum ScreenshotFormat {
#[default]
Png,
Jpeg,
Webp,
}
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Viewport {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
pub scale: f64,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NavigationEntry {
pub id: i32,
pub url: String,
#[serde(default)]
pub user_typed_url: String,
pub title: String,
#[serde(default)]
pub transition_type: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum FrameDetachedReason {
Remove,
Swap,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum FileChooserMode {
SelectSingle,
SelectMultiple,
}