@@ -62,7 +62,7 @@ const WORD_NOT_FOUND_MESSAGE = "Word not found";
6262const WORD_ALREADY_IMPORTED_MESSAGE = "The word is already imported" ;
6363const DICTIONARY_ERROR_MESSAGE = "Please fix the errors before saving" ;
6464
65- function main ( ) : void {
65+ function main ( ) {
6666 // load elements
6767 const inputTextBox = document . getElementById (
6868 "input" ,
@@ -144,13 +144,13 @@ function main(): void {
144144 ) as HTMLAnchorElement ;
145145
146146 // determines whether the dictionary can be automatically parsed
147- function autoParse ( ) : boolean {
147+ function autoParse ( ) {
148148 return customDictionaryTextBox . value . length <=
149149 DICTIONARY_AUTO_PARSE_THRESHOLD ;
150150 }
151151
152152 // emulates `window.alert`
153- function showMessage ( useMessage : string ) : void {
153+ function showMessage ( useMessage : string ) {
154154 message . innerText = useMessage ;
155155 alertBox . showModal ( ) ;
156156 }
@@ -193,21 +193,21 @@ function main(): void {
193193
194194 // initial text area size
195195 resizeTextarea ( ) ;
196- function resizeTextarea ( ) : void {
196+ function resizeTextarea ( ) {
197197 inputTextBox . style . height = "auto" ;
198198 inputTextBox . style . height = `${ inputTextBox . scrollHeight + 14 } px` ;
199199 }
200200
201201 // initialize button label
202202 updateLabel ( ) ;
203- function updateLabel ( ) : void {
203+ function updateLabel ( ) {
204204 translateButton . innerText = settings . multiline
205205 ? TRANSLATE_LABEL_MULTILINE
206206 : TRANSLATE_LABEL ;
207207 }
208208
209209 // show custom dictionary errors
210- function showDictionaryError ( ) : void {
210+ function showDictionaryError ( ) {
211211 customDictionaryErrorSummary . innerText =
212212 `Errors (${ currentDictionary . errors . length } ):` ;
213213 customDictionaryErrorList . innerHTML = "" ;
@@ -239,7 +239,7 @@ function main(): void {
239239 updateOutput ( ) ;
240240 }
241241 } ) ;
242- function updateOutput ( ) : void {
242+ function updateOutput ( ) {
243243 outputList . innerHTML = "" ;
244244 errorList . innerHTML = "" ;
245245 errorDisplay . innerText = "" ;
@@ -300,7 +300,7 @@ function main(): void {
300300 importWord ( ) ;
301301 }
302302 } ) ;
303- function importWord ( ) : void {
303+ function importWord ( ) {
304304 const word = importWordTextBox . value . trim ( ) ;
305305 if ( word === "" ) {
306306 showMessage ( NO_WORD_MESSAGE ) ;
@@ -338,16 +338,16 @@ function main(): void {
338338 }
339339 tryCloseDictionary ( ) ;
340340 } ) ;
341- function updateDictionary ( ) : void {
341+ function updateDictionary ( ) {
342342 currentDictionary = dictionaryParser . parse ( customDictionaryTextBox . value ) ;
343343 showDictionaryError ( ) ;
344344 }
345- function updateIfCanAutoParse ( ) : void {
345+ function updateIfCanAutoParse ( ) {
346346 if ( autoParse ( ) ) {
347347 updateDictionary ( ) ;
348348 }
349349 }
350- function tryCloseDictionary ( ) : void {
350+ function tryCloseDictionary ( ) {
351351 if ( ! currentDictionary . isError ( ) ) {
352352 lastSavedText = customDictionaryTextBox . value ;
353353 lastSavedDictionary = currentDictionary ;
0 commit comments