chore: add Typescript support

Fixed: twpowertools:198
Change-Id: I00a14ab8ad93e9ff8d2a4d2e33824a9290500a8a
diff --git a/src/common/actionApi.js b/src/common/actionApi.js
index 0cf8528..dc22691 100644
--- a/src/common/actionApi.js
+++ b/src/common/actionApi.js
@@ -1,5 +1,9 @@
+let actionApi;
+
 // #!if browser_target == 'chromium_mv3'
-export default typeof chrome !== 'undefined' ? chrome.action : undefined;
+actionApi = typeof chrome !== 'undefined' ? chrome.action : undefined;
 // #!else
-export default typeof chrome !== 'undefined' ? chrome.browserAction : undefined;
+actionApi = typeof chrome !== 'undefined' ? chrome.browserAction : undefined;
 // #!endif
+
+export default actionApi;
diff --git a/src/common/api.js b/src/common/api.js
index 11c0ad6..8e0c19b 100644
--- a/src/common/api.js
+++ b/src/common/api.js
@@ -28,13 +28,14 @@
   let authuserPart =
       authuser == '0' ? '' : '?authuser=' + encodeURIComponent(authuser);
 
+  let context;
   // #!if browser_target == 'gecko'
   // See
   // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts#xhr_and_fetch
   // and https://developer.mozilla.org/en-US/docs/Web/API/Window/content.
-  const context = window.content || window;
+  context = window.content || window;
   // #!else
-  const context = window;
+  context = window;
   // #!endif
 
   return context