mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
fix: Re-export api structs (#2515)
* fix: Re-export api structs * whoops
This commit is contained in:
1 parent
e54cfcb261
commit
a1b3fa27f1
8 files changed
+26
-10
No files matched your search
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
geolocation: patch
|
||||||
|
geolocation-js: patch
|
||||||
|
haptics: patch
|
||||||
|
haptics-js: patch
|
||||||
|
notification: patch
|
||||||
|
notification-js: patch
|
||||||
|
os: patch
|
||||||
|
os-js: patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Re-exported the `Geolocation`, `Haptics`, `Notification`, and `Os` structs so that they show up on docs.rs.
|
||||||
@@ -21,9 +21,9 @@ mod models;
|
|||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
|
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
use desktop::Geolocation;
|
pub use desktop::Geolocation;
|
||||||
#[cfg(mobile)]
|
#[cfg(mobile)]
|
||||||
use mobile::Geolocation;
|
pub use mobile::Geolocation;
|
||||||
|
|
||||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs.
|
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs.
|
||||||
pub trait GeolocationExt<R: Runtime> {
|
pub trait GeolocationExt<R: Runtime> {
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ mod models;
|
|||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
|
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
use desktop::Haptics;
|
pub use desktop::Haptics;
|
||||||
#[cfg(mobile)]
|
#[cfg(mobile)]
|
||||||
use mobile::Haptics;
|
pub use mobile::Haptics;
|
||||||
|
|
||||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs.
|
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs.
|
||||||
pub trait HapticsExt<R: Runtime> {
|
pub trait HapticsExt<R: Runtime> {
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the notification APIs.
|
/// Access to the notification APIs.
|
||||||
|
///
|
||||||
|
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
|
||||||
pub struct Notification<R: Runtime>(AppHandle<R>);
|
pub struct Notification<R: Runtime>(AppHandle<R>);
|
||||||
|
|
||||||
impl<R: Runtime> crate::NotificationBuilder<R> {
|
impl<R: Runtime> crate::NotificationBuilder<R> {
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ mod models;
|
|||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
|
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
use desktop::Notification;
|
pub use desktop::Notification;
|
||||||
#[cfg(mobile)]
|
#[cfg(mobile)]
|
||||||
use mobile::Notification;
|
pub use mobile::Notification;
|
||||||
|
|
||||||
/// The notification builder.
|
/// The notification builder.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -120,7 +120,7 @@ impl<R: Runtime> NotificationBuilder<R> {
|
|||||||
|
|
||||||
/// Identifier used to group multiple notifications.
|
/// Identifier used to group multiple notifications.
|
||||||
///
|
///
|
||||||
/// https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier
|
/// <https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier>
|
||||||
pub fn group(mut self, group: impl Into<String>) -> Self {
|
pub fn group(mut self, group: impl Into<String>) -> Self {
|
||||||
self.data.group.replace(group.into());
|
self.data.group.replace(group.into());
|
||||||
self
|
self
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ impl<R: Runtime> crate::NotificationBuilder<R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the notification APIs.
|
/// Access to the notification APIs.
|
||||||
|
///
|
||||||
|
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
|
||||||
pub struct Notification<R: Runtime>(PluginHandle<R>);
|
pub struct Notification<R: Runtime>(PluginHandle<R>);
|
||||||
|
|
||||||
impl<R: Runtime> Notification<R> {
|
impl<R: Runtime> Notification<R> {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ pub fn exe_extension() -> &'static str {
|
|||||||
std::env::consts::EXE_EXTENSION
|
std::env::consts::EXE_EXTENSION
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the current operating system locale with the `BCP-47` language tag. If the locale couldn’t be obtained, `None` is returned instead.
|
/// Returns the current operating system locale with the `BCP-47` language tag. If the locale couldn't be obtained, `None` is returned instead.
|
||||||
pub fn locale() -> Option<String> {
|
pub fn locale() -> Option<String> {
|
||||||
sys_locale::get_locale()
|
sys_locale::get_locale()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ mod models;
|
|||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
|
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
use desktop::{{ plugin_name_pascal_case }};
|
pub use desktop::{{ plugin_name_pascal_case }};
|
||||||
#[cfg(mobile)]
|
#[cfg(mobile)]
|
||||||
use mobile::{{ plugin_name_pascal_case }};
|
pub use mobile::{{ plugin_name_pascal_case }};
|
||||||
|
|
||||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the {{ plugin_name }} APIs.
|
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the {{ plugin_name }} APIs.
|
||||||
pub trait {{ plugin_name_pascal_case }}Ext<R: Runtime> {
|
pub trait {{ plugin_name_pascal_case }}Ext<R: Runtime> {
|
||||||
|
|||||||
Reference in new issue
Block a user