electron/lib/renderer/remote.ts
Felix Rieseberg 31494dfade refactor: Port getRemote to TypeScript (#16938)
* chore: make aliasify work on .ts files as well

* refactor: Port getRemote to TypeScript

* refactor: Implement feedback <3
2019-02-14 04:04:53 -10:00

8 lines
207 B
TypeScript

import { remote } from 'electron'
export function getRemote (name: keyof Electron.Remote) {
if (!remote) {
throw new Error(`${name} requires remote, which is not enabled`)
}
return remote[name]
}