mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
refactor!(global-shortcut): better APIs DX (#969)
* feat(global-shortcut): add `GlobalShortcutExt::register_with_handler` ref: https://github.com/tauri-apps/plugins-workspace/issues/965 * clippy * refactor apis to take closure by default * change file * Update .changes/global-shortcut-refactor.md Co-authored-by: Simon Hyll <hyllsimon@gmail.com> * Update global-shortcut-refactor.md * use option instead * clippy * update readme * on_shortcut and with_shortcut * map handler * simplify events * lint --------- Co-authored-by: Simon Hyll <hyllsimon@gmail.com> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"global-shortcut": "patch"
|
||||
---
|
||||
|
||||
**Breaking change** Refactored the plugin Rust APIs for better DX and flexibility:
|
||||
|
||||
- Changed `Builder::with_handler` to be a method instead of a static method, it will also be triggered for any and all shortcuts even if the shortcut is registered through JS.
|
||||
- Added `Builder::with_shortcut` and `Builder::with_shortcuts` to register shortcuts on the plugin builder.
|
||||
- Added `on_shortcut` and `on_all_shortcuts` to register shortcuts with a handler.
|
||||
Reference in New Issue
Block a user