@peter.naydenov/shortcuts 3.5.1 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Changelog.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ### 3.5.2 ( 2025-10-20 )
6
+ - [x] Types update;
7
+
8
+
9
+
5
10
  ### 3.5.1 ( 2025-10-20 )
6
11
  - [x] Update in package.json. Field 'types' was added;
7
12
 
@@ -1,4 +1,30 @@
1
1
  export default pluginClick;
2
+ export type PluginAPI = {
3
+ /**
4
+ * - Get plugin prefix
5
+ */
6
+ getPrefix: () => string;
7
+ /**
8
+ * - Format shortcut name
9
+ */
10
+ shortcutName: (arg0: string) => string;
11
+ /**
12
+ * - Handle context change
13
+ */
14
+ contextChange: (arg0: string) => void;
15
+ /**
16
+ * - Mute the plugin
17
+ */
18
+ mute: () => void;
19
+ /**
20
+ * - Unmute the plugin
21
+ */
22
+ unmute: () => void;
23
+ /**
24
+ * - Destroy the plugin
25
+ */
26
+ destroy: () => void;
27
+ };
2
28
  /**
3
29
  * @function pluginClick
4
30
  * @description Plugin for mouse click shortcuts
@@ -1,4 +1,30 @@
1
1
  export default pluginForm;
2
+ export type PluginAPI = {
3
+ /**
4
+ * - Get plugin prefix
5
+ */
6
+ getPrefix: () => string;
7
+ /**
8
+ * - Format shortcut name
9
+ */
10
+ shortcutName: (arg0: string) => string;
11
+ /**
12
+ * - Handle context change
13
+ */
14
+ contextChange: (arg0: string) => void;
15
+ /**
16
+ * - Mute the plugin
17
+ */
18
+ mute: () => void;
19
+ /**
20
+ * - Unmute the plugin
21
+ */
22
+ unmute: () => void;
23
+ /**
24
+ * - Destroy the plugin
25
+ */
26
+ destroy: () => void;
27
+ };
2
28
  /**
3
29
  * @function pluginForm
4
30
  * @description Plugin for form element shortcuts
@@ -1,4 +1,30 @@
1
1
  export default pluginKey;
2
+ export type PluginAPI = {
3
+ /**
4
+ * - Get plugin prefix
5
+ */
6
+ getPrefix: () => string;
7
+ /**
8
+ * - Format shortcut name
9
+ */
10
+ shortcutName: (arg0: string) => string;
11
+ /**
12
+ * - Handle context change
13
+ */
14
+ contextChange: (arg0: string) => void;
15
+ /**
16
+ * - Mute the plugin
17
+ */
18
+ mute: () => void;
19
+ /**
20
+ * - Unmute the plugin
21
+ */
22
+ unmute: () => void;
23
+ /**
24
+ * - Destroy the plugin
25
+ */
26
+ destroy: () => void;
27
+ };
2
28
  /**
3
29
  * @function pluginKey
4
30
  * @description Plugin for keyboard shortcuts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peter.naydenov/shortcuts",
3
3
  "description": "Context control of shortcuts based on keyboard and mouse events",
4
- "version": "3.5.1",
4
+ "version": "3.5.2",
5
5
  "license": "MIT",
6
6
  "author": "Peter Naydenov",
7
7
  "main": "./dist/shortcuts.umd.js",
@@ -1,5 +1,15 @@
1
1
  'use strict'
2
2
 
3
+ /**
4
+ * @typedef {Object} PluginAPI
5
+ * @property {function(): string} getPrefix - Get plugin prefix
6
+ * @property {function(string): string} shortcutName - Format shortcut name
7
+ * @property {function(string): void} contextChange - Handle context change
8
+ * @property {function(): void} mute - Mute the plugin
9
+ * @property {function(): void} unmute - Unmute the plugin
10
+ * @property {function(): void} destroy - Destroy the plugin
11
+ */
12
+
3
13
  import _findTarget from "./_findTarget"
4
14
  import _listenDOM from "./_listenDOM"
5
15
  import _normalizeShortcutName from "./_normalizeShortcutName"
@@ -1,5 +1,15 @@
1
1
  'use strict'
2
2
 
3
+ /**
4
+ * @typedef {Object} PluginAPI
5
+ * @property {function(): string} getPrefix - Get plugin prefix
6
+ * @property {function(string): string} shortcutName - Format shortcut name
7
+ * @property {function(string): void} contextChange - Handle context change
8
+ * @property {function(): void} mute - Mute the plugin
9
+ * @property {function(): void} unmute - Unmute the plugin
10
+ * @property {function(): void} destroy - Destroy the plugin
11
+ */
12
+
3
13
  // import all plugin files here
4
14
  import _listenDOM from './_listenDOM.js'
5
15
  import _normalizeShortcutName from './_normalizeShortcutName.js'
@@ -1,5 +1,15 @@
1
1
  'use strict'
2
2
 
3
+ /**
4
+ * @typedef {Object} PluginAPI
5
+ * @property {function(): string} getPrefix - Get plugin prefix
6
+ * @property {function(string): string} shortcutName - Format shortcut name
7
+ * @property {function(string): void} contextChange - Handle context change
8
+ * @property {function(): void} mute - Mute the plugin
9
+ * @property {function(): void} unmute - Unmute the plugin
10
+ * @property {function(): void} destroy - Destroy the plugin
11
+ */
12
+
3
13
  // import all plugin files here
4
14
  import _listenDOM from './_listenDOM.js'
5
15
  import _normalizeShortcutName from './_normalizeShortcutName.js'