summaryrefslogtreecommitdiff
path: root/ext/js/dom/panel-element.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-28 22:17:38 -0500
committerGitHub <noreply@github.com>2023-12-29 03:17:38 +0000
commit1e254fd1d4423b984e176547ef36a14383bbd7f5 (patch)
tree8aae2c47f80265d5f1f39c927e19455ec3986387 /ext/js/dom/panel-element.js
parenta51ae1533c54162f14785652e9128f90afb86aed (diff)
Event dispatcher refactor (#463)
* Refactor EventDispatcher template type * Update core types * Update log * Update clipboard monitor * Update application events * Update popup events * Update text scanner * Update cross frame API * Update display events * Type updates * Update display history * Update query parser * Update search persistent state controller * Update panel element * Update popup menu * Update audio system * Update hotkey handler * Update settings controller * Update audio controller * Update types * Update types * Update types * Add event handler types * Update type * Fix issues * Remove error suppression * Fix typo
Diffstat (limited to 'ext/js/dom/panel-element.js')
-rw-r--r--ext/js/dom/panel-element.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/js/dom/panel-element.js b/ext/js/dom/panel-element.js
index d4cb28fd..959ca420 100644
--- a/ext/js/dom/panel-element.js
+++ b/ext/js/dom/panel-element.js
@@ -19,7 +19,7 @@
import {EventDispatcher} from '../core.js';
/**
- * @augments EventDispatcher<import('panel-element').EventType>
+ * @augments EventDispatcher<import('panel-element').Events>
*/
export class PanelElement extends EventDispatcher {
/**
@@ -84,9 +84,9 @@ export class PanelElement extends EventDispatcher {
}
/**
- * @param {import('panel-element').EventType} eventName
- * @param {(details: import('core').SafeAny) => void} callback
- * @returns {void}
+ * @template {import('core').EventNames<import('panel-element').Events>} TName
+ * @param {TName} eventName
+ * @param {(details: import('core').EventArgument<import('panel-element').Events, TName>) => void} callback
*/
on(eventName, callback) {
if (eventName === 'visibilityChanged') {
@@ -100,12 +100,13 @@ export class PanelElement extends EventDispatcher {
});
}
}
- return super.on(eventName, callback);
+ super.on(eventName, callback);
}
/**
- * @param {import('panel-element').EventType} eventName
- * @param {(details: import('core').SafeAny) => void} callback
+ * @template {import('core').EventNames<import('panel-element').Events>} TName
+ * @param {TName} eventName
+ * @param {(details: import('core').EventArgument<import('panel-element').Events, TName>) => void} callback
* @returns {boolean}
*/
off(eventName, callback) {