mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: update @electron/lint-roller and improve doc type checks (#39262)
This commit is contained in:
@@ -126,7 +126,7 @@ app.whenReady().then(async () => {
|
||||
Then, in your preload scripts you receive the port through IPC and set up the
|
||||
listeners.
|
||||
|
||||
```js title='preloadMain.js and preloadSecondary.js (Preload scripts)' @ts-nocheck
|
||||
```js title='preloadMain.js and preloadSecondary.js (Preload scripts)' @ts-window-type={electronMessagePort:MessagePort}
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
ipcRenderer.on('port', e => {
|
||||
@@ -148,7 +148,7 @@ That means window.electronMessagePort is globally available and you can call
|
||||
`postMessage` on it from anywhere in your app to send a message to the other
|
||||
renderer.
|
||||
|
||||
```js title='renderer.js (Renderer Process)' @ts-nocheck
|
||||
```js title='renderer.js (Renderer Process)' @ts-window-type={electronMessagePort:MessagePort}
|
||||
// elsewhere in your code to send a message to the other renderers message handler
|
||||
window.electronMessagePort.postMessage('ping')
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user