@@ -14,6 +14,7 @@ const PLUGIN_IDENTIFIER: &str = "app.tauri.opener";
1414tauri:: ios_plugin_binding!( init_plugin_opener) ;
1515
1616mod commands;
17+ mod config;
1718mod error;
1819mod open;
1920mod reveal_item_in_dir;
@@ -27,12 +28,13 @@ pub use open::{open_path, open_url};
2728pub use reveal_item_in_dir:: reveal_item_in_dir;
2829
2930pub struct Opener < R : Runtime > {
30- // we use `fn() -> R` to slicence the unused generic error
31+ // we use `fn() -> R` to silence the unused generic error
3132 // while keeping this struct `Send + Sync` without requiring `R` to be
3233 #[ cfg( not( mobile) ) ]
3334 _marker : std:: marker:: PhantomData < fn ( ) -> R > ,
3435 #[ cfg( mobile) ]
3536 mobile_plugin_handle : PluginHandle < R > ,
37+ require_literal_leading_dot : Option < bool > ,
3638}
3739
3840impl < R : Runtime > Opener < R > {
@@ -185,19 +187,23 @@ impl Builder {
185187 }
186188
187189 /// Build and Initializes the plugin.
188- pub fn build < R : Runtime > ( self ) -> TauriPlugin < R > {
189- let mut builder = tauri:: plugin:: Builder :: new ( "opener" )
190- . setup ( |app, _api | {
190+ pub fn build < R : Runtime > ( self ) -> TauriPlugin < R , Option < config :: Config > > {
191+ let mut builder = tauri:: plugin:: Builder :: < R , Option < config :: Config > > :: new ( "opener" )
192+ . setup ( |app, api | {
191193 #[ cfg( target_os = "android" ) ]
192- let handle = _api . register_android_plugin ( PLUGIN_IDENTIFIER , "OpenerPlugin" ) ?;
194+ let handle = api . register_android_plugin ( PLUGIN_IDENTIFIER , "OpenerPlugin" ) ?;
193195 #[ cfg( target_os = "ios" ) ]
194- let handle = _api . register_ios_plugin ( init_plugin_opener) ?;
196+ let handle = api . register_ios_plugin ( init_plugin_opener) ?;
195197
196198 app. manage ( Opener {
197199 #[ cfg( not( mobile) ) ]
198200 _marker : std:: marker:: PhantomData :: < fn ( ) -> R > ,
199201 #[ cfg( mobile) ]
200202 mobile_plugin_handle : handle,
203+ require_literal_leading_dot : api
204+ . config ( )
205+ . as_ref ( )
206+ . and_then ( |c| c. require_literal_leading_dot ) ,
201207 } ) ;
202208 Ok ( ( ) )
203209 } )
@@ -216,6 +222,6 @@ impl Builder {
216222}
217223
218224/// Initializes the plugin.
219- pub fn init < R : Runtime > ( ) -> TauriPlugin < R > {
225+ pub fn init < R : Runtime > ( ) -> TauriPlugin < R , Option < config :: Config > > {
220226 Builder :: default ( ) . build ( )
221227}
0 commit comments