Skip to content

Commit 70e7eb8

Browse files
chore: update ref to docs (🤖) (#1109)
Co-authored-by: electron-website-docs-updater[bot] <166660481+electron-website-docs-updater[bot]@users.noreply.github.com>
1 parent 16a71ff commit 70e7eb8

32 files changed

Lines changed: 711 additions & 129 deletions

‎docs/latest/.eslintrc.json‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎docs/latest/.sha‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7f51178371e9a3f4c098436ec3ef8a18316fad73
1+
51db52e1b56e0739944dfbc679a86f2c69a26e5f

‎docs/latest/CLAUDE.md‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: "Electron Documentation Guide"
3+
description: "Guide: docs/development/api-history-migration-guide.md Style rules: docs/development/style-guide.md (see \"API History\" section) Schema: docs/api-history.schema.json Lint: npm run lint:api-history"
4+
slug: CLAUDE
5+
hide_title: false
6+
---
7+
8+
# Electron Documentation Guide
9+
10+
## API History Migration
11+
12+
Guide: `docs/development/api-history-migration-guide.md`
13+
Style rules: `docs/development/style-guide.md` (see "API History" section)
14+
Schema: `docs/api-history.schema.json`
15+
Lint: `npm run lint:api-history`
16+
17+
### Format
18+
19+
Place YAML history block directly after the Markdown header, before parameters:
20+
21+
````md
22+
### `module.method(args)`
23+
24+
<!--
25+
```YAML history
26+
added:
27+
- pr-url: https://github.com/electron/electron/pull/XXXXX
28+
```
29+
-->
30+
31+
* `arg` type - Description.
32+
````
33+
34+
### Finding when an API was added
35+
36+
- `git log --all --reverse --oneline -S "methodName" -- docs/api/file.md` — find first commit adding a method name
37+
- `git log --reverse -L :FunctionName:path/to/source.cc` — trace C++ implementation history
38+
- `git log --grep="keyword" --oneline` — find merge commits referencing PRs
39+
- `gh pr view <number> --repo electron/electron --json baseRefName` — verify PR targets main (not a backport)
40+
- Always use the main-branch PR URL in history blocks, not backport PRs
41+
42+
### Cross-referencing breaking changes
43+
44+
- Search `docs/breaking-changes.md` for the API name to find deprecations/removals
45+
- Use `git blame` on the breaking-changes entry to find the associated PR
46+
- Add `breaking-changes-header` field using the heading ID from breaking-changes.md
47+
48+
### Placement rules
49+
50+
- Only add blocks to actual API entries (methods, events, properties with backtick signatures)
51+
- Do NOT add blocks to section headers like `## Methods`, `### Instance Methods`, `## Events`
52+
- Module-level blocks go after the `# moduleName` heading, before the module description quote
53+
- For changes affecting multiple APIs, add a block under each affected top-level heading (see style guide "Change affecting multiple APIs")
54+
55+
### Key details
56+
57+
- `added` and `deprecated` arrays have `maxItems: 1`; `changes` can have multiple items
58+
- `changes` entries require a `description` field; `added`/`deprecated` do not
59+
- Wrap descriptions in double quotes to avoid YAML parsing issues with special characters
60+
- Early Electron APIs (pre-2015) use merge-commit PRs (e.g., `Merge pull request #534`)
61+
- Very early APIs (2013-2014, e.g., `ipcMain.on`, `ipcRenderer.send`) predate GitHub PRs — skip history blocks for these
62+
- When multiple APIs were added in the same PR, they all reference the same PR URL
63+
- Promisification PRs (e.g., #17355) count as `changes` entries with a description
64+
- These PRs are breaking changes and should have their notes as "This method now returns a Promise instead of using a callback function."
65+
- APIs that were deprecated and then removed from docs don't need history blocks (the removal is in `breaking-changes.md`)

‎docs/latest/api/app.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ focus but may instead show a notification or flash the app icon (Wayland).
580580

581581
You should seek to use the `steal` option as sparingly as possible.
582582

583+
### `app.isActive()` _macOS_
584+
585+
Returns `boolean` - `true` if the application is active (i.e. focused).
586+
583587
### `app.hide()` _macOS_
584588

585589
Hides all application windows without minimizing them.
@@ -618,7 +622,11 @@ Returns `string` - The current application directory.
618622
by default is the `appData` directory appended with your app's name. By
619623
convention files storing user data should be written to this directory, and
620624
it is not recommended to write large files here because some environments
621-
may backup this directory to cloud storage.
625+
may backup this directory to cloud storage. It is recommended to store
626+
app-specific files within a subdirectory of `userData` (e.g.,
627+
`path.join(app.getPath('userData'), 'my-app-data')`) rather than directly
628+
in `userData` itself, to avoid naming conflicts with Chromium's own
629+
subdirectories (such as `Cache`, `GPUCache`, and `Local Storage`).
622630
* `sessionData` The directory for storing data generated by `Session`, such
623631
as localStorage, cookies, disk cache, downloaded dictionaries, network
624632
state, DevTools files. By default this points to `userData`. Chromium may

‎docs/latest/api/cookies.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ the response.
114114
cookie and will not be retained between sessions.
115115
* `sameSite` string (optional) - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `lax`.
116116

117-
Returns `Promise<void>` - A promise which resolves when the cookie has been set
117+
Returns `Promise<void>` - A promise which resolves when the cookie has been set.
118118

119119
Sets a cookie with `details`.
120120

@@ -123,16 +123,16 @@ Sets a cookie with `details`.
123123
* `url` string - The URL associated with the cookie.
124124
* `name` string - The name of cookie to remove.
125125

126-
Returns `Promise<void>` - A promise which resolves when the cookie has been removed
126+
Returns `Promise<void>` - A promise which resolves when the cookie has been removed.
127127

128-
Removes the cookies matching `url` and `name`
128+
Removes the cookies matching `url` and `name`.
129129

130130
#### `cookies.flushStore()`
131131

132-
Returns `Promise<void>` - A promise which resolves when the cookie store has been flushed
132+
Returns `Promise<void>` - A promise which resolves when the cookie store has been flushed.
133133

134-
Writes any unwritten cookies data to disk
134+
Writes any unwritten cookies data to disk.
135135

136-
Cookies written by any method will not be written to disk immediately, but will be written every 30 seconds or 512 operations
136+
Cookies written by any method will not be written to disk immediately, but will be written every 30 seconds or 512 operations.
137137

138138
Calling this method can cause the cookie to be written to disk immediately.

‎docs/latest/api/global-shortcut.md‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ The `globalShortcut` module has the following methods:
6262

6363
### `globalShortcut.register(accelerator, callback)`
6464

65+
```YAML history
66+
added:
67+
- pr-url: https://github.com/electron/electron/pull/534
68+
```
69+
6570
* `accelerator` string - An [accelerator](../tutorial/keyboard-shortcuts.md#accelerators) shortcut.
6671
* `callback` Function
6772

@@ -84,6 +89,11 @@ the app has been authorized as a [trusted accessibility client](https://develope
8489

8590
### `globalShortcut.registerAll(accelerators, callback)`
8691

92+
```YAML history
93+
added:
94+
- pr-url: https://github.com/electron/electron/pull/15542
95+
```
96+
8797
* `accelerators` string[] - An array of [accelerator](../tutorial/keyboard-shortcuts.md#accelerators) shortcuts.
8898
* `callback` Function
8999

@@ -103,6 +113,11 @@ the app has been authorized as a [trusted accessibility client](https://develope
103113

104114
### `globalShortcut.isRegistered(accelerator)`
105115

116+
```YAML history
117+
added:
118+
- pr-url: https://github.com/electron/electron/pull/534
119+
```
120+
106121
* `accelerator` string - An [accelerator](../tutorial/keyboard-shortcuts.md#accelerators) shortcut.
107122

108123
Returns `boolean` - Whether this application has registered `accelerator`.
@@ -113,10 +128,47 @@ don't want applications to fight for global shortcuts.
113128

114129
### `globalShortcut.unregister(accelerator)`
115130

131+
```YAML history
132+
added:
133+
- pr-url: https://github.com/electron/electron/pull/534
134+
```
135+
116136
* `accelerator` string - An [accelerator](../tutorial/keyboard-shortcuts.md#accelerators) shortcut.
117137

118138
Unregisters the global shortcut of `accelerator`.
119139

120140
### `globalShortcut.unregisterAll()`
121141

142+
```YAML history
143+
added:
144+
- pr-url: https://github.com/electron/electron/pull/534
145+
```
146+
122147
Unregisters all of the global shortcuts.
148+
149+
### `globalShortcut.setSuspended(suspended)`
150+
151+
```YAML history
152+
added:
153+
- pr-url: https://github.com/electron/electron/pull/50425
154+
```
155+
156+
* `suspended` boolean - Whether global shortcut handling should be suspended.
157+
158+
Suspends or resumes global shortcut handling. When suspended, all registered
159+
global shortcuts will stop listening for key presses. When resumed, all
160+
previously registered shortcuts will begin listening again. New shortcut
161+
registrations will fail while handling is suspended.
162+
163+
This can be useful when you want to temporarily allow the user to press key
164+
combinations without your application intercepting them, for example while
165+
displaying a UI to rebind shortcuts.
166+
167+
### `globalShortcut.isSuspended()`
168+
169+
```YAML history
170+
added:
171+
- pr-url: https://github.com/electron/electron/pull/50425
172+
```
173+
174+
Returns `boolean` - Whether global shortcut handling is currently suspended.

‎docs/latest/api/image-view.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ webContentsView.webContents.loadURL('https://electronjs.org')
4242

4343
## Class: ImageView extends `View`
4444

45+
```YAML history
46+
added:
47+
- pr-url: https://github.com/electron/electron/pull/46760
48+
```
49+
4550
> A View that displays an image.
4651
4752
Process: [Main](../glossary.md#main-process)
@@ -56,6 +61,11 @@ Process: [Main](../glossary.md#main-process)
5661

5762
### `new ImageView()` _Experimental_
5863

64+
```YAML history
65+
added:
66+
- pr-url: https://github.com/electron/electron/pull/46760
67+
```
68+
5969
Creates an ImageView.
6070

6171
### Instance Methods
@@ -65,6 +75,11 @@ addition to those inherited from [View](view.md):
6575

6676
#### `image.setImage(image)` _Experimental_
6777

78+
```YAML history
79+
added:
80+
- pr-url: https://github.com/electron/electron/pull/46760
81+
```
82+
6883
* `image` NativeImage
6984

7085
Sets the image for this `ImageView`. Note that only image formats supported by

‎docs/latest/api/in-app-purchase.md‎

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
---
22
title: "inAppPurchase"
3-
description: "In-app purchases on Mac App Store."
3+
description: "YAML history added: - pr-url: https://github.com/electron/electron/pull/11292"
44
slug: in-app-purchase
55
hide_title: false
66
---
77

88
# inAppPurchase
99

10+
```YAML history
11+
added:
12+
- pr-url: https://github.com/electron/electron/pull/11292
13+
```
14+
1015
> In-app purchases on Mac App Store.
1116
1217
Process: [Main](../glossary.md#main-process)
@@ -17,6 +22,11 @@ The `inAppPurchase` module emits the following events:
1722

1823
### Event: 'transactions-updated'
1924

25+
```YAML history
26+
added:
27+
- pr-url: https://github.com/electron/electron/pull/11292
28+
```
29+
2030
Returns:
2131

2232
* `event` Event
@@ -30,6 +40,17 @@ The `inAppPurchase` module has the following methods:
3040

3141
### `inAppPurchase.purchaseProduct(productID[, opts])`
3242

43+
```YAML history
44+
added:
45+
- pr-url: https://github.com/electron/electron/pull/11292
46+
changes:
47+
- pr-url: https://github.com/electron/electron/pull/17355
48+
description: "This method now returns a Promise instead of using a callback function."
49+
breaking-changes-header: api-changed-callback-based-versions-of-promisified-apis
50+
- pr-url: https://github.com/electron/electron/pull/35902
51+
description: "Added `username` option to `opts` parameter."
52+
```
53+
3354
* `productID` string
3455
* `opts` Integer | Object (optional) - If specified as an integer, defines the quantity.
3556
* `quantity` Integer (optional) - The number of items the user wants to purchase.
@@ -41,6 +62,15 @@ You should listen for the `transactions-updated` event as soon as possible and c
4162

4263
### `inAppPurchase.getProducts(productIDs)`
4364

65+
```YAML history
66+
added:
67+
- pr-url: https://github.com/electron/electron/pull/12464
68+
changes:
69+
- pr-url: https://github.com/electron/electron/pull/17355
70+
description: "This method now returns a Promise instead of using a callback function."
71+
breaking-changes-header: api-changed-callback-based-versions-of-promisified-apis
72+
```
73+
4474
* `productIDs` string[] - The identifiers of the products to get.
4575

4676
Returns `Promise<Product[]>` - Resolves with an array of [`Product`](structures/product.md) objects.
@@ -49,24 +79,49 @@ Retrieves the product descriptions.
4979

5080
### `inAppPurchase.canMakePayments()`
5181

82+
```YAML history
83+
added:
84+
- pr-url: https://github.com/electron/electron/pull/11292
85+
```
86+
5287
Returns `boolean` - whether a user can make a payment.
5388

5489
### `inAppPurchase.restoreCompletedTransactions()`
5590

91+
```YAML history
92+
added:
93+
- pr-url: https://github.com/electron/electron/pull/21461
94+
```
95+
5696
Restores finished transactions. This method can be called either to install purchases on additional devices, or to restore purchases for an application that the user deleted and reinstalled.
5797

5898
[The payment queue](https://developer.apple.com/documentation/storekit/skpaymentqueue?language=objc) delivers a new transaction for each previously completed transaction that can be restored. Each transaction includes a copy of the original transaction.
5999

60100
### `inAppPurchase.getReceiptURL()`
61101

102+
```YAML history
103+
added:
104+
- pr-url: https://github.com/electron/electron/pull/11292
105+
```
106+
62107
Returns `string` - the path to the receipt.
63108

64109
### `inAppPurchase.finishAllTransactions()`
65110

111+
```YAML history
112+
added:
113+
- pr-url: https://github.com/electron/electron/pull/12464
114+
```
115+
66116
Completes all pending transactions.
67117

68118
### `inAppPurchase.finishTransactionByDate(date)`
69119

120+
```YAML history
121+
added:
122+
- pr-url: https://github.com/electron/electron/pull/12464
123+
```
124+
70125
* `date` string - The ISO formatted date of the transaction to finish.
71126

72127
Completes the pending transactions corresponding to the date.

0 commit comments

Comments
 (0)