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