use crate::actor::Page;
use crate::browser::cdp::CdpClient;
use crate::browser::views::{SessionInfo, TabInfo};
use crate::error::Result;
use async_trait::async_trait;
use std::sync::Arc;
#[async_trait]
pub trait BrowserClient: Send + Sync {
async fn start(&mut self) -> Result<()>;
async fn stop(&mut self) -> Result<()> {
Ok(())
}
async fn navigate(&mut self, url: &str) -> Result<()>;
async fn get_current_url(&self) -> Result<String>;
async fn create_tab(&mut self, url: Option<&str>) -> Result<String>;
async fn switch_to_tab(&mut self, target_id: &str) -> Result<()>;
async fn close_tab(&mut self, target_id: &str) -> Result<()>;
async fn get_tabs(&self) -> Result<Vec<TabInfo>>;
async fn get_target_id_from_tab_id(&self, tab_id: &str) -> Result<String>;
fn get_page(&self) -> Result<Page>;
async fn take_screenshot(&self, path: Option<&str>, full_page: bool) -> Result<Vec<u8>>;
#[deprecated(since = "0.1.2", note = "Use get_session_info() instead")]
async fn get_current_page_title(&self) -> Result<String>;
fn get_cdp_client(&self) -> Result<Arc<CdpClient>>;
#[deprecated(since = "0.1.2", note = "Use get_session_info() instead")]
fn get_session_id(&self) -> Result<String>;
#[deprecated(since = "0.1.2", note = "Use get_session_info() instead")]
fn get_current_target_id(&self) -> Result<String>;
async fn get_session_info(&self) -> Result<SessionInfo>;
}