| |
| |
| |
|
|
| use serde::{Deserialize, Serialize}; |
| use tauri::plugin::PermissionState; |
|
|
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(rename_all = "camelCase")] |
| pub struct PermissionStatus { |
| |
| |
| |
| |
| |
| pub location: PermissionState, |
| |
| |
| |
| |
| |
| |
| |
| pub coarse_location: PermissionState, |
| } |
|
|
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(rename_all = "camelCase")] |
| pub struct PositionOptions { |
| |
| |
| pub enable_high_accuracy: bool, |
| |
| |
| |
| |
| |
| |
| pub timeout: u32, |
| |
| |
| |
| |
| |
| pub maximum_age: u32, |
| } |
|
|
| #[derive(Debug, Clone, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(rename_all = "camelCase")] |
| pub enum PermissionType { |
| Location, |
| CoarseLocation, |
| } |
|
|
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(rename_all = "camelCase")] |
| pub struct Coordinates { |
| |
| pub latitude: f64, |
| |
| pub longitude: f64, |
| |
| pub accuracy: f64, |
| |
| |
| pub altitude_accuracy: Option<f64>, |
| |
| pub altitude: Option<f64>, |
| |
| pub speed: Option<f64>, |
| |
| pub heading: Option<f64>, |
| } |
|
|
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(rename_all = "camelCase")] |
| pub struct Position { |
| |
| |
| pub timestamp: u64, |
| |
| pub coords: Coordinates, |
| } |
|
|
| #[derive(Debug, Clone, Serialize, Deserialize)] |
| #[cfg_attr(feature = "specta", derive(specta::Type))] |
| #[serde(untagged)] |
| pub enum WatchEvent { |
| Position(Position), |
| Error(String), |
| } |
|
|