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


TypeScript electron.ipcRenderer类代码示例

本文整理汇总了TypeScript中electron.ipcRenderer的典型用法代码示例。如果您正苦于以下问题:TypeScript ipcRenderer类的具体用法?TypeScript ipcRenderer怎么用?TypeScript ipcRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ipcRenderer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: attachTo

function attachTo(item: ProcessItem) {
	const config: any = {
		type: 'node',
		request: 'attach',
		name: `process ${item.pid}`
	};

	let matches = DEBUG_FLAGS_PATTERN.exec(item.cmd);
	if (matches && matches.length >= 2) {
		// attach via port
		if (matches.length === 4 && matches[3]) {
			config.port = parseInt(matches[3]);
		}
		config.protocol = matches[1] === 'debug' ? 'legacy' : 'inspector';
	} else {
		// no port -> try to attach via pid (send SIGUSR1)
		config.processId = String(item.pid);
	}

	// a debug-port=n or inspect-port=n overrides the port
	matches = DEBUG_PORT_PATTERN.exec(item.cmd);
	if (matches && matches.length === 3) {
		// override port
		config.port = parseInt(matches[2]);
	}

	ipcRenderer.send('vscode:workbenchCommand', { id: 'debug.startFromConfig', from: 'processExplorer', args: [config] });
}
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:28,代码来源:processExplorerMain.ts

示例2: getSelectedClients

    this.$['save-btn'].addEventListener('click', () => {
      const clients = getSelectedClients(grid)
      if (clients.length) {
        const opts = {}

        ipcRenderer.send('invoice-save', clients, this.getInvoiceData(), opts)
      }
    })
开发者ID:ilmaria,项目名称:laskutus-electron,代码行数:8,代码来源:invoice-page.ts

示例3: okay

function okay(){
    ipcRenderer.send('color-okay', {
        gameObjectId: gameObjectId,
        componentId: componentId,
        propertyName: propertyName,
        hexColor: selectedColor.hex
    });
}
开发者ID:TheColorRed,项目名称:game-engine,代码行数:8,代码来源:color.ts

示例4: next

export const backendMiddleware: Middleware = <AppState>(store: MiddlewareAPI<AppState>) => (next: Dispatch<AppState>) => (originalAction: any) => {
    const result = next(originalAction);
    const action: AppAction = originalAction as any;

    ipcRenderer.send('action', [store.getState(), action]);

    return result
}
开发者ID:istvan-antal,项目名称:copycat,代码行数:8,代码来源:store.ts

示例5: navigatePaymentUrl

function navigatePaymentUrl(payload: string) {
    const settings = getSettings();
    Electron.ipcRenderer.send("createCheckoutWindow", {
        payload: payload,
        settings: settings,
        serviceUrl: Emulator.serviceUrl
    });
}
开发者ID:kpreeti096,项目名称:BotFramework-Emulator,代码行数:8,代码来源:hyperlinkHandler.ts

示例6: okay

function okay(value: string) {
    ipcRenderer.send('selector-okay', {
        gameObjectId: gameObjectId,
        componentId: componentId,
        propertyName: propertyName,
        value: value
    });
}
开发者ID:TheColorRed,项目名称:game-engine,代码行数:8,代码来源:selector.ts

示例7:

 (e: any, webContentsId: number) => {
   let sent = false;
   for (const page of store.pagesStore.pages) {
     if (
       page.webview.getWebContents() &&
       page.webview.getWebContents().id === webContentsId
     ) {
       const tab = store.tabsStore.getTabById(page.id).getApiTab();
       ipcRenderer.send('get-tab-by-web-contents-id', tab);
       sent = true;
       break;
     }
   }
   if (!sent) {
     ipcRenderer.send('get-tab-by-web-contents-id', {});
   }
 },
开发者ID:laquereric,项目名称:wexond,代码行数:17,代码来源:index.ts

示例8: getUser

 getUser(user:User) {
   ipcRenderer.send('getUser', user)
    return new Promise<User>((resolve, reject) => {
      ipcRenderer.once('user-reply', (event, arg) => {
        resolve(arg);
      });
   });
 }
开发者ID:sam-soltech,项目名称:gulp-ang2-electron,代码行数:8,代码来源:user.service.ts

示例9: navigateOAuthUrl

function navigateOAuthUrl(url: string) {
    const settings = getSettings();
    Electron.ipcRenderer.send("createOAuthWindow", {
        url: url,
        settings: settings,
        serviceUrl: Emulator.serviceUrl
    });
}
开发者ID:kpreeti096,项目名称:BotFramework-Emulator,代码行数:8,代码来源:hyperlinkHandler.ts

示例10: constructor

    constructor(private readonly config: Config) {
        this.switchTo(this.getFirstScreenName());

        // After hiding window, <webview> loses its focus.
        // So when window is shown again, need to give <webview> focus again.
        // Note:
        // remove.getCurrentWindow().on('focus', ...) is unavailable
        // because callback remains after this web contents reloaded.
        // Remained callback causes a 'trying to send message to removed web contents'
        // error.
        ipc.on('tuitter:window-focused', () => this.wv.focus());
        ipc.on('tuitter:menu:new-tweet', () => this.wv.sendIpc('tuitter:new-tweet'));
        ipc.on('tuitter:will-suspend', (__: any, threshold: number) => {
            log.debug('Refresh app because system will be suspended. Threshold:', threshold, this.wv);
            this.wv.sendIpc('tuitter:will-suspend', threshold);
        });
    }
开发者ID:rhysd,项目名称:Tui,代码行数:17,代码来源:app.ts


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