Skip to content

Commit

Permalink
docs: remove redundant IPC event sections (#39133)
Browse files Browse the repository at this point in the history
* docs: use correct names for IPC events

* docs: remove redundant IPC event sections
  • Loading branch information
dsanders11 committed Jul 20, 2023
1 parent 6688b0f commit 3a5e2dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
13 changes: 1 addition & 12 deletions docs/api/ipc-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ provided to the renderer process. Please refer to

* `channel` string
* `listener` Function<Promise\<void&#62; | any&#62;
* `event` IpcMainInvokeEvent
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `...args` any[]

Handles a single `invoke`able IPC message, then removes the listener. See
Expand All @@ -122,17 +122,6 @@ Handles a single `invoke`able IPC message, then removes the listener. See

Removes any handler for `channel`, if present.

## IpcMainEvent object

The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-main-event`][ipc-main-event] structure docs.

## IpcMainInvokeEvent object

The documentation for the `event` object passed to `handle` callbacks can be
found in the [`ipc-main-invoke-event`][ipc-main-invoke-event]
structure docs.

[IPC tutorial]: ../tutorial/ipc.md
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[web-contents-send]: ../api/web-contents.md#contentssendchannel-args
Expand Down
10 changes: 3 additions & 7 deletions docs/api/ipc-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The `ipcRenderer` module has the following method to listen for events and send

* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `event` [IpcRendererEvent][ipc-renderer-event]
* `...args` any[]

Listens to `channel`, when a new message arrives `listener` would be called with
Expand All @@ -36,7 +36,7 @@ Listens to `channel`, when a new message arrives `listener` would be called with

* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `event` [IpcRendererEvent][ipc-renderer-event]
* `...args` any[]

Adds a one time `listener` function for the event. This `listener` is invoked
Expand Down Expand Up @@ -208,12 +208,8 @@ Sends a message to a window with `webContentsId` via `channel`.
Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
the host page instead of the main process.

## Event object

The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-renderer-event`](./structures/ipc-renderer-event.md) structure docs.

[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`window.postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
[ipc-renderer-event]: ./structures/ipc-renderer-event.md

0 comments on commit 3a5e2dd

Please sign in to comment.