Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove implicit 'any' and 'Object' types from the docs #19630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/api/app.md
Expand Up @@ -32,7 +32,7 @@ In most cases, you should do everything in the `ready` event handler.

Returns:

* `launchInfo` Object _macOS_
* `launchInfo` unknown _macOS_

Emitted when Electron has finished initializing. On macOS, `launchInfo` holds
the `userInfo` of the `NSUserNotification` that was used to open the application,
Expand Down Expand Up @@ -146,7 +146,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity on
* `userInfo` unknown - Contains app-specific state stored by the activity on
another device.

Emitted during [Handoff][handoff] when an activity from a different device wants
Expand Down Expand Up @@ -189,7 +189,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity.
* `userInfo` unknown - Contains app-specific state stored by the activity.

Emitted during [Handoff][handoff] after an activity from this device was successfully
resumed on another one.
Expand All @@ -201,7 +201,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity.
* `userInfo` unknown - Contains app-specific state stored by the activity.

Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.

Expand Down Expand Up @@ -949,7 +949,7 @@ allow multiple instances of the application to once again run side by side.

* `type` String - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - App-specific state to store for use by another device.
* `userInfo` any - App-specific state to store for use by another device.
* `webpageURL` String (optional) - The webpage to load in a browser if no suitable app is
installed on the resuming device. The scheme must be `http` or `https`.

Expand All @@ -972,7 +972,7 @@ Marks the current [Handoff][handoff] user activity as inactive without invalidat

* `type` String - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - App-specific state to store for use by another device.
* `userInfo` any - App-specific state to store for use by another device.

Updates the current activity if its type matches `type`, merging the entries from
`userInfo` into its current `userInfo` dictionary.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/auto-updater.md
Expand Up @@ -103,7 +103,7 @@ The `autoUpdater` object has the following methods:

* `options` Object
* `url` String
* `headers` Object (optional) _macOS_ - HTTP request headers.
* `headers` Record<String, String> (optional) _macOS_ - HTTP request headers.
* `serverType` String (optional) _macOS_ - Either `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.

Expand Down
6 changes: 3 additions & 3 deletions docs/api/browser-window.md
Expand Up @@ -691,7 +691,7 @@ is emitted.

#### `BrowserWindow.getExtensions()`

Returns `Object` - The keys are the extension names and each value is
Returns `Record<String, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.

**Note:** This API cannot be called before the `ready` event of the `app` module
Expand Down Expand Up @@ -724,7 +724,7 @@ is emitted.

#### `BrowserWindow.getDevToolsExtensions()`

Returns `Object` - The keys are the extension names and each value is
Returns `Record<string, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.

To check if a DevTools extension is installed you can run the following:
Expand Down Expand Up @@ -1381,7 +1381,7 @@ win.loadURL('http://localhost:8000/post', {

* `filePath` String
* `options` Object (optional)
* `query` Object (optional) - Passed to `url.format()`.
* `query` Record<String, String> (optional) - Passed to `url.format()`.
* `search` String (optional) - Passed to `url.format()`.
* `hash` String (optional) - Passed to `url.format()`.

Expand Down
8 changes: 4 additions & 4 deletions docs/api/client-request.md
Expand Up @@ -16,7 +16,7 @@ following properties:
method.
* `url` String (optional) - The request URL. Must be provided in the absolute
form with the protocol scheme specified as http or https.
* `session` Object (optional) - The [`Session`](session.md) instance with
* `session` Session (optional) - The [`Session`](session.md) instance with
which the request is associated.
* `partition` String (optional) - The name of the [`partition`](session.md)
with which the request is associated. Defaults to the empty string. The
Expand Down Expand Up @@ -134,7 +134,7 @@ Returns:
* `statusCode` Integer
* `method` String
* `redirectUrl` String
* `responseHeaders` Object
* `responseHeaders` Record<String, String[]>

Emitted when there is redirection and the mode is `manual`. Calling
[`request.followRedirect`](#requestfollowredirect) will continue with the redirection.
Expand All @@ -158,7 +158,7 @@ internally buffered inside Electron process memory.
#### `request.setHeader(name, value)`

* `name` String - An extra HTTP header name.
* `value` Object - An extra HTTP header value.
* `value` String - An extra HTTP header value.

Adds an extra HTTP header. The header name will be issued as-is without
lowercasing. It can be called only before first write. Calling this method after
Expand All @@ -169,7 +169,7 @@ the first write will throw an error. If the passed value is not a `String`, its

* `name` String - Specify an extra header name.

Returns `Object` - The value of a previously set extra header name.
Returns `String` - The value of a previously set extra header name.

#### `request.removeHeader(name)`

Expand Down
3 changes: 3 additions & 0 deletions docs/api/content-tracing.md
Expand Up @@ -74,6 +74,9 @@ will be returned in the promise.

Returns `Promise<Object>` - Resolves with an object containing the `value` and `percentage` of trace buffer maximum usage

* `value` Number
* `percentage` Number

Get the maximum usage across processes of trace buffer as a percentage of the
full state.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/crash-reporter.md
Expand Up @@ -48,7 +48,7 @@ The `crashReporter` module has the following methods:
* `productName` String (optional) - Defaults to `app.name`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
* `extra` Object (optional) - An object you can define that will be sent along with the
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
report. Only string properties are sent correctly. Nested objects are not
supported. When using Windows, the property names and values must be fewer than 64 characters.
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).
Expand Down
4 changes: 2 additions & 2 deletions docs/api/debugger.md
Expand Up @@ -50,7 +50,7 @@ Returns:

* `event` Event
* `method` String - Method name.
* `params` Object - Event parameters defined by the 'parameters'
* `params` unknown - Event parameters defined by the 'parameters'
attribute in the remote debugging protocol.

Emitted whenever the debugging target issues an instrumentation event.
Expand Down Expand Up @@ -78,7 +78,7 @@ Detaches the debugger from the `webContents`.

* `method` String - Method name, should be one of the methods defined by the
[remote debugging protocol][rdp].
* `commandParams` Object (optional) - JSON object with request parameters.
* `commandParams` any (optional) - JSON object with request parameters.

Returns `Promise<any>` - A promise that resolves with the response defined by
the 'returns' attribute of the command description in the remote debugging protocol
Expand Down
2 changes: 1 addition & 1 deletion docs/api/incoming-message.md
Expand Up @@ -51,7 +51,7 @@ A `String` representing the HTTP status message.

#### `response.headers`

An `Object` representing the response HTTP headers. The `headers` object is
An `Record<string, string[]>` representing the response HTTP headers. The `headers` object is
formatted as follows:

* All header names are lowercased.
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ipc-main.md
Expand Up @@ -90,7 +90,7 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`

* `channel` String
* `listener` Function<Promise> | Function<any>
* `listener` Function<Promise<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]

Expand Down Expand Up @@ -122,7 +122,7 @@ WebContents is the source of the invoke request.
### `ipcMain.handleOnce(channel, listener)`

* `channel` String
* `listener` Function<Promise> | Function<any>
* `listener` Function<Promise<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]

Expand Down
2 changes: 1 addition & 1 deletion docs/api/net.md
Expand Up @@ -54,7 +54,7 @@ The `net` module has the following methods:

### `net.request(options)`

* `options` (Object | String) - The `ClientRequest` constructor options.
* `options` (ClientRequestConstructorOptions | String) - The `ClientRequest` constructor options.

Returns [`ClientRequest`](./client-request.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/api/protocol.md
Expand Up @@ -228,7 +228,7 @@ should be called with either a `String` or an object that has the `data`,
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Object (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
Expand Down Expand Up @@ -388,7 +388,7 @@ which sends a `Buffer` as a response.
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Object | null (optional)
* `session` Session | null (optional)
* `uploadData` Object (optional)
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
Expand Down
4 changes: 4 additions & 0 deletions docs/api/structures/extension-info.md
@@ -0,0 +1,4 @@
# ExtensionInfo Object

* `name` String
* `version` String
2 changes: 1 addition & 1 deletion docs/api/structures/trace-config.md
Expand Up @@ -19,7 +19,7 @@
include in the trace. If not specified, trace all processes.
* `histogram_names` String[] (optional) - a list of [histogram][] names to report
with the trace.
* `memory_dump_config` Object (optional) - if the
* `memory_dump_config` Record<String, any> (optional) - if the
`disabled-by-default-memory-infra` category is enabled, this contains
optional additional configuration for data collection. See the [Chromium
memory-infra docs][memory-infra docs] for more information.
Expand Down
14 changes: 7 additions & 7 deletions docs/api/system-preferences.md
Expand Up @@ -56,7 +56,7 @@ Returns `Boolean` - Whether the Swipe between pages setting is on.
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_

* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>
* `deliverImmediately` Boolean (optional) - `true` to post notifications immediately even when the subscribing app is inactive.

Posts `event` as native notifications of macOS. The `userInfo` is an Object
Expand All @@ -65,15 +65,15 @@ that contains the user information dictionary sent along with the notification.
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_

* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>

Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.

### `systemPreferences.postWorkspaceNotification(event, userInfo)` _macOS_

* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>

Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.
Expand All @@ -83,7 +83,7 @@ that contains the user information dictionary sent along with the notification.
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String

Returns `Number` - The ID of this subscription
Expand All @@ -110,7 +110,7 @@ example values of `event` are:
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String

Returns `Number` - The ID of this subscription
Expand All @@ -123,7 +123,7 @@ This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String

Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
Expand All @@ -149,7 +149,7 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.

### `systemPreferences.registerDefaults(defaults)` _macOS_

* `defaults` Object - a dictionary of (`key: value`) user defaults
* `defaults` Record<String, String | Boolean | Number> - a dictionary of (`key: value`) user defaults

Add the specified defaults to your application's `NSUserDefaults`.

Expand Down
17 changes: 5 additions & 12 deletions docs/api/web-contents.md
Expand Up @@ -143,7 +143,7 @@ Returns:
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` and `other`.
* `options` Object - The options which will be used for creating the new
* `options` BrowserWindowConstructorOptions - The options which will be used for creating the new
[`BrowserWindow`](browser-window.md).
* `additionalFeatures` String[] - The non-standard features (features not handled
by Chromium or Electron) given to `window.open()`.
Expand Down Expand Up @@ -481,7 +481,7 @@ Returns:
* `requestId` Integer
* `activeMatchOrdinal` Integer - Position of the active match.
* `matches` Integer - Number of Matches.
* `selectionArea` Object - Coordinates of first match region.
* `selectionArea` Rectangle - Coordinates of first match region.
* `finalUpdate` Boolean

Emitted when a result is available for
Expand Down Expand Up @@ -669,10 +669,10 @@ Emitted when the devtools window instructs the webContents to reload
Returns:

* `event` Event
* `webPreferences` Object - The web preferences that will be used by the guest
* `webPreferences` WebPreferences - The web preferences that will be used by the guest
page. This object can be modified to adjust the preferences for the guest
page.
* `params` Object - The other `<webview>` parameters such as the `src` URL.
* `params` Record<string, string> - The other `<webview>` parameters such as the `src` URL.
This object can be modified to adjust the parameters of the guest page.

Emitted when a `<webview>`'s web contents is being attached to this web
Expand Down Expand Up @@ -842,7 +842,7 @@ webContents.loadURL('https://github.com', options)

* `filePath` String
* `options` Object (optional)
* `query` Object (optional) - Passed to `url.format()`.
* `query` Record<String, String> (optional) - Passed to `url.format()`.
* `search` String (optional) - Passed to `url.format()`.
* `hash` String (optional) - Passed to `url.format()`.

Expand Down Expand Up @@ -1563,13 +1563,6 @@ Disable device emulation enabled by `webContents.enableDeviceEmulation`.
#### `contents.sendInputEvent(inputEvent)`

* `inputEvent` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
* `type` String (**required**) - The type of the event, can be `mouseDown`,
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel`,
`mouseMove`, `keyDown`, `keyUp` or `char`.
* `modifiers` String[] - An array of modifiers of the event, can
include `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`,
`leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`,
`numLock`, `left`, `right`.

Sends an input `event` to the page.
**Note:** The [`BrowserWindow`](browser-window.md) containing the contents needs to be focused for
Expand Down
8 changes: 4 additions & 4 deletions docs/api/webview-tag.md
Expand Up @@ -593,7 +593,7 @@ examples.

### `<webview>.sendInputEvent(event)`

* `event` Object
* `event` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)

Returns `Promise<void>`

Expand Down Expand Up @@ -767,7 +767,7 @@ Returns:
* `requestId` Integer
* `activeMatchOrdinal` Integer - Position of the active match.
* `matches` Integer - Number of Matches.
* `selectionArea` Object - Coordinates of first match region.
* `selectionArea` Rectangle - Coordinates of first match region.
* `finalUpdate` Boolean

Fired when a result is available for
Expand All @@ -791,7 +791,7 @@ Returns:
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` and `other`.
* `options` Object - The options which should be used for creating the new
* `options` BrowserWindowConstructorOptions - The options which should be used for creating the new
[`BrowserWindow`](browser-window.md).

Fired when the guest page attempts to open a new browser window.
Expand Down Expand Up @@ -872,7 +872,7 @@ webview.addEventListener('close', () => {
Returns:

* `channel` String
* `args` Array
* `args` any[]

Fired when the guest page has sent an asynchronous message to embedder page.

Expand Down
1 change: 1 addition & 0 deletions filenames.auto.gni
Expand Up @@ -76,6 +76,7 @@ auto_filenames = {
"docs/api/structures/desktop-capturer-source.md",
"docs/api/structures/display.md",
"docs/api/structures/event.md",
"docs/api/structures/extension-info.md",
"docs/api/structures/file-filter.md",
"docs/api/structures/file-path-with-headers.md",
"docs/api/structures/gpu-feature-status.md",
Expand Down