Created
July 18, 2022 14:11
-
-
Save itsMapleLeaf/2dae780c9a900352eefb848c4bdc5543 to your computer and use it in GitHub Desktop.
typed context bridge global; context: https://www.electronjs.org/docs/latest/tutorial/tutorial-preload#augmenting-the-renderer-with-a-preload-script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { contextBridge } = require('electron') | |
const versionsGlobal = { | |
node: () => process.versions.node, | |
chrome: () => process.versions.chrome, | |
electron: () => process.versions.electron, | |
} | |
contextBridge.exposeInMainWorld('versions', versionsGlobal) | |
declare global { | |
var versions: typeof versionsGlobal | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment