Skip to content

Commit a1b3fa2

Browse files
authored
fix: Re-export api structs (#2515)
* fix: Re-export api structs * whoops
1 parent e54cfcb commit a1b3fa2

File tree

8 files changed

+26
-10
lines changed

8 files changed

+26
-10
lines changed

.changes/export-api-structs.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
geolocation: patch
3+
geolocation-js: patch
4+
haptics: patch
5+
haptics-js: patch
6+
notification: patch
7+
notification-js: patch
8+
os: patch
9+
os-js: patch
10+
---
11+
12+
Re-exported the `Geolocation`, `Haptics`, `Notification`, and `Os` structs so that they show up on docs.rs.

plugins/geolocation/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ mod models;
2121
pub use error::{Error, Result};
2222

2323
#[cfg(desktop)]
24-
use desktop::Geolocation;
24+
pub use desktop::Geolocation;
2525
#[cfg(mobile)]
26-
use mobile::Geolocation;
26+
pub use mobile::Geolocation;
2727

2828
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs.
2929
pub trait GeolocationExt<R: Runtime> {

plugins/haptics/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ mod models;
2121
pub use error::{Error, Result};
2222

2323
#[cfg(desktop)]
24-
use desktop::Haptics;
24+
pub use desktop::Haptics;
2525
#[cfg(mobile)]
26-
use mobile::Haptics;
26+
pub use mobile::Haptics;
2727

2828
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs.
2929
pub trait HapticsExt<R: Runtime> {

plugins/notification/src/desktop.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
1818
}
1919

2020
/// Access to the notification APIs.
21+
///
22+
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
2123
pub struct Notification<R: Runtime>(AppHandle<R>);
2224

2325
impl<R: Runtime> crate::NotificationBuilder<R> {

plugins/notification/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ mod models;
3434
pub use error::{Error, Result};
3535

3636
#[cfg(desktop)]
37-
use desktop::Notification;
37+
pub use desktop::Notification;
3838
#[cfg(mobile)]
39-
use mobile::Notification;
39+
pub use mobile::Notification;
4040

4141
/// The notification builder.
4242
#[derive(Debug)]
@@ -120,7 +120,7 @@ impl<R: Runtime> NotificationBuilder<R> {
120120

121121
/// Identifier used to group multiple notifications.
122122
///
123-
/// https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier
123+
/// <https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier>
124124
pub fn group(mut self, group: impl Into<String>) -> Self {
125125
self.data.group.replace(group.into());
126126
self

plugins/notification/src/mobile.rs

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ impl<R: Runtime> crate::NotificationBuilder<R> {
4040
}
4141

4242
/// Access to the notification APIs.
43+
///
44+
/// You can get an instance of this type via [`NotificationExt`](crate::NotificationExt)
4345
pub struct Notification<R: Runtime>(PluginHandle<R>);
4446

4547
impl<R: Runtime> Notification<R> {

plugins/os/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn exe_extension() -> &'static str {
8888
std::env::consts::EXE_EXTENSION
8989
}
9090

91-
/// Returns the current operating system locale with the `BCP-47` language tag. If the locale couldnt be obtained, `None` is returned instead.
91+
/// Returns the current operating system locale with the `BCP-47` language tag. If the locale couldn't be obtained, `None` is returned instead.
9292
pub fn locale() -> Option<String> {
9393
sys_locale::get_locale()
9494
}

shared/template/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ mod models;
2121
pub use error::{Error, Result};
2222

2323
#[cfg(desktop)]
24-
use desktop::{{ plugin_name_pascal_case }};
24+
pub use desktop::{{ plugin_name_pascal_case }};
2525
#[cfg(mobile)]
26-
use mobile::{{ plugin_name_pascal_case }};
26+
pub use mobile::{{ plugin_name_pascal_case }};
2727

2828
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the {{ plugin_name }} APIs.
2929
pub trait {{ plugin_name_pascal_case }}Ext<R: Runtime> {

0 commit comments

Comments
 (0)