當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。