File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-explicit-any */
2+ import { TranslatorState } from "./translatorTypes" ;
23import { create } from "zustand" ;
34
4- type TranslatorState = {
5- inputText : string ;
6- outputText : string ;
7- sourceLanguage : string ;
8- targetLanguage : string ;
9- isTranslating : boolean ;
10- hasNativeTranslator : boolean ;
11- hasNativeDetector : boolean ;
12- setInputText : ( text : string ) => void ;
13- setSourceLanguage : ( lang : string ) => void ;
14- setTargetLanguage : ( lang : string ) => void ;
15- checkAPISupport : ( ) => void ;
16- translate : ( ) => Promise < void > ;
17- swapLanguages : ( ) => Promise < void > ;
18- startVoiceRecognition : ( ) => Promise < void > ;
19- speakTranslation : ( ) => void ;
20- } ;
21-
225declare global {
236 interface Window {
247 Translator ?: any ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-explicit-any */
2+
3+ export type TranslatorState = {
4+ inputText : string ;
5+ outputText : string ;
6+ sourceLanguage : string ;
7+ targetLanguage : string ;
8+ isTranslating : boolean ;
9+ hasNativeTranslator : boolean ;
10+ hasNativeDetector : boolean ;
11+ setInputText : ( text : string ) => void ;
12+ setSourceLanguage : ( lang : string ) => void ;
13+ setTargetLanguage : ( lang : string ) => void ;
14+ checkAPISupport : ( ) => void ;
15+ translate : ( ) => Promise < void > ;
16+ swapLanguages : ( ) => Promise < void > ;
17+ startVoiceRecognition : ( ) => Promise < void > ;
18+ speakTranslation : ( ) => void ;
19+ } ;
20+
21+ declare global {
22+ interface Window {
23+ Translator ?: any ;
24+ LanguageDetector ?: any ;
25+ webkitSpeechRecognition ?: any ;
26+ SpeechRecognition ?: any ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments