本文整理匯總了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']);