aboutsummaryrefslogtreecommitdiff
path: root/types/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-02 21:33:47 -0500
committerGitHub <noreply@github.com>2024-02-03 02:33:47 +0000
commit6dc7e90f8d5679b0de298c820a5b88b93590ed31 (patch)
tree42616fb712c7a5a019cde592bd2980e5eb9a3539 /types/ext
parent711520e9a04096dba3adb1f09c0865eda5fb587c (diff)
Fix auto hide search popup (#592)
* Remove return * Update searched event * Fix auto-hide search popup event not occuring * Add TODO * Split into multiple events
Diffstat (limited to 'types/ext')
-rw-r--r--types/ext/text-scanner.d.ts33
1 files changed, 18 insertions, 15 deletions
diff --git a/types/ext/text-scanner.d.ts b/types/ext/text-scanner.d.ts
index 4253d6cc..8acc780d 100644
--- a/types/ext/text-scanner.d.ts
+++ b/types/ext/text-scanner.d.ts
@@ -15,7 +15,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import type {TextScanner} from '../../ext/js/language/text-scanner';
import type {TextSourceGenerator} from '../../ext/js/dom/text-source-generator';
import type {API} from '../../ext/js/comm/api';
import type * as Dictionary from './dictionary';
@@ -94,18 +93,6 @@ export type InputConfig = {
preventPenScrolling: boolean;
};
-export type SearchedEventDetails = {
- textScanner: TextScanner;
- type: Display.PageType | null;
- dictionaryEntries: Dictionary.DictionaryEntry[] | null;
- sentence: Display.HistoryStateSentence | null;
- inputInfo: InputInfo;
- textSource: TextSource.TextSource;
- optionsContext: Settings.OptionsContext | null;
- detail: SearchResultDetail | null;
- error: Error | null;
-};
-
export type InputInfo = {
input: InputConfig | null;
pointerType: PointerType;
@@ -122,10 +109,26 @@ export type InputInfoDetail = {
};
export type Events = {
- searched: SearchedEventDetails;
clear: {
reason: ClearReason;
};
+ searchSuccess: {
+ type: 'terms' | 'kanji';
+ dictionaryEntries: Dictionary.DictionaryEntry[];
+ sentence: Display.HistoryStateSentence;
+ inputInfo: InputInfo;
+ textSource: TextSource.TextSource;
+ optionsContext: Settings.OptionsContext;
+ detail: SearchResultDetail;
+ };
+ searchEmpty: {
+ inputInfo: InputInfo;
+ };
+ searchError: {
+ error: Error;
+ textSource: TextSource.TextSource;
+ inputInfo: InputInfo;
+ };
};
export type ClearReason = 'mousedown';
@@ -153,7 +156,7 @@ export type ConstructorDetails = {
export type SearchContext = {
optionsContext: Settings.OptionsContext;
- detail?: SearchResultDetail;
+ detail: SearchResultDetail;
};
export type SelectionRestoreInfo = {