aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/query-parser.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/display/query-parser.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/display/query-parser.js')
-rw-r--r--ext/js/display/query-parser.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js
index 0e7e1e1a..11c5a4ec 100644
--- a/ext/js/display/query-parser.js
+++ b/ext/js/display/query-parser.js
@@ -22,7 +22,7 @@ import {TextScanner} from '../language/text-scanner.js';
import {yomitan} from '../yomitan.js';
/**
- * @augments EventDispatcher<import('display').QueryParserEventType>
+ * @augments EventDispatcher<import('query-parser').Events>
*/
export class QueryParser extends EventDispatcher {
/**
@@ -160,8 +160,7 @@ export class QueryParser extends EventDispatcher {
} = e;
if (type === null || dictionaryEntries === null || sentence === null || optionsContext === null) { return; }
- /** @type {import('display').QueryParserSearchedEvent} */
- const event2 = {
+ this.trigger('searched', {
textScanner,
type,
dictionaryEntries,
@@ -170,8 +169,7 @@ export class QueryParser extends EventDispatcher {
textSource,
optionsContext,
sentenceOffset: this._getSentenceOffset(e.textSource)
- };
- this.trigger('searched', event2);
+ });
}
/**