aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-05-19 20:16:40 -0400
committerGitHub <noreply@github.com>2022-05-19 20:16:40 -0400
commitae0ad227c0fd293609a21e5cc1d2a4b85fe7c520 (patch)
tree46f4058993764708ec9b9e1176f4328e205c1eb4 /ext/js/background/backend.js
parent6e239638bb7f89353f0dd2c67600966aeec726f2 (diff)
Add mode documentation about the types used by Translator (#2147)
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 54e8ff08..66f80351 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -1958,6 +1958,13 @@ class Backend {
this._applyOptions(source);
}
+ /**
+ * Creates an options object for use with `Translator.findTerms`.
+ * @param {string} mode The display mode for the dictionary entries.
+ * @param {{matchType: string, deinflect: boolean}} details Custom info for finding terms.
+ * @param {object} options The options.
+ * @returns {FindTermsOptions} An options object.
+ */
_getTranslatorFindTermsOptions(mode, details, options) {
let {matchType, deinflect} = details;
if (typeof matchType !== 'string') { matchType = 'exact'; }
@@ -2006,6 +2013,11 @@ class Backend {
};
}
+ /**
+ * Creates an options object for use with `Translator.findKanji`.
+ * @param {object} options The options.
+ * @returns {FindKanjiOptions} An options object.
+ */
_getTranslatorFindKanjiOptions(options) {
const enabledDictionaryMap = this._getTranslatorEnabledDictionaryMap(options);
return {enabledDictionaryMap};