diff options
Diffstat (limited to 'types')
-rw-r--r-- | types/ext/api.d.ts | 3 | ||||
-rw-r--r-- | types/ext/application.d.ts | 2 | ||||
-rw-r--r-- | types/ext/display.d.ts | 1 | ||||
-rw-r--r-- | types/ext/language-descriptors.d.ts | 9 |
4 files changed, 13 insertions, 2 deletions
diff --git a/types/ext/api.d.ts b/types/ext/api.d.ts index 16321722..9a922fb0 100644 --- a/types/ext/api.d.ts +++ b/types/ext/api.d.ts @@ -344,9 +344,10 @@ type ApiSurface = { params: void; return: true; }; - textHasJapaneseCharacters: { + isTextLookupWorthy: { params: { text: string; + language: string; }; return: boolean; }; diff --git a/types/ext/application.d.ts b/types/ext/application.d.ts index 96f76714..8d80894d 100644 --- a/types/ext/application.d.ts +++ b/types/ext/application.d.ts @@ -41,7 +41,7 @@ export type ApiSurface = { searchDisplayControllerUpdateSearchQuery: { params: { text: string; - animate?: boolean; + animate: boolean; }; return: void; }; diff --git a/types/ext/display.d.ts b/types/ext/display.d.ts index 61e1aac5..7f4d8966 100644 --- a/types/ext/display.d.ts +++ b/types/ext/display.d.ts @@ -129,6 +129,7 @@ export type QueryParserOptions = { readingMode: Settings.ParsingReadingMode; useInternalParser: boolean; useMecabParser: boolean; + language: string; scanning: TextScannerTypes.Options; }; diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts index 319a3ca5..ca457721 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -18,10 +18,19 @@ import type {TextPreprocessor, BidirectionalConversionPreprocessor} from './language'; import type {SafeAny} from './core'; +export type IsTextLookupWorthyFunction = (text: string) => boolean; + type LanguageDescriptor<TIso extends string, TTextPreprocessorDescriptor extends TextPreprocessorDescriptor> = { iso: TIso; name: string; exampleText: string; + /** + * An optional function which returns whether or not a given string may be translatable. + * This is used as a filter for several situations, such as whether the clipboard monitor + * window should activate when text is copied to the clipboard. + * If no value is provided, `true` is assumed for all inputs. + */ + isTextLookupWorthy?: IsTextLookupWorthyFunction; textPreprocessors: TTextPreprocessorDescriptor; }; |