summaryrefslogtreecommitdiff
path: root/ext/js/dom
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/dom')
-rw-r--r--ext/js/dom/panel-element.js15
-rw-r--r--ext/js/dom/popup-menu.js4
2 files changed, 10 insertions, 9 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) {
diff --git a/ext/js/dom/popup-menu.js b/ext/js/dom/popup-menu.js
index 72df82a0..61f20ba8 100644
--- a/ext/js/dom/popup-menu.js
+++ b/ext/js/dom/popup-menu.js
@@ -20,7 +20,7 @@ import {EventDispatcher, EventListenerCollection} from '../core.js';
import {querySelectorNotNull} from './query-selector.js';
/**
- * @augments EventDispatcher<import('popup-menu').EventType>
+ * @augments EventDispatcher<import('popup-menu').Events>
*/
export class PopupMenu extends EventDispatcher {
/**
@@ -247,7 +247,7 @@ export class PopupMenu extends EventDispatcher {
{altKey: false, ctrlKey: false, metaKey: false, shiftKey: false}
);
- /** @type {import('popup-menu').MenuCloseEventDetails} */
+ /** @type {import('popup-menu').EventArgument<'close'>} */
const detail = {
menu: this,
item,