chore: update @electron/lint-roller and improve doc type checks (#39262)

This commit is contained in:
David Sanders
2023-07-31 01:39:01 -07:00
committed by GitHub
parent 2b283724ce
commit 68701c4c3c
6 changed files with 22 additions and 16 deletions

View File

@@ -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')
```