diff --git a/.changes/global-shortcut-js-apis-refactor.md b/.changes/global-shortcut-js-apis-refactor.md new file mode 100644 index 00000000..3bc6d76c --- /dev/null +++ b/.changes/global-shortcut-js-apis-refactor.md @@ -0,0 +1,10 @@ +--- +"global-shortcut": "patch" +--- + +Refactored the Rust APIs: + +- Renamed `GlobalShortcut::on_all_shortcuts` to `GlobalShortcut::on_shortcuts` +- Renamed `GlobalShortcut::register_all` to `GlobalShortcut::register_multiple` +- Changed `GlobalShortcut::unregister_all` behavior to remove all registerd shortcuts. +- Added `GlobalShortcut::unregister_multiple` to register a list of shortcuts (old behavior of `unregister_all`). diff --git a/.changes/global-shortcut-rust-apis-refactor.md b/.changes/global-shortcut-rust-apis-refactor.md new file mode 100644 index 00000000..073ec6de --- /dev/null +++ b/.changes/global-shortcut-rust-apis-refactor.md @@ -0,0 +1,8 @@ +--- +"global-shortcut-js": "patch" +--- + +Refactored the JS APIs: + +- Enhanced `register` and `unregister` to take either a single shortcut or an array. +- Removed `registerAll` instead use `register` with an array. diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json index 40b64e2c..cb656d6e 100644 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ b/examples/api/src-tauri/gen/schemas/desktop-schema.json @@ -4850,13 +4850,6 @@ "global-shortcut:allow-register" ] }, - { - "description": "global-shortcut:allow-register-all -> Enables the register_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:allow-register-all" - ] - }, { "description": "global-shortcut:allow-unregister -> Enables the unregister command without any pre-configured scope.", "type": "string", @@ -4885,13 +4878,6 @@ "global-shortcut:deny-register" ] }, - { - "description": "global-shortcut:deny-register-all -> Denies the register_all command without any pre-configured scope.", - "type": "string", - "enum": [ - "global-shortcut:deny-register-all" - ] - }, { "description": "global-shortcut:deny-unregister -> Denies the unregister command without any pre-configured scope.", "type": "string", diff --git a/examples/api/src/views/Shortcuts.svelte b/examples/api/src/views/Shortcuts.svelte index b2dde459..41d0271d 100644 --- a/examples/api/src/views/Shortcuts.svelte +++ b/examples/api/src/views/Shortcuts.svelte @@ -1,9 +1,8 @@