use crate::error::PlatformError;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WindowInfo {
pub id: String,
pub title: String,
pub focused: bool,
pub main: bool,
pub visible: bool,
pub width: u32,
pub height: u32,
}
#[async_trait]
pub trait AppScreenshot: Send + Sync {
async fn list_app_windows(&self) -> Result<Vec<WindowInfo>, PlatformError> {
Err(PlatformError::NotSupported(
"list_app_windows is not implemented for this platform".to_string(),
))
}
async fn take_app_screenshot(&self, window_id: Option<&str>) -> Result<Vec<u8>, PlatformError> {
let _ = window_id;
Err(PlatformError::NotSupported(
"app screenshot is not implemented for this platform".to_string(),
))
}
}