use tauri::{plugin::PluginHandle, Runtime};
use crate::{models::CaptureResult, Error, Result};
pub struct NativeCamera<R: Runtime>(PluginHandle<R>);
impl<R: Runtime> NativeCamera<R> {
pub(crate) fn new(handle: PluginHandle<R>) -> Self {
Self(handle)
}
pub fn take_picture(&self) -> Result<CaptureResult> {
self.0
.run_mobile_plugin("takePicture", ())
.map_err(|e| Error::Unknown(e.to_string()))
}
}