diff options
Diffstat (limited to 'types')
-rw-r--r-- | types/ext/text-scanner.d.ts | 33 |
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 = { |