diff --git a/desktop/package.json b/desktop/package.json
index 09d14fdd1..ecfe80e2c 100644
--- a/desktop/package.json
+++ b/desktop/package.json
@@ -1,42 +1,43 @@
 {
   "workspaces": {
     "nohoist": [
       "**"
     ]
   },
   "name": "desktop",
   "version": "0.0.1",
   "type": "module",
   "main": "./dist/main.js",
   "private": true,
   "license": "BSD-3-Clause",
   "scripts": {
     "dev": "ENV=dev electron-forge start",
     "package": "electron-forge package",
     "make": "electron-forge make",
     "clean": "rm -rf assets/ && rm -rf dist/ && yarn clean-build && rm -rf node_modules/",
     "clean-build": "rm -rf out/"
   },
   "dependencies": {
     "@babel/runtime": "^7.20.1"
   },
   "devDependencies": {
     "@babel/core": "^7.13.14",
     "@babel/plugin-proposal-class-properties": "^7.13.0",
     "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
     "@babel/plugin-proposal-object-rest-spread": "^7.13.8",
     "@babel/plugin-proposal-optional-chaining": "^7.13.12",
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
     "@babel/plugin-transform-runtime": "^7.13.10",
     "@babel/preset-env": "^7.13.12",
     "@electron-forge/cli": "^6.0.4",
     "@electron-forge/maker-dmg": "^6.0.4",
     "@electron-forge/maker-squirrel": "^6.0.4",
     "@electron-forge/plugin-base": "^6.0.4",
     "electron": "^22.0.0",
     "flow-bin": "^0.182.0",
     "flow-typed": "^3.2.1",
+    "lib": "0.0.1",
     "fs-extra": "^10.1.0",
     "klaw": "^4.0.1"
   }
 }
diff --git a/desktop/src/preload.js b/desktop/src/preload.js
index e4f06e0da..eca154259 100644
--- a/desktop/src/preload.js
+++ b/desktop/src/preload.js
@@ -1,16 +1,18 @@
 // @flow
 
 import { contextBridge, ipcRenderer } from 'electron';
 
-const bridge = {
+import type { ElectronBridge } from 'lib/types/electron-types';
+
+const bridge: ElectronBridge = {
   onNavigate: callback => {
     const withEvent = (event, ...args) => callback(...args);
     ipcRenderer.on('on-navigate', withEvent);
     return () => ipcRenderer.removeListener('on-navigate', withEvent);
   },
   clearHistory: () => ipcRenderer.send('clear-history'),
   doubleClickTopBar: () => ipcRenderer.send('double-click-top-bar'),
   setBadge: value => ipcRenderer.send('set-badge', value),
 };
 
 contextBridge.exposeInMainWorld('electronContextBridge', bridge);
diff --git a/lib/types/electron-types.js b/lib/types/electron-types.js
new file mode 100644
index 000000000..b3e7a87f2
--- /dev/null
+++ b/lib/types/electron-types.js
@@ -0,0 +1,14 @@
+// @flow
+
+type OnNavigateListener = ({
+  +canGoBack: boolean,
+  +canGoForward: boolean,
+}) => void;
+
+export type ElectronBridge = {
+  // Returns a callback that you can call to remove the listener
+  +onNavigate: OnNavigateListener => () => void,
+  +clearHistory: () => void,
+  +doubleClickTopBar: () => void,
+  +setBadge: (number | string | null) => void,
+};
diff --git a/web/electron.js b/web/electron.js
index 00d7b7702..5a9bee93f 100644
--- a/web/electron.js
+++ b/web/electron.js
@@ -1,21 +1,10 @@
 // @flow
 
-type ElectronContextBridge = {
-  // Returns a callback that you can call to remove the listener
-  +onNavigate: OnNavigateListener => () => void,
-  +clearHistory: () => void,
-  +doubleClickTopBar: () => void,
-  +setBadge: (value: string | number | null) => void,
-};
+import type { ElectronBridge } from 'lib/types/electron-types';
 
-type OnNavigateListener = ({
-  +canGoBack: boolean,
-  +canGoForward: boolean,
-}) => void;
+declare var electronContextBridge: void | ElectronBridge;
 
-declare var electronContextBridge: ?ElectronContextBridge;
-
-const electron: null | ElectronContextBridge =
+const electron: ?ElectronBridge =
   typeof electronContextBridge === 'undefined' ? null : electronContextBridge;
 
 export default electron;