本文整理汇总了TypeScript中electron-devtools-installer.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: installDevtoolExtensions
async function installDevtoolExtensions() {
const installExtension = require('electron-devtools-installer').default;
const { REDUX_DEVTOOLS } = require('electron-devtools-installer');
try {
await installExtension(REDUX_DEVTOOLS);
console.log('Installed extension: REDUX_DEVTOOLS');
} catch (error) {
console.log('Error occurred when installing devtool:', error);
}
}
示例2: async
const installExtensions = async () => {
if (process.env.NODE_ENV === "development") {
try {
const installer = require("electron-devtools-installer");
const extensions = ["REACT_DEVELOPER_TOOLS", "REDUX_DEVTOOLS"];
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
for (const name of extensions) {
await installer.default(installer[name], forceDownload);
}
} catch (e) {
console.error(e);
}
}
};
示例3: createWindow
function createWindow() {
const window = new AppWindow()
if (__DEV__) {
const installer = require('electron-devtools-installer')
require('electron-debug')({ showDevTools: true })
const extensions = ['REACT_DEVELOPER_TOOLS', 'REACT_PERF']
for (const name of extensions) {
try {
installer.default(installer[name])
} catch (e) {}
}
}
window.onClose(() => {
mainWindow = null
if (!__DARWIN__ && !preventQuit) {
app.quit()
}
})
window.onDidLoad(() => {
window.show()
window.sendLaunchTimingStats({
mainReadyTime: readyTime!,
loadTime: window.loadTime!,
rendererReadyTime: window.rendererReadyTime!,
})
const fns = onDidLoadFns!
onDidLoadFns = null
for (const fn of fns) {
fn(window)
}
})
window.load()
mainWindow = window
}
示例4:
extensions.map(name => installer.default(installer[name], forceDownload))
示例5: installExtension
extensions.forEach(ext => {
installExtension(ext.id).then(() => {
console.log(ext.name + ' installed in ' + userDataPath);
}).catch(err => {
console.error('Failed to install ' + ext.name, err);
});
});
示例6: installExtension
const createWindow = async () => {
window = new BrowserWindow({
title: `Unwind MC v${unwindmc.version()}`,
width: 1024,
height: 768,
webPreferences: {
nodeIntegration: true,
},
})
window.loadURL(`file://${__dirname}/index.jade`)
if (isDevMode) {
await installExtension(VUEJS_DEVTOOLS)
window.webContents.openDevTools({mode: 'bottom'})
}
window.on('closed', () => {
window = null
})
}
示例7:
/// <reference path="../electron/github-electron.d.ts" />
/// <reference path="electron-devtools-installer.d.ts" />
import installExtension, {
EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS,
BACKBONE_DEBUGGER, JQUERY_DEBUGGER,
ANGULARJS_BATARANG, VUEJS_DEVTOOLS,
REDUX_DEVTOOLS, REACT_PERF,
} from 'electron-devtools-installer';
installExtension(EMBER_INSPECTOR);
installExtension(REACT_DEVELOPER_TOOLS);
installExtension(BACKBONE_DEBUGGER);
installExtension(JQUERY_DEBUGGER);
installExtension(ANGULARJS_BATARANG);
installExtension(VUEJS_DEVTOOLS);
installExtension(REDUX_DEVTOOLS);
installExtension(REACT_PERF);
installExtension('abcdefghijkl');
示例8:
import installExtension, {
EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS,
BACKBONE_DEBUGGER, JQUERY_DEBUGGER,
ANGULARJS_BATARANG, VUEJS_DEVTOOLS,
REDUX_DEVTOOLS, REACT_PERF,
CYCLEJS_DEVTOOL, APOLLO_DEVELOPER_TOOLS,
MOBX_DEVTOOLS
} from 'electron-devtools-installer';
installExtension(EMBER_INSPECTOR);
installExtension(REACT_DEVELOPER_TOOLS);
installExtension(BACKBONE_DEBUGGER);
installExtension(JQUERY_DEBUGGER);
installExtension(ANGULARJS_BATARANG);
installExtension(VUEJS_DEVTOOLS);
installExtension(REDUX_DEVTOOLS);
installExtension(REACT_PERF);
installExtension(CYCLEJS_DEVTOOL);
installExtension(APOLLO_DEVELOPER_TOOLS);
installExtension(MOBX_DEVTOOLS);
installExtension('abcdefghijkl');
installExtension([EMBER_INSPECTOR, JQUERY_DEBUGGER]);
installExtension(['extension', 'another-extension']);
installExtension([REACT_DEVELOPER_TOOLS, 'MOBX_DEVTOOLS']);