当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript electron-devtools-installer.default函数代码示例

本文整理汇总了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);
  }
}
开发者ID:pschild,项目名称:image-management-tool,代码行数:11,代码来源:main.ts

示例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);
        }
    }
};
开发者ID:defvar,项目名称:toyctron,代码行数:14,代码来源:main.ts

示例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
}
开发者ID:tamdao,项目名称:desktop,代码行数:42,代码来源:main.ts

示例4:

 extensions.map(name => installer.default(installer[name], forceDownload))
开发者ID:weifuchuan,项目名称:fetcher,代码行数:1,代码来源:main.dev.ts

示例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);
   });
 });
开发者ID:greg9504,项目名称:angular-electron-dream-starter,代码行数:7,代码来源:dev-extensions.ts

示例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
    })
}
开发者ID:coffeecup-winner,项目名称:unwind-mc,代码行数:18,代码来源:main.ts

示例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');
开发者ID:DavidKDeutsch,项目名称:DefinitelyTyped,代码行数:20,代码来源:electron-devtools-installer-tests.ts

示例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']);
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:24,代码来源:electron-devtools-installer-tests.ts


注:本文中的electron-devtools-installer.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。