fix: Re-export api structs (#2515)

* fix: Re-export api structs

* whoops
pull/2477/head
Fabian-Lars 3 months ago committed by GitHub
parent e54cfcb261
commit a1b3fa27f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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};
#[cfg(desktop)]
use desktop::Geolocation;
pub use desktop::Geolocation;
#[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.
pub trait GeolocationExt<R: Runtime> {

@ -21,9 +21,9 @@ mod models;
pub use error::{Error, Result};
#[cfg(desktop)]
use desktop::Haptics;
pub use desktop::Haptics;
#[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.
pub trait HapticsExt<R: Runtime> {

@ -18,6 +18,8 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
}
/// Access to the notification APIs.
///
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
pub struct Notification<R: Runtime>(AppHandle<R>);
impl<R: Runtime> crate::NotificationBuilder<R> {

@ -34,9 +34,9 @@ mod models;
pub use error::{Error, Result};
#[cfg(desktop)]
use desktop::Notification;
pub use desktop::Notification;
#[cfg(mobile)]
use mobile::Notification;
pub use mobile::Notification;
/// The notification builder.
#[derive(Debug)]
@ -120,7 +120,7 @@ impl<R: Runtime> NotificationBuilder<R> {
/// 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 {
self.data.group.replace(group.into());
self

@ -40,6 +40,8 @@ impl<R: Runtime> crate::NotificationBuilder<R> {
}
/// Access to the notification APIs.
///
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
pub struct Notification<R: Runtime>(PluginHandle<R>);
impl<R: Runtime> Notification<R> {

@ -88,7 +88,7 @@ pub fn exe_extension() -> &'static str {
std::env::consts::EXE_EXTENSION
}
/// Returns the current operating system locale with the `BCP-47` language tag. If the locale couldnt 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> {
sys_locale::get_locale()
}

@ -21,9 +21,9 @@ mod models;
pub use error::{Error, Result};
#[cfg(desktop)]
use desktop::{{ plugin_name_pascal_case }};
pub use desktop::{{ plugin_name_pascal_case }};
#[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.
pub trait {{ plugin_name_pascal_case }}Ext<R: Runtime> {

Loading…
Cancel
Save