From 31494dfade7762c62a6ce33701140497693d4543 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Thu, 14 Feb 2019 06:04:53 -0800 Subject: [PATCH] refactor: Port getRemote to TypeScript (#16938) * chore: make aliasify work on .ts files as well * refactor: Port getRemote to TypeScript * refactor: Implement feedback <3 --- filenames.gni | 2 +- lib/renderer/{remote.js => remote.ts} | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) rename lib/renderer/{remote.js => remote.ts} (55%) diff --git a/filenames.gni b/filenames.gni index 5cbcbe9768..d851c5a105 100644 --- a/filenames.gni +++ b/filenames.gni @@ -69,7 +69,7 @@ filenames = { "lib/renderer/inspector.js", "lib/renderer/ipc-renderer-internal-utils.ts", "lib/renderer/ipc-renderer-internal.js", - "lib/renderer/remote.js", + "lib/renderer/remote.ts", "lib/renderer/security-warnings.js", "lib/renderer/web-frame-init.js", "lib/renderer/window-setup.ts", diff --git a/lib/renderer/remote.js b/lib/renderer/remote.ts similarity index 55% rename from lib/renderer/remote.js rename to lib/renderer/remote.ts index 579505a526..ea410ffbfb 100644 --- a/lib/renderer/remote.js +++ b/lib/renderer/remote.ts @@ -1,8 +1,6 @@ -'use strict' +import { remote } from 'electron' -const { remote } = require('electron') - -exports.getRemote = function (name) { +export function getRemote (name: keyof Electron.Remote) { if (!remote) { throw new Error(`${name} requires remote, which is not enabled`) }