aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2023-12-29 04:02:51 +0100
committerGitHub <noreply@github.com>2023-12-29 03:02:51 +0000
commit580983b9b8a17965db1466aa08cad3c96b06022e (patch)
tree914760e326ffc4b1acf8ddcddbd5006ae762babf /types
parent8d5d2152e4295fdcefa6ef283204c92df1f81305 (diff)
search resolution option (#436)
* add search resolution setting * move finding next substring to method * use regex literal * fix comments * fix comments * add options update function * update test
Diffstat (limited to 'types')
-rw-r--r--types/ext/settings.d.ts3
-rw-r--r--types/ext/translation.d.ts5
2 files changed, 8 insertions, 0 deletions
diff --git a/types/ext/settings.d.ts b/types/ext/settings.d.ts
index 8ce82b28..25ea46d9 100644
--- a/types/ext/settings.d.ts
+++ b/types/ext/settings.d.ts
@@ -234,8 +234,11 @@ export type TranslationOptions = {
convertKatakanaToHiragana: TranslationConvertType;
collapseEmphaticSequences: TranslationCollapseEmphaticSequences;
textReplacements: TranslationTextReplacementOptions;
+ searchResolution: SearchResolution;
};
+export type SearchResolution = 'letter' | 'word';
+
export type TranslationTextReplacementOptions = {
searchOriginal: boolean;
groups: TranslationTextReplacementGroup[][];
diff --git a/types/ext/translation.d.ts b/types/ext/translation.d.ts
index 595a5a35..c8938e00 100644
--- a/types/ext/translation.d.ts
+++ b/types/ext/translation.d.ts
@@ -17,6 +17,7 @@
*/
import type * as Dictionary from './dictionary';
+import type {SearchResolution} from 'settings';
// Kanji
@@ -116,6 +117,10 @@ export type FindTermsOptions = {
* A set of dictionary names which should have definitions removed.
*/
excludeDictionaryDefinitions: Set<string> | null;
+ /**
+ * Whether every substring should be searched for, or only whole words.
+ */
+ searchResolution: SearchResolution;
};
/**