8000 docs: no class inheritance (#47432) · electron/electron@47caba6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47caba6

Browse files
trop[bot]erickzhaoandauthored
docs: no class inheritance (#47432)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
1 parent 15e536b commit 47caba6

15 files changed

+67
-6
lines changed

docs/api/base-window.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ Process: [Main](../glossary.md#main-process)
9999

100100
It creates a new `BaseWindow` with native properties as set by the `options`.
101101

102+
> [!WARNING]
103+
> Electron's built-in classes cannot be subclassed in user code.
104+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
105+
102106
### `new BaseWindow([options])`
103107

104108
* `options` [BaseWindowConstructorOptions](structures/base-window-options.md?inline) (optional)

docs/api/browser-view.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Process: [Main](../glossary.md#main-process)
3838
This module cannot be used until the `ready` event of the `app`
3939
module is emitted.
4040

41+
> [!WARNING]
42+
> Electron's built-in classes cannot be subclassed in user code.
43+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
44+
4145
### Example
4246

4347
```js

docs/api/browser-window.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ Process: [Main](../glossary.md#main-process)
150150

151151
It creates a new `BrowserWindow` with native properties as set by the `options`.
152152

153+
> [!WARNING]
154+
> Electron's built-in classes cannot be subclassed in user code.
155+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
156+
153157
### `new BrowserWindow([options])`
154158

155159
* `options` [BrowserWindowConstructorOptions](structures/browser-window-options.md?inline) (optional)

docs/api/image-view.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Process: [Main](../glossary.md#main-process)
4242

4343
`ImageView` is an [EventEmitter][event-emitter].
4444

45+
> [!WARNING]
46+
> Electron's built-in classes cannot be subclassed in user code.
47+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
48+
4549
### `new ImageView()` _Experimental_
4650

4751
Creates an ImageView.

docs/api/ipc-main-service-worker.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Process: [Main](../glossary.md#main-process)
1111
1212
<!-- TODO(samuelmaddock): refactor doc gen to allow generics to reduce duplication -->
1313

14+
> [!WARNING]
15+
> Electron's built-in classes cannot be subclassed in user code.
16+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
17+
1418
### Instance Methods
1519

1620
#### `ipcMainServiceWorker.on(channel, listener)`

docs/api/menu-item.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Process: [Main](../glossary.md#main-process)
< A935 /div>
66

77
See [`Menu`](menu.md) for examples.
88

9+
> [!WARNING]
10+
> Electron's built-in classes cannot be subclassed in user code.
11+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
12+
913
### `new MenuItem(options)`
1014

1115
* `options` Object

docs/api/menu.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
77
Process: [Main](../glossary.md#main-process)
88

9+
> [!WARNING]
10+
> Electron's built-in classes cannot be subclassed in user code.
11+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
12+
913
### `new Menu()`
1014

1115
Creates a new menu.

docs/api/message-channel-main.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ ipcRenderer.on('port', (e) => {
3333
})
3434
```
3535

36+
> [!WARNING]
37+
> Electron's built-in classes cannot be subclassed in user code.
38+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
39+
3640
### Instance Properties
3741

3842
#### `channel.port1`

docs/api/notification.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
55
Process: [Main](../glossary.md#main-process)
66

7-
:::info Renderer process notifications
8-
9-
If you want to show notifications from a renderer process you should use the
10-
[web Notifications API](../tutorial/notifications.md)
11-
12-
:::
7+
> [!NOTE]
8+
> If you want to show notifications from a renderer process you should use the
9+
> [web Notifications API](../tutorial/notifications.md)
1310
1411
## Class: Notification
1512

@@ -21,6 +18,10 @@ Process: [Main](../glossary.md#main-process)
2118

2219
It creates a new `Notification` with native properties as set by the `options`.
2320

21+
> [!WARNING]
22+
> Electron's built-in classes cannot be subclassed in user code.
23+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
24+
2425
### Static Methods
2526

2627
The `Notification` class has the following static methods:

docs/api/share-menu.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ For including the share menu as a submenu of other menus, please use the
1313
1414
Process: [Main](../glossary.md#main-process)
1515

16+
> [!WARNING]
17+
> Electron's built-in classes cannot be subclassed in user code.
18+
> For more information, see [the FAQ](../faq.md#class-inheritance-does-not-work-with-electron-built-in-modules).
19+
1620
### `new ShareMenu(sharingItem)`
1721

1822
* `sharingItem` SharingItem - The item to share.

0 commit comments

Comments
 (0)
0