docs: type names changed from wrapper to primitive (#31752)

This commit is contained in:
Milan Burda 2021-11-16 05:13:18 +01:00 коммит произвёл GitHub
Родитель 246884c4fb
Коммит e6b1d95a1c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
115 изменённых файлов: 1685 добавлений и 1685 удалений

Просмотреть файл

@ -2,7 +2,7 @@
> Define keyboard shortcuts.
Accelerators are Strings that can contain multiple modifiers and a single key code,
Accelerators are strings that can contain multiple modifiers and a single key code,
combined by the `+` character, and are used to define keyboard shortcuts
throughout your application.

Просмотреть файл

@ -103,7 +103,7 @@ to a shutdown/restart of the system or a user logout.
Returns:
* `event` Event
* `path` String
* `path` string
Emitted when the user wants to open a file with the application. The `open-file`
event is usually emitted when the application is already open and the OS wants
@ -122,7 +122,7 @@ filepath.
Returns:
* `event` Event
* `url` String
* `url` string
Emitted when the user wants to open a URL with the application. Your application's
`Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and
@ -135,7 +135,7 @@ You should call `event.preventDefault()` if you want to handle this event.
Returns:
* `event` Event
* `hasVisibleWindows` Boolean
* `hasVisibleWindows` boolean
Emitted when the application is activated. Various actions can trigger
this event, such as launching the application for the first time, attempting
@ -157,12 +157,12 @@ when Dock icon is clicked or application is re-launched.
Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
* `type` string - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` unknown - Contains app-specific state stored by the activity on
another device.
* `details` Object
* `webpageURL` String (optional) - A string identifying the URL of the webpage accessed by the activity on another device, if available.
* `webpageURL` string (optional) - A string identifying the URL of the webpage accessed by the activity on another device, if available.
Emitted during [Handoff][handoff] when an activity from a different device wants
to be resumed. You should call `event.preventDefault()` if you want to handle
@ -178,7 +178,7 @@ Supported activity types are specified in the app's `Info.plist` under the
Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
* `type` string - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
Emitted during [Handoff][handoff] before an activity from a different device wants
@ -190,9 +190,9 @@ this event.
Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
* `type` string - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `error` String - A string with the error's localized description.
* `error` string - A string with the error's localized description.
Emitted during [Handoff][handoff] when an activity from a different device
fails to be resumed.
@ -202,7 +202,7 @@ fails to be resumed.
Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
* `type` string - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` unknown - Contains app-specific state stored by the activity.
@ -214,7 +214,7 @@ resumed on another one.
Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
* `type` string - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` unknown - Contains app-specific state stored by the activity.
@ -272,12 +272,12 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `url` String
* `error` String - The error code
* `url` string
* `error` string - The error code
* `certificate` [Certificate](structures/certificate.md)
* `callback` Function
* `isTrusted` Boolean - Whether to consider the certificate as trusted
* `isMainFrame` Boolean
* `isTrusted` boolean - Whether to consider the certificate as trusted
* `isMainFrame` boolean
Emitted when failed to verify the `certificate` for `url`, to trust the
certificate you should prevent the default behavior with
@ -333,14 +333,14 @@ Returns:
* `authenticationResponseDetails` Object
* `url` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
* `host` String
* `isProxy` boolean
* `scheme` string
* `host` string
* `port` Integer
* `realm` String
* `realm` string
* `callback` Function
* `username` String (optional)
* `password` String (optional)
* `username` string (optional)
* `password` string (optional)
Emitted when `webContents` wants to do basic auth.
@ -370,7 +370,7 @@ Emitted whenever there is a GPU info update.
Returns:
* `event` Event
* `killed` Boolean
* `killed` boolean
Emitted when the GPU process crashes or is killed.
@ -385,7 +385,7 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `killed` Boolean
* `killed` boolean
Emitted when the renderer process of `webContents` crashes or is killed.
@ -401,7 +401,7 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `details` Object
* `reason` String - The reason the render process is gone. Possible values:
* `reason` string - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
@ -422,7 +422,7 @@ Returns:
* `event` Event
* `details` Object
* `type` String - Process type. One of the following values:
* `type` string - Process type. One of the following values:
* `Utility`
* `Zygote`
* `Sandbox helper`
@ -430,7 +430,7 @@ Returns:
* `Pepper Plugin`
* `Pepper Plugin Broker`
* `Unknown`
* `reason` String - The reason the child process is gone. Possible values:
* `reason` string - The reason the child process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
@ -438,10 +438,10 @@ Returns:
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Number - The exit code for the process
* `exitCode` number - The exit code for the process
(e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).
* `serviceName` String (optional) - The non-localized name of the process.
* `name` String (optional) - The name of the process.
* `serviceName` string (optional) - The non-localized name of the process.
* `name` string (optional) - The name of the process.
Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.
Emitted when the child process unexpectedly disappears. This is normally
@ -452,7 +452,7 @@ because it was crashed or killed. It does not include renderer processes.
Returns:
* `event` Event
* `accessibilitySupportEnabled` Boolean - `true` when Chrome's accessibility
* `accessibilitySupportEnabled` boolean - `true` when Chrome's accessibility
support is enabled, `false` otherwise.
Emitted when Chrome's accessibility support changes. This event fires when
@ -481,8 +481,8 @@ app.on('session-created', (session) => {
Returns:
* `event` Event
* `argv` String[] - An array of the second instance's command line arguments
* `workingDirectory` String - The second instance's working directory
* `argv` string[] - An array of the second instance's command line arguments
* `workingDirectory` string - The second instance's working directory
* `additionalData` unknown - A JSON object of additional data passed from the second instance
This event will be emitted inside the primary instance of your application
@ -530,8 +530,8 @@ and `will-quit` events will not be emitted.
### `app.relaunch([options])`
* `options` Object (optional)
* `args` String[] (optional)
* `execPath` String (optional)
* `args` string[] (optional)
* `execPath` string (optional)
Relaunches the app when current instance exits.
@ -558,7 +558,7 @@ app.exit(0)
### `app.isReady()`
Returns `Boolean` - `true` if Electron has finished initializing, `false` otherwise.
Returns `boolean` - `true` if Electron has finished initializing, `false` otherwise.
See also `app.whenReady()`.
### `app.whenReady()`
@ -570,7 +570,7 @@ and subscribing to the `ready` event if the app is not ready yet.
### `app.focus([options])`
* `options` Object (optional)
* `steal` Boolean _macOS_ - Make the receiver the active app even if another app is
* `steal` boolean _macOS_ - Make the receiver the active app even if another app is
currently active.
On Linux, focuses on the first visible window. On macOS, makes the application
@ -589,7 +589,7 @@ them.
### `app.setAppLogsPath([path])`
* `path` String (optional) - A custom path for your logs. Must be absolute.
* `path` string (optional) - A custom path for your logs. Must be absolute.
Sets or creates a directory your app's logs which can then be manipulated with `app.getPath()` or `app.setPath(pathName, newPath)`.
@ -597,11 +597,11 @@ Calling `app.setAppLogsPath()` without a `path` parameter will result in this di
### `app.getAppPath()`
Returns `String` - The current application directory.
Returns `string` - The current application directory.
### `app.getPath(name)`
* `name` String - You can request the following paths by the name:
* `name` string - You can request the following paths by the name:
* `home` User's home directory.
* `appData` Per-user application data directory, which by default points to:
* `%APPDATA%` on Windows
@ -623,16 +623,16 @@ Returns `String` - The current application directory.
* `logs` Directory for your app's log folder.
* `crashDumps` Directory where crash dumps are stored.
Returns `String` - A path to a special directory or file associated with `name`. On
Returns `string` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.
If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.
### `app.getFileIcon(path[, options])`
* `path` String
* `path` string
* `options` Object (optional)
* `size` String
* `size` string
* `small` - 16x16
* `normal` - 32x32
* `large` - 48x48 on _Linux_, 32x32 on _Windows_, unsupported on _macOS_.
@ -650,8 +650,8 @@ On _Linux_ and _macOS_, icons depend on the application associated with file mim
### `app.setPath(name, path)`
* `name` String
* `path` String
* `name` string
* `path` string
Overrides the `path` to a special directory or file associated with `name`.
If the path specifies a directory that does not exist, an `Error` is thrown.
@ -665,13 +665,13 @@ directory. If you want to change this location, you have to override the
### `app.getVersion()`
Returns `String` - The version of the loaded application. If no version is found in the
Returns `string` - The version of the loaded application. If no version is found in the
application's `package.json` file, the version of the current bundle or
executable is returned.
### `app.getName()`
Returns `String` - The current application's name, which is the name in the application's
Returns `string` - The current application's name, which is the name in the application's
`package.json` file.
Usually the `name` field of `package.json` is a short lowercase name, according
@ -681,7 +681,7 @@ preferred over `name` by Electron.
### `app.setName(name)`
* `name` String
* `name` string
Overrides the current application's name.
@ -689,7 +689,7 @@ Overrides the current application's name.
### `app.getLocale()`
Returns `String` - The current application locale, fetched using Chromium's `l10n_util` library.
Returns `string` - The current application locale, fetched using Chromium's `l10n_util` library.
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/master:ui/base/l10n/l10n_util.cc).
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](command-line-switches.md).
@ -701,13 +701,13 @@ To set the locale, you'll want to use a command line switch at app startup, whic
### `app.getLocaleCountryCode()`
Returns `String` - User operating system's locale two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) country code. The value is taken from native OS APIs.
Returns `string` - User operating system's locale two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) country code. The value is taken from native OS APIs.
**Note:** When unable to detect locale country code, it returns empty string.
### `app.addRecentDocument(path)` _macOS_ _Windows_
* `path` String
* `path` string
Adds `path` to the recent documents list.
@ -720,15 +720,15 @@ Clears the recent documents list.
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
* `protocol` String - The name of your protocol, without `://`. For example,
* `protocol` string - The name of your protocol, without `://`. For example,
if you want your app to handle `electron://` links, call this method with
`electron` as the parameter.
* `path` String (optional) _Windows_ - The path to the Electron executable.
* `path` string (optional) _Windows_ - The path to the Electron executable.
Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Arguments passed to the executable.
* `args` string[] (optional) _Windows_ - Arguments passed to the executable.
Defaults to an empty array
Returns `Boolean` - Whether the call succeeded.
Returns `boolean` - Whether the call succeeded.
Sets the current executable as the default handler for a protocol (aka URI
scheme). It allows you to integrate your app deeper into the operating system.
@ -751,22 +751,22 @@ The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internal
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
* `protocol` String - The name of your protocol, without `://`.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
* `protocol` string - The name of your protocol, without `://`.
* `path` string (optional) _Windows_ - Defaults to `process.execPath`
* `args` string[] (optional) _Windows_ - Defaults to an empty array
Returns `Boolean` - Whether the call succeeded.
Returns `boolean` - Whether the call succeeded.
This method checks if the current executable as the default handler for a
protocol (aka URI scheme). If so, it will remove the app as the default handler.
### `app.isDefaultProtocolClient(protocol[, path, args])`
* `protocol` String - The name of your protocol, without `://`.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
* `protocol` string - The name of your protocol, without `://`.
* `path` string (optional) _Windows_ - Defaults to `process.execPath`
* `args` string[] (optional) _Windows_ - Defaults to an empty array
Returns `Boolean` - Whether the current executable is the default handler for a
Returns `boolean` - Whether the current executable is the default handler for a
protocol (aka URI scheme).
**Note:** On macOS, you can use this method to check if the app has been
@ -779,11 +779,11 @@ The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` interna
### `app.getApplicationNameForProtocol(url)`
* `url` String - a URL with the protocol name to check. Unlike the other
* `url` string - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `String` - Name of the application handling the protocol, or an empty
Returns `string` - Name of the application handling the protocol, or an empty
string if there is no handler. For instance, if Electron is the default
handler of the URL, this could be `Electron` on Windows and Mac. However,
don't rely on the precise format which is not guaranteed to remain unchanged.
@ -794,15 +794,15 @@ This method returns the application name of the default handler for the protocol
### `app.getApplicationInfoForProtocol(url)` _macOS_ _Windows_
* `url` String - a URL with the protocol name to check. Unlike the other
* `url` string - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `Promise<Object>` - Resolve with an object containing the following:
* `icon` NativeImage - the display icon of the app handling the protocol.
* `path` String - installation path of the app handling the protocol.
* `name` String - display name of the app handling the protocol.
* `path` string - installation path of the app handling the protocol.
* `name` string - display name of the app handling the protocol.
This method returns a promise that contains the application name, icon and path of the default handler for the protocol
(aka URI scheme) of a URL.
@ -815,7 +815,7 @@ Adds `tasks` to the [Tasks][tasks] category of the Jump List on Windows.
`tasks` is an array of [`Task`](structures/task.md) objects.
Returns `Boolean` - Whether the call succeeded.
Returns `boolean` - Whether the call succeeded.
**Note:** If you'd like to customize the Jump List even more use
`app.setJumpList(categories)` instead.
@ -934,7 +934,7 @@ app.setJumpList([
* `additionalData` unknown (optional) - A JSON object containing additional data to send to the first instance.
Returns `Boolean`
Returns `boolean`
The return value of this method indicates whether or not this instance of your
application successfully obtained the lock. If it failed to obtain the lock,
@ -985,7 +985,7 @@ if (!gotTheLock) {
### `app.hasSingleInstanceLock()`
Returns `Boolean`
Returns `boolean`
This method returns whether or not this instance of your app is currently
holding the single instance lock. You can request the lock with
@ -999,10 +999,10 @@ allow multiple instances of the application to once again run side by side.
### `app.setUserActivity(type, userInfo[, webpageURL])` _macOS_
* `type` String - Uniquely identifies the activity. Maps to
* `type` string - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `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
* `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`.
Creates an `NSUserActivity` and sets it as the current activity. The activity
@ -1010,7 +1010,7 @@ is eligible for [Handoff][handoff] to another device afterward.
### `app.getCurrentActivityType()` _macOS_
Returns `String` - The type of the currently running activity.
Returns `string` - The type of the currently running activity.
### `app.invalidateCurrentActivity()` _macOS_
@ -1022,7 +1022,7 @@ Marks the current [Handoff][handoff] user activity as inactive without invalidat
### `app.updateCurrentActivity(type, userInfo)` _macOS_
* `type` String - Uniquely identifies the activity. Maps to
* `type` string - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` any - App-specific state to store for use by another device.
@ -1031,13 +1031,13 @@ Updates the current activity if its type matches `type`, merging the entries fro
### `app.setAppUserModelId(id)` _Windows_
* `id` String
* `id` string
Changes the [Application User Model ID][app-user-model-id] to `id`.
### `app.setActivationPolicy(policy)` _macOS_
* `policy` String - Can be 'regular', 'accessory', or 'prohibited'.
* `policy` string - Can be 'regular', 'accessory', or 'prohibited'.
Sets the activation policy for a given app.
@ -1050,8 +1050,8 @@ Activation policy types:
### `app.importCertificate(options, callback)` _Linux_
* `options` Object
* `certificate` String - Path for the pkcs12 file.
* `password` String - Passphrase for the certificate.
* `certificate` string - Path for the pkcs12 file.
* `password` string - Passphrase for the certificate.
* `callback` Function
* `result` Integer - Result of import.
@ -1062,23 +1062,23 @@ indicates success while any other value indicates failure according to Chromium
### `app.configureHostResolver(options)`
* `options` Object
* `enableBuiltInResolver` Boolean (optional) - Whether the built-in host
* `enableBuiltInResolver` boolean (optional) - Whether the built-in host
resolver is used in preference to getaddrinfo. When enabled, the built-in
resolver will attempt to use the system's DNS settings to do DNS lookups
itself. Enabled by default on macOS, disabled by default on Windows and
Linux.
* `secureDnsMode` String (optional) - Can be "off", "automatic" or "secure".
* `secureDnsMode` string (optional) - Can be "off", "automatic" or "secure".
Configures the DNS-over-HTTP mode. When "off", no DoH lookups will be
performed. When "automatic", DoH lookups will be performed first if DoH is
available, and insecure DNS lookups will be performed as a fallback. When
"secure", only DoH lookups will be performed. Defaults to "automatic".
* `secureDnsServers` String[]&#32;(optional) - A list of DNS-over-HTTP
* `secureDnsServers` string[]&#32;(optional) - A list of DNS-over-HTTP
server templates. See [RFC8484 § 3][] for details on the template format.
Most servers support the POST method; the template for such servers is
simply a URI. Note that for [some DNS providers][doh-providers], the
resolver will automatically upgrade to DoH unless DoH is explicitly
disabled, even if there are no DoH servers provided in this list.
* `enableAdditionalDnsQueryTypes` Boolean (optional) - Controls whether additional DNS
* `enableAdditionalDnsQueryTypes` boolean (optional) - Controls whether additional DNS
query types, e.g. HTTPS (DNS type 65) will be allowed besides the
traditional A and AAAA queries when a request is being made via insecure
DNS. Has no effect on Secure DNS which always allows additional types.
@ -1140,7 +1140,7 @@ Returns [`GPUFeatureStatus`](structures/gpu-feature-status.md) - The Graphics Fe
### `app.getGPUInfo(infoType)`
* `infoType` String - Can be `basic` or `complete`.
* `infoType` string - Can be `basic` or `complete`.
Returns `Promise<unknown>`
@ -1183,7 +1183,7 @@ Using `basic` should be preferred if only basic information like `vendorId` or `
* `count` Integer (optional) - If a value is provided, set the badge to the provided value otherwise, on macOS, display a plain white dot (e.g. unknown number of notifications). On Linux, if a value is not provided the badge will not display.
Returns `Boolean` - Whether the call succeeded.
Returns `boolean` - Whether the call succeeded.
Sets the counter badge for current app. Setting the count to `0` will hide the
badge.
@ -1199,14 +1199,14 @@ Returns `Integer` - The current value displayed in the counter badge.
### `app.isUnityRunning()` _Linux_
Returns `Boolean` - Whether the current desktop environment is Unity launcher.
Returns `boolean` - Whether the current desktop environment is Unity launcher.
### `app.getLoginItemSettings([options])` _macOS_ _Windows_
* `options` Object (optional)
* `path` String (optional) _Windows_ - The executable path to compare against.
* `path` string (optional) _Windows_ - The executable path to compare against.
Defaults to `process.execPath`.
* `args` String[] (optional) _Windows_ - The command-line arguments to compare
* `args` string[] (optional) _Windows_ - The command-line arguments to compare
against. Defaults to an empty array.
If you provided `path` and `args` options to `app.setLoginItemSettings`, then you
@ -1214,43 +1214,43 @@ need to pass the same arguments here for `openAtLogin` to be set correctly.
Returns `Object`:
* `openAtLogin` Boolean - `true` if the app is set to open at login.
* `openAsHidden` Boolean _macOS_ - `true` if the app is set to open as hidden at login.
* `openAtLogin` boolean - `true` if the app is set to open at login.
* `openAsHidden` boolean _macOS_ - `true` if the app is set to open as hidden at login.
This setting is not available on [MAS builds][mas-builds].
* `wasOpenedAtLogin` Boolean _macOS_ - `true` if the app was opened at login
* `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
automatically. This setting is not available on [MAS builds][mas-builds].
* `wasOpenedAsHidden` Boolean _macOS_ - `true` if the app was opened as a hidden login
* `wasOpenedAsHidden` boolean _macOS_ - `true` if the app was opened as a hidden login
item. This indicates that the app should not open any windows at startup.
This setting is not available on [MAS builds][mas-builds].
* `restoreState` Boolean _macOS_ - `true` if the app was opened as a login item that
* `restoreState` boolean _macOS_ - `true` if the app was opened as a login item that
should restore the state from the previous session. This indicates that the
app should restore the windows that were open the last time the app was
closed. This setting is not available on [MAS builds][mas-builds].
* `executableWillLaunchAtLogin` Boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.
* `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.
* `launchItems` Object[] _Windows_
* `name` String _Windows_ - name value of a registry entry.
* `path` String _Windows_ - The executable to an app that corresponds to a registry entry.
* `args` String[] _Windows_ - the command-line arguments to pass to the executable.
* `scope` String _Windows_ - one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
* `enabled` Boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.
* `name` string _Windows_ - name value of a registry entry.
* `path` string _Windows_ - The executable to an app that corresponds to a registry entry.
* `args` string[] _Windows_ - the command-line arguments to pass to the executable.
* `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
* `enabled` boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.
### `app.setLoginItemSettings(settings)` _macOS_ _Windows_
* `settings` Object
* `openAtLogin` Boolean (optional) - `true` to open the app at login, `false` to remove
* `openAtLogin` boolean (optional) - `true` to open the app at login, `false` to remove
the app as a login item. Defaults to `false`.
* `openAsHidden` Boolean (optional) _macOS_ - `true` to open the app as hidden. Defaults to
* `openAsHidden` boolean (optional) _macOS_ - `true` to open the app as hidden. Defaults to
`false`. The user can edit this setting from the System Preferences so
`app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app
is opened to know the current value. This setting is not available on [MAS builds][mas-builds].
* `path` String (optional) _Windows_ - The executable to launch at login.
* `path` string (optional) _Windows_ - The executable to launch at login.
Defaults to `process.execPath`.
* `args` String[] (optional) _Windows_ - The command-line arguments to pass to
* `args` string[] (optional) _Windows_ - The command-line arguments to pass to
the executable. Defaults to an empty array. Take care to wrap paths in
quotes.
* `enabled` Boolean (optional) _Windows_ - `true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings.
* `enabled` boolean (optional) _Windows_ - `true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings.
Defaults to `true`.
* `name` String (optional) _Windows_ - value name to write into registry. Defaults to the app's AppUserModelId().
* `name` string (optional) _Windows_ - value name to write into registry. Defaults to the app's AppUserModelId().
Set the app's login item settings.
To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows],
@ -1274,7 +1274,7 @@ app.setLoginItemSettings({
### `app.isAccessibilitySupportEnabled()` _macOS_ _Windows_
Returns `Boolean` - `true` if Chrome's accessibility support is enabled,
Returns `boolean` - `true` if Chrome's accessibility support is enabled,
`false` otherwise. This API will return `true` if the use of assistive
technologies, such as screen readers, has been detected. See
https://www.chromium.org/developers/design-documents/accessibility for more
@ -1282,7 +1282,7 @@ details.
### `app.setAccessibilitySupportEnabled(enabled)` _macOS_ _Windows_
* `enabled` Boolean - Enable or disable [accessibility tree](https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/the-accessibility-tree) rendering
* `enabled` boolean - Enable or disable [accessibility tree](https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/the-accessibility-tree) rendering
Manually enables Chrome's accessibility support, allowing to expose accessibility switch to users in application settings. See [Chromium's accessibility docs](https://www.chromium.org/developers/design-documents/accessibility) for more
details. Disabled by default.
@ -1298,14 +1298,14 @@ Show the app's about panel options. These options can be overridden with `app.se
### `app.setAboutPanelOptions(options)`
* `options` Object
* `applicationName` String (optional) - The app's name.
* `applicationVersion` String (optional) - The app's version.
* `copyright` String (optional) - Copyright information.
* `version` String (optional) _macOS_ - The app's build version number.
* `credits` String (optional) _macOS_ _Windows_ - Credit information.
* `authors` String[] (optional) _Linux_ - List of app authors.
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
* `applicationName` string (optional) - The app's name.
* `applicationVersion` string (optional) - The app's version.
* `copyright` string (optional) - Copyright information.
* `version` string (optional) _macOS_ - The app's build version number.
* `credits` string (optional) _macOS_ _Windows_ - Credit information.
* `authors` string[] (optional) _Linux_ - List of app authors.
* `website` string (optional) _Linux_ - The app's website.
* `iconPath` string (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
@ -1313,7 +1313,7 @@ If you do not set `credits` but still wish to surface them in your app, AppKit w
### `app.isEmojiPanelSupported()`
Returns `Boolean` - whether or not the current OS version allows for native emoji pickers.
Returns `boolean` - whether or not the current OS version allows for native emoji pickers.
### `app.showEmojiPanel()` _macOS_ _Windows_
@ -1321,7 +1321,7 @@ Show the platform's native emoji picker.
### `app.startAccessingSecurityScopedResource(bookmarkData)` _mas_
* `bookmarkData` String - The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.
* `bookmarkData` string - The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.
Returns `Function` - This function **must** be called once you have finished accessing the security scoped file. If you do not remember to stop accessing the bookmark, [kernel resources will be leaked](https://developer.apple.com/reference/foundation/nsurl/1417051-startaccessingsecurityscopedreso?language=objc) and your app will lose its ability to reach outside the sandbox completely, until your app is restarted.
@ -1344,16 +1344,16 @@ This method can only be called before app is ready.
### `app.isInApplicationsFolder()` _macOS_
Returns `Boolean` - Whether the application is currently running from the
Returns `boolean` - Whether the application is currently running from the
systems Application folder. Use in combination with `app.moveToApplicationsFolder()`
### `app.moveToApplicationsFolder([options])` _macOS_
* `options` Object (optional)
* `conflictHandler` Function\<Boolean> (optional) - A handler for potential conflict in move failure.
* `conflictType` String - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.
* `conflictHandler` Function\<boolean> (optional) - A handler for potential conflict in move failure.
* `conflictType` string - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.
Returns `Boolean` - Whether the move was successful. Please note that if
Returns `boolean` - Whether the move was successful. Please note that if
the move is successful, your application will quit and relaunch.
No confirmation dialog will be presented by default. If you wish to allow
@ -1389,13 +1389,13 @@ Would mean that if an app already exists in the user directory, if the user choo
### `app.isSecureKeyboardEntryEnabled()` _macOS_
Returns `Boolean` - whether `Secure Keyboard Entry` is enabled.
Returns `boolean` - whether `Secure Keyboard Entry` is enabled.
By default this API will return `false`.
### `app.setSecureKeyboardEntryEnabled(enabled)` _macOS_
* `enabled` Boolean - Enable or disable `Secure Keyboard Entry`
* `enabled` boolean - Enable or disable `Secure Keyboard Entry`
Set the `Secure Keyboard Entry` is enabled in your application.
@ -1410,7 +1410,7 @@ details.
### `app.accessibilitySupportEnabled` _macOS_ _Windows_
A `Boolean` property that's `true` if Chrome's accessibility support is enabled, `false` otherwise. This property will be `true` if the use of assistive technologies, such as screen readers, has been detected. Setting this property to `true` manually enables Chrome's accessibility support, allowing developers to expose accessibility switch to users in application settings.
A `boolean` property that's `true` if Chrome's accessibility support is enabled, `false` otherwise. This property will be `true` if the use of assistive technologies, such as screen readers, has been detected. Setting this property to `true` manually enables Chrome's accessibility support, allowing developers to expose accessibility switch to users in application settings.
See [Chromium's accessibility docs](https://www.chromium.org/developers/design-documents/accessibility) for more details. Disabled by default.
@ -1447,7 +1447,7 @@ dock on macOS.
### `app.isPackaged` _Readonly_
A `Boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
@ -1466,7 +1466,7 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
### `app.name`
A `String` property that indicates the current application's name, which is the name in the application's `package.json` file.
A `string` property that indicates the current application's name, which is the name in the application's `package.json` file.
Usually the `name` field of `package.json` is a short lowercase name, according
to the npm modules spec. You should usually also specify a `productName`
@ -1475,7 +1475,7 @@ preferred over `name` by Electron.
### `app.userAgentFallback`
A `String` which is the user agent string Electron will use as a global fallback.
A `string` which is the user agent string Electron will use as a global fallback.
This is the user agent that will be used when no user agent is set at the
`webContents` or `session` level. It is useful for ensuring that your entire
@ -1484,7 +1484,7 @@ in your app's initialization to ensure that your overridden value is used.
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ _Deprecated_
A `Boolean` which when `true` indicates that the app is currently running
A `boolean` which when `true` indicates that the app is currently running
under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)).
You can use this property to prompt users to download the arm64 version of
@ -1497,7 +1497,7 @@ and Windows.
### `app.runningUnderARM64Translation` _Readonly_ _macOS_ _Windows_
A `Boolean` which when `true` indicates that the app is currently running under
A `boolean` which when `true` indicates that the app is currently running under
an ARM64 translator (like the macOS
[Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software))
or Windows [WOW](https://en.wikipedia.org/wiki/Windows_on_Windows)).

Просмотреть файл

@ -77,10 +77,10 @@ Emitted when there is no available update.
Returns:
* `event` Event
* `releaseNotes` String
* `releaseName` String
* `releaseNotes` string
* `releaseName` string
* `releaseDate` Date
* `updateURL` String
* `updateURL` string
Emitted when an update has been downloaded.
@ -102,16 +102,16 @@ The `autoUpdater` object has the following methods:
### `autoUpdater.setFeedURL(options)`
* `options` Object
* `url` String
* `headers` Record<String, String> (optional) _macOS_ - HTTP request headers.
* `serverType` String (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
* `url` string
* `headers` Record<string, string> (optional) _macOS_ - HTTP request headers.
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.
Sets the `url` and initialize the auto updater.
### `autoUpdater.getFeedURL()`
Returns `String` - The current update feed URL.
Returns `string` - The current update feed URL.
### `autoUpdater.checkForUpdates()`

Просмотреть файл

@ -45,13 +45,13 @@ Objects created with `new BrowserView` have the following instance methods:
#### `view.setAutoResize(options)` _Experimental_
* `options` Object
* `width` Boolean (optional) - If `true`, the view's width will grow and shrink together
* `width` boolean (optional) - If `true`, the view's width will grow and shrink together
with the window. `false` by default.
* `height` Boolean (optional) - If `true`, the view's height will grow and shrink
* `height` boolean (optional) - If `true`, the view's height will grow and shrink
together with the window. `false` by default.
* `horizontal` Boolean (optional) - If `true`, the view's x position and width will grow
* `horizontal` boolean (optional) - If `true`, the view's x position and width will grow
and shrink proportionally with the window. `false` by default.
* `vertical` Boolean (optional) - If `true`, the view's y position and height will grow
* `vertical` boolean (optional) - If `true`, the view's y position and height will grow
and shrink proportionally with the window. `false` by default.
#### `view.setBounds(bounds)` _Experimental_
@ -68,5 +68,5 @@ The `bounds` of this BrowserView instance as `Object`.
#### `view.setBackgroundColor(color)` _Experimental_
* `color` String - Color in `#aarrggbb` or `#argb` form. The alpha channel is
* `color` string - Color in `#aarrggbb` or `#argb` form. The alpha channel is
optional.

Просмотреть файл

@ -22,7 +22,7 @@ Forcefully closes the child window without calling its unload event.
#### `win.eval(code)`
* `code` String
* `code` string
Evaluates the code in the child window.
@ -37,7 +37,7 @@ Invokes the print dialog on the child window.
#### `win.postMessage(message, targetOrigin)`
* `message` any
* `targetOrigin` String
* `targetOrigin` string
Sends a message to the child window with the specified origin or `*` for no
origin preference.
@ -51,4 +51,4 @@ The `BrowserWindowProxy` object has the following instance properties:
#### `win.closed`
A `Boolean` that is set to true after the child window gets closed.
A `boolean` that is set to true after the child window gets closed.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,20 +10,20 @@ interface and is therefore an [EventEmitter][event-emitter].
### `new ClientRequest(options)`
* `options` (Object | String) - If `options` is a String, it is interpreted as
* `options` (Object | string) - If `options` is a string, it is interpreted as
the request URL. If it is an object, it is expected to fully specify an HTTP request via the
following properties:
* `method` String (optional) - The HTTP request method. Defaults to the GET
* `method` string (optional) - The HTTP request method. Defaults to the GET
method.
* `url` String (optional) - The request URL. Must be provided in the absolute
* `url` string (optional) - The request URL. Must be provided in the absolute
form with the protocol scheme specified as http or https.
* `session` Session (optional) - The [`Session`](session.md) instance with
which the request is associated.
* `partition` String (optional) - The name of the [`partition`](session.md)
* `partition` string (optional) - The name of the [`partition`](session.md)
with which the request is associated. Defaults to the empty string. The
`session` option supersedes `partition`. Thus if a `session` is explicitly
specified, `partition` is ignored.
* `credentials` String (optional) - Can be `include` or `omit`. Whether to
* `credentials` string (optional) - Can be `include` or `omit`. Whether to
send [credentials](https://fetch.spec.whatwg.org/#credentials) with this
request. If set to `include`, credentials from the session associated with
the request will be used. If set to `omit`, credentials will not be sent
@ -33,22 +33,22 @@ following properties:
option of the same name. If this option is not specified, authentication
data from the session will be sent, and cookies will not be sent (unless
`useSessionCookies` is set).
* `useSessionCookies` Boolean (optional) - Whether to send cookies with this
* `useSessionCookies` boolean (optional) - Whether to send cookies with this
request from the provided session. If `credentials` is specified, this
option has no effect. Default is `false`.
* `protocol` String (optional) - Can be `http:` or `https:`. The protocol
* `protocol` string (optional) - Can be `http:` or `https:`. The protocol
scheme in the form 'scheme:'. Defaults to 'http:'.
* `host` String (optional) - The server host provided as a concatenation of
* `host` string (optional) - The server host provided as a concatenation of
the hostname and the port number 'hostname:port'.
* `hostname` String (optional) - The server host name.
* `hostname` string (optional) - The server host name.
* `port` Integer (optional) - The server's listening port number.
* `path` String (optional) - The path part of the request URL.
* `redirect` String (optional) - Can be `follow`, `error` or `manual`. The
* `path` string (optional) - The path part of the request URL.
* `redirect` string (optional) - Can be `follow`, `error` or `manual`. The
redirect mode for this request. When mode is `error`, any redirection will
be aborted. When mode is `manual` the redirection will be cancelled unless
[`request.followRedirect`](#requestfollowredirect) is invoked synchronously
during the [`redirect`](#event-redirect) event. Defaults to `follow`.
* `origin` String (optional) - The origin URL of the request.
* `origin` string (optional) - The origin URL of the request.
`options` properties such as `protocol`, `host`, `hostname`, `port` and `path`
strictly follow the Node.js model as described in the
@ -79,21 +79,21 @@ Returns:
Returns:
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
* `host` String
* `isProxy` boolean
* `scheme` string
* `host` string
* `port` Integer
* `realm` String
* `realm` string
* `callback` Function
* `username` String (optional)
* `password` String (optional)
* `username` string (optional)
* `password` string (optional)
Emitted when an authenticating proxy is asking for user credentials.
The `callback` function is expected to be called back with user credentials:
* `username` String
* `password` String
* `username` string
* `password` string
```JavaScript
request.on('login', (authInfo, callback) => {
@ -147,9 +147,9 @@ event indicates that no more events will be emitted on either the `request` or
Returns:
* `statusCode` Integer
* `method` String
* `redirectUrl` String
* `responseHeaders` Record<String, String[]>
* `method` string
* `redirectUrl` string
* `responseHeaders` Record<string, string[]>
Emitted when the server returns a redirect response (e.g. 301 Moved
Permanently). Calling [`request.followRedirect`](#requestfollowredirect) will
@ -161,7 +161,7 @@ continue with the redirection. If this event is handled,
#### `request.chunkedEncoding`
A `Boolean` specifying whether the request will use HTTP chunked transfer encoding
A `boolean` specifying whether the request will use HTTP chunked transfer encoding
or not. Defaults to false. The property is readable and writable, however it can
be set only before the first write operation as the HTTP headers are not yet put
on the wire. Trying to set the `chunkedEncoding` property after the first write
@ -175,12 +175,12 @@ internally buffered inside Electron process memory.
#### `request.setHeader(name, value)`
* `name` String - An extra HTTP header name.
* `value` String - An extra HTTP header value.
* `name` string - An extra HTTP header name.
* `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
the first write will throw an error. If the passed value is not a `String`, its
the first write will throw an error. If the passed value is not a `string`, its
`toString()` method will be called to obtain the final value.
Certain headers are restricted from being set by apps. These headers are
@ -199,22 +199,22 @@ Additionally, setting the `Connection` header to the value `upgrade` is also dis
#### `request.getHeader(name)`
* `name` String - Specify an extra header name.
* `name` string - Specify an extra header name.
Returns `String` - The value of a previously set extra header name.
Returns `string` - The value of a previously set extra header name.
#### `request.removeHeader(name)`
* `name` String - Specify an extra header name.
* `name` string - Specify an extra header name.
Removes a previously set extra header name. This method can be called only
before first write. Trying to call it after the first write will throw an error.
#### `request.write(chunk[, encoding][, callback])`
* `chunk` (String | Buffer) - A chunk of the request body's data. If it is a
* `chunk` (string | Buffer) - A chunk of the request body's data. If it is a
string, it is converted into a Buffer using the specified encoding.
* `encoding` String (optional) - Used to convert string chunks into Buffer
* `encoding` string (optional) - Used to convert string chunks into Buffer
objects. Defaults to 'utf-8'.
* `callback` Function (optional) - Called after the write operation ends.
@ -230,8 +230,8 @@ it is not allowed to add or remove a custom header.
#### `request.end([chunk][, encoding][, callback])`
* `chunk` (String | Buffer) (optional)
* `encoding` String (optional)
* `chunk` (string | Buffer) (optional)
* `encoding` string (optional)
* `callback` Function (optional)
Sends the last chunk of the request data. Subsequent write or end operations
@ -253,9 +253,9 @@ event.
Returns `Object`:
* `active` Boolean - Whether the request is currently active. If this is false
* `active` boolean - Whether the request is currently active. If this is false
no other properties will be set
* `started` Boolean - Whether the upload has started. If this is false both
* `started` boolean - Whether the upload has started. If this is false both
`current` and `total` will be set to 0.
* `current` Integer - The number of bytes that have been uploaded so far
* `total` Integer - The number of bytes that will be uploaded this request

Просмотреть файл

@ -10,7 +10,7 @@ you need to pass `selection` to each method:
```javascript
const { clipboard } = require('electron')
clipboard.writeText('Example String', 'selection')
clipboard.writeText('Example string', 'selection')
console.log(clipboard.readText('selection'))
```
@ -22,9 +22,9 @@ The `clipboard` module has the following methods:
### `clipboard.readText([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as plain text.
Returns `string` - The content in the clipboard as plain text.
```js
const { clipboard } = require('electron')
@ -38,8 +38,8 @@ console.log(text)
### `clipboard.writeText(text[, type])`
* `text` String
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `text` string
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `text` into the clipboard as plain text.
@ -52,9 +52,9 @@ clipboard.writeText(text)
### `clipboard.readHTML([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as markup.
Returns `string` - The content in the clipboard as markup.
```js
const { clipboard } = require('electron')
@ -68,8 +68,8 @@ console.log(html)
### `clipboard.writeHTML(markup[, type])`
* `markup` String
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `markup` string
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes `markup` to the clipboard.
@ -81,22 +81,22 @@ clipboard.writeHTML('<b>Hi</b')
### `clipboard.readImage([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns [`NativeImage`](native-image.md) - The image content in the clipboard.
### `clipboard.writeImage(image[, type])`
* `image` [NativeImage](native-image.md)
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes `image` to the clipboard.
### `clipboard.readRTF([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as RTF.
Returns `string` - The content in the clipboard as RTF.
```js
const { clipboard } = require('electron')
@ -110,8 +110,8 @@ console.log(rtf)
### `clipboard.writeRTF(text[, type])`
* `text` String
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `text` string
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `text` into the clipboard in RTF.
@ -126,8 +126,8 @@ clipboard.writeRTF(rtf)
Returns `Object`:
* `title` String
* `url` String
* `title` string
* `url` string
Returns an Object containing `title` and `url` keys representing the bookmark in
the clipboard. The `title` and `url` values will be empty strings when the
@ -135,9 +135,9 @@ bookmark is unavailable. The `title` value will always be empty on Windows.
### `clipboard.writeBookmark(title, url[, type])` _macOS_ _Windows_
* `title` String - Unused on Windows
* `url` String
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `title` string - Unused on Windows
* `url` string
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
@ -156,28 +156,28 @@ clipboard.writeBookmark({
### `clipboard.readFindText()` _macOS_
Returns `String` - The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active applications find panel.
Returns `string` - The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active applications find panel.
This method uses synchronous IPC when called from the renderer process.
The cached value is reread from the find pasteboard whenever the application is activated.
### `clipboard.writeFindText(text)` _macOS_
* `text` String
* `text` string
Writes the `text` into the find pasteboard (the pasteboard that holds information about the current state of the active applications find panel) as plain text. This method uses synchronous IPC when called from the renderer process.
### `clipboard.clear([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Clears the clipboard content.
### `clipboard.availableFormats([type])`
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String[]` - An array of supported formats for the clipboard `type`.
Returns `string[]` - An array of supported formats for the clipboard `type`.
```js
const { clipboard } = require('electron')
@ -189,10 +189,10 @@ console.log(formats)
### `clipboard.has(format[, type])` _Experimental_
* `format` String
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `format` string
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `Boolean` - Whether the clipboard supports the specified `format`.
Returns `boolean` - Whether the clipboard supports the specified `format`.
```js
const { clipboard } = require('electron')
@ -204,9 +204,9 @@ console.log(hasFormat)
### `clipboard.read(format)` _Experimental_
* `format` String
* `format` string
Returns `String` - Reads `format` type from the clipboard.
Returns `string` - Reads `format` type from the clipboard.
`format` should contain valid ASCII characters and have `/` separator.
`a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a`
@ -214,7 +214,7 @@ are not valid.
### `clipboard.readBuffer(format)` _Experimental_
* `format` String
* `format` string
Returns `Buffer` - Reads `format` type from the clipboard.
@ -232,9 +232,9 @@ console.log(buffer.equals(out))
### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_
* `format` String
* `format` string
* `buffer` Buffer
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `buffer` into the clipboard as `format`.
@ -248,12 +248,12 @@ clipboard.writeBuffer('public/utf8-plain-text', buffer)
### `clipboard.write(data[, type])`
* `data` Object
* `text` String (optional)
* `html` String (optional)
* `text` string (optional)
* `html` string (optional)
* `image` [NativeImage](native-image.md) (optional)
* `rtf` String (optional)
* `bookmark` String (optional) - The title of the URL at `text`.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
* `rtf` string (optional)
* `bookmark` string (optional) - The title of the URL at `text`.
* `type` string (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes `data` to the clipboard.

Просмотреть файл

@ -20,8 +20,8 @@ document.
#### `commandLine.appendSwitch(switch[, value])`
* `switch` String - A command-line switch, without the leading `--`
* `value` String (optional) - A value for the given switch
* `switch` string - A command-line switch, without the leading `--`
* `value` string (optional) - A value for the given switch
Append a switch (with optional `value`) to Chromium's command line.
@ -30,7 +30,7 @@ control Chromium's behavior.
#### `commandLine.appendArgument(value)`
* `value` String - The argument to append to the command line
* `value` string - The argument to append to the command line
Append an argument to Chromium's command line. The argument will be quoted
correctly. Switches will precede arguments regardless of appending order.
@ -42,21 +42,21 @@ control Chromium's behavior.
#### `commandLine.hasSwitch(switch)`
* `switch` String - A command-line switch
* `switch` string - A command-line switch
Returns `Boolean` - Whether the command-line switch is present.
Returns `boolean` - Whether the command-line switch is present.
#### `commandLine.getSwitchValue(switch)`
* `switch` String - A command-line switch
* `switch` string - A command-line switch
Returns `String` - The command-line switch value.
Returns `string` - The command-line switch value.
**Note:** When the switch is not present or has no value, it returns empty string.
#### `commandLine.removeSwitch(switch)`
* `switch` String - A command-line switch
* `switch` string - A command-line switch
Removes the specified switch from Chromium's command line.

Просмотреть файл

@ -32,7 +32,7 @@ The `contentTracing` module has the following methods:
### `contentTracing.getCategories()`
Returns `Promise<String[]>` - resolves with an array of category groups once all child processes have acknowledged the `getCategories` request
Returns `Promise<string[]>` - resolves with an array of category groups once all child processes have acknowledged the `getCategories` request
Get a set of category groups. The category groups can change as new code paths
are reached. See also the [list of built-in tracing
@ -57,9 +57,9 @@ only one trace operation can be in progress at a time.
### `contentTracing.stopRecording([resultFilePath])`
* `resultFilePath` String (optional)
* `resultFilePath` string (optional)
Returns `Promise<String>` - resolves with a path to a file that contains the traced data once all child processes have acknowledged the `stopRecording` request
Returns `Promise<string>` - resolves with a path to a file that contains the traced data once all child processes have acknowledged the `stopRecording` request
Stop recording on all processes.
@ -77,8 +77,8 @@ 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
* `value` number
* `percentage` number
Get the maximum usage across processes of trace buffer as a percentage of the
full state.

Просмотреть файл

@ -43,15 +43,15 @@ The `contextBridge` module has the following methods:
### `contextBridge.exposeInMainWorld(apiKey, api)`
* `apiKey` String - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
* `apiKey` string - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
* `api` any - Your API, more information on what this API can be and how it works is available below.
## Usage
### API
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api) must be a `Function`, `String`, `Number`, `Array`, `Boolean`, or an object
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean`, or another nested object that meets the same conditions.
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api) must be a `Function`, `string`, `number`, `Array`, `boolean`, or an object
whose keys are strings and values are a `Function`, `string`, `number`, `Array`, `boolean`, or another nested object that meets the same conditions.
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. Any data / primitives sent in
the API become immutable and updates on either side of the bridge do not result in an update on the other side.
@ -97,9 +97,9 @@ has been included below for completeness:
| Type | Complexity | Parameter Support | Return Value Support | Limitations |
| ---- | ---------- | ----------------- | -------------------- | ----------- |
| `String` | Simple | ✅ | ✅ | N/A |
| `Number` | Simple | ✅ | ✅ | N/A |
| `Boolean` | Simple | ✅ | ✅ | N/A |
| `string` | Simple | ✅ | ✅ | N/A |
| `number` | Simple | ✅ | ✅ | N/A |
| `boolean` | Simple | ✅ | ✅ | N/A |
| `Object` | Complex | ✅ | ✅ | Keys must be supported using only "Simple" types in this table. Values must be supported in this table. Prototype modifications are dropped. Sending custom classes will copy values but not the prototype. |
| `Array` | Complex | ✅ | ✅ | Same limitations as the `Object` type |
| `Error` | Complex | ✅ | ✅ | Errors that are thrown are also copied, this can result in the message and stack trace of the error changing slightly due to being thrown in a different context |

Просмотреть файл

@ -50,7 +50,7 @@ Returns:
* `event` Event
* `cookie` [Cookie](structures/cookie.md) - The cookie that was changed.
* `cause` String - The cause of the change with one of the following values:
* `cause` string - The cause of the change with one of the following values:
* `explicit` - The cookie was changed directly by a consumer's action.
* `overwrite` - The cookie was automatically removed due to an insert
operation that overwrote it.
@ -58,7 +58,7 @@ Returns:
* `evicted` - The cookie was automatically evicted during garbage collection.
* `expired-overwrite` - The cookie was overwritten with an already-expired
expiration date.
* `removed` Boolean - `true` if the cookie was removed, `false` otherwise.
* `removed` boolean - `true` if the cookie was removed, `false` otherwise.
Emitted when a cookie is changed because it was added, edited, removed, or
expired.
@ -70,14 +70,14 @@ The following methods are available on instances of `Cookies`:
#### `cookies.get(filter)`
* `filter` Object
* `url` String (optional) - Retrieves cookies which are associated with
* `url` string (optional) - Retrieves cookies which are associated with
`url`. Empty implies retrieving cookies of all URLs.
* `name` String (optional) - Filters cookies by name.
* `domain` String (optional) - Retrieves cookies whose domains match or are
* `name` string (optional) - Filters cookies by name.
* `domain` string (optional) - Retrieves cookies whose domains match or are
subdomains of `domains`.
* `path` String (optional) - Retrieves cookies whose path matches `path`.
* `secure` Boolean (optional) - Filters cookies by their Secure property.
* `session` Boolean (optional) - Filters out session or persistent cookies.
* `path` string (optional) - Retrieves cookies whose path matches `path`.
* `secure` boolean (optional) - Filters cookies by their Secure property.
* `session` boolean (optional) - Filters out session or persistent cookies.
Returns `Promise<Cookie[]>` - A promise which resolves an array of cookie objects.
@ -87,19 +87,19 @@ the response.
#### `cookies.set(details)`
* `details` Object
* `url` String - The URL to associate the cookie with. The promise will be rejected if the URL is invalid.
* `name` String (optional) - The name of the cookie. Empty by default if omitted.
* `value` String (optional) - The value of the cookie. Empty by default if omitted.
* `domain` String (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.
* `path` String (optional) - The path of the cookie. Empty by default if omitted.
* `secure` Boolean (optional) - Whether the cookie should be marked as Secure. Defaults to
* `url` string - The URL to associate the cookie with. The promise will be rejected if the URL is invalid.
* `name` string (optional) - The name of the cookie. Empty by default if omitted.
* `value` string (optional) - The value of the cookie. Empty by default if omitted.
* `domain` string (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.
* `path` string (optional) - The path of the cookie. Empty by default if omitted.
* `secure` boolean (optional) - Whether the cookie should be marked as Secure. Defaults to
false unless [Same Site=None](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite#samesitenone_requires_secure) attribute is used.
* `httpOnly` Boolean (optional) - Whether the cookie should be marked as HTTP only.
* `httpOnly` boolean (optional) - Whether the cookie should be marked as HTTP only.
Defaults to false.
* `expirationDate` Double (optional) - The expiration date of the cookie as the number of
seconds since the UNIX epoch. If omitted then the cookie becomes a session
cookie and will not be retained between sessions.
* `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`.
* `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`.
Returns `Promise<void>` - A promise which resolves when the cookie has been set
@ -107,8 +107,8 @@ Sets a cookie with `details`.
#### `cookies.remove(url, name)`
* `url` String - The URL associated with the cookie.
* `name` String - The name of cookie to remove.
* `url` string - The URL associated with the cookie.
* `name` string - The name of cookie to remove.
Returns `Promise<void>` - A promise which resolves when the cookie has been removed

Просмотреть файл

@ -43,29 +43,29 @@ The `crashReporter` module has the following methods:
### `crashReporter.start(options)`
* `options` Object
* `submitURL` String (optional) - URL that crash reports will be sent to as
* `submitURL` string (optional) - URL that crash reports will be sent to as
POST. Required unless `uploadToServer` is `false`.
* `productName` String (optional) - Defaults to `app.name`.
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
* `productName` string (optional) - Defaults to `app.name`.
* `companyName` string (optional) _Deprecated_ - Deprecated alias for
`{ globalExtra: { _companyName: ... } }`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent
* `uploadToServer` boolean (optional) - Whether crash reports should be sent
to the server. If false, crash reports will be collected and stored in the
crashes directory, but not uploaded. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - If true, crashes generated
* `ignoreSystemCrashHandler` boolean (optional) - If true, crashes generated
in the main process will not be forwarded to the system crash handler.
Default is `false`.
* `rateLimit` Boolean (optional) _macOS_ _Windows_ - If true, limit the
* `rateLimit` boolean (optional) _macOS_ _Windows_ - If true, limit the
number of crashes uploaded to 1/hour. Default is `false`.
* `compress` Boolean (optional) - If true, crash reports will be compressed
* `compress` boolean (optional) - If true, crash reports will be compressed
and uploaded with `Content-Encoding: gzip`. Default is `true`.
* `extra` Record<String, String> (optional) - Extra string key/value
* `extra` Record<string, string> (optional) - Extra string key/value
annotations that will be sent along with crash reports that are generated
in the main process. Only string values are supported. Crashes generated in
child processes will not contain these extra
parameters to crash reports generated from child processes, call
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
child process.
* `globalExtra` Record<String, String> (optional) - Extra string key/value
* `globalExtra` Record<string, string> (optional) - Extra string key/value
annotations that will be sent along with any crash reports generated in any
process. These annotations cannot be changed once the crash reporter has
been started. If a key is present in both the global extra parameters and
@ -117,14 +117,14 @@ ID.
### `crashReporter.getUploadToServer()`
Returns `Boolean` - Whether reports should be submitted to the server. Set through
Returns `boolean` - Whether reports should be submitted to the server. Set through
the `start` method or `setUploadToServer`.
**Note:** This method is only available in the main process.
### `crashReporter.setUploadToServer(uploadToServer)`
* `uploadToServer` Boolean - Whether reports should be submitted to the server.
* `uploadToServer` boolean - Whether reports should be submitted to the server.
This would normally be controlled by user preferences. This has no effect if
called before `start` is called.
@ -133,8 +133,8 @@ called before `start` is called.
### `crashReporter.addExtraParameter(key, value)`
* `key` String - Parameter key, must be no longer than 39 bytes.
* `value` String - Parameter value, must be no longer than 127 bytes.
* `key` string - Parameter key, must be no longer than 39 bytes.
* `value` string - Parameter value, must be no longer than 127 bytes.
Set an extra parameter to be sent with the crash report. The values specified
here will be sent in addition to any values set via the `extra` option when
@ -154,14 +154,14 @@ values longer than the maximum length will be truncated.
### `crashReporter.removeExtraParameter(key)`
* `key` String - Parameter key, must be no longer than 39 bytes.
* `key` string - Parameter key, must be no longer than 39 bytes.
Remove an extra parameter from the current set of parameters. Future crashes
will not include this parameter.
### `crashReporter.getParameters()`
Returns `Record<String, String>` - The current 'extra' parameters of the crash reporter.
Returns `Record<string, string>` - The current 'extra' parameters of the crash reporter.
## In Node child processes
@ -194,15 +194,15 @@ See [`crashReporter.removeExtraParameter(key)`](#crashreporterremoveextraparamet
The crash reporter will send the following data to the `submitURL` as
a `multipart/form-data` `POST`:
* `ver` String - The version of Electron.
* `platform` String - e.g. 'win32'.
* `process_type` String - e.g. 'renderer'.
* `guid` String - e.g. '5e1286fc-da97-479e-918b-6bfb0c3d1c72'.
* `_version` String - The version in `package.json`.
* `_productName` String - The product name in the `crashReporter` `options`
* `ver` string - The version of Electron.
* `platform` string - e.g. 'win32'.
* `process_type` string - e.g. 'renderer'.
* `guid` string - e.g. '5e1286fc-da97-479e-918b-6bfb0c3d1c72'.
* `_version` string - The version in `package.json`.
* `_productName` string - The product name in the `crashReporter` `options`
object.
* `prod` String - Name of the underlying product. In this case Electron.
* `_companyName` String - The company name in the `crashReporter` `options`
* `prod` string - Name of the underlying product. In this case Electron.
* `_companyName` string - The company name in the `crashReporter` `options`
object.
* `upload_file_minidump` File - The crash report in the format of `minidump`.
* All level one properties of the `extra` object in the `crashReporter`

Просмотреть файл

@ -40,7 +40,7 @@ win.webContents.debugger.sendCommand('Network.enable')
Returns:
* `event` Event
* `reason` String - Reason for detaching debugger.
* `reason` string - Reason for detaching debugger.
Emitted when the debugging session is terminated. This happens either when
`webContents` is closed or devtools is invoked for the attached `webContents`.
@ -50,10 +50,10 @@ Emitted when the debugging session is terminated. This happens either when
Returns:
* `event` Event
* `method` String - Method name.
* `method` string - Method name.
* `params` any - Event parameters defined by the 'parameters'
attribute in the remote debugging protocol.
* `sessionId` String - Unique identifier of attached debugging session,
* `sessionId` string - Unique identifier of attached debugging session,
will match the value sent from `debugger.sendCommand`.
Emitted whenever the debugging target issues an instrumentation event.
@ -65,13 +65,13 @@ Emitted whenever the debugging target issues an instrumentation event.
#### `debugger.attach([protocolVersion])`
* `protocolVersion` String (optional) - Requested debugging protocol version.
* `protocolVersion` string (optional) - Requested debugging protocol version.
Attaches the debugger to the `webContents`.
#### `debugger.isAttached()`
Returns `Boolean` - Whether a debugger is attached to the `webContents`.
Returns `boolean` - Whether a debugger is attached to the `webContents`.
#### `debugger.detach()`
@ -79,10 +79,10 @@ Detaches the debugger from the `webContents`.
#### `debugger.sendCommand(method[, commandParams, sessionId])`
* `method` String - Method name, should be one of the methods defined by the
* `method` string - Method name, should be one of the methods defined by the
[remote debugging protocol][rdp].
* `commandParams` any (optional) - JSON object with request parameters.
* `sessionId` String (optional) - send command to the target with associated
* `sessionId` string (optional) - send command to the target with associated
debugging session id. The initial value can be obtained by sending
[Target.attachToTarget][attachToTarget] message.

Просмотреть файл

@ -88,13 +88,13 @@ The `desktopCapturer` module has the following methods:
### `desktopCapturer.getSources(options)`
* `options` Object
* `types` String[] - An array of Strings that lists the types of desktop sources
* `types` string[] - An array of strings that lists the types of desktop sources
to be captured, available types are `screen` and `window`.
* `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail
should be scaled to. Default is `150` x `150`. Set width or height to 0 when you do not need
the thumbnails. This will save the processing time required for capturing the content of each
window and screen.
* `fetchWindowIcons` Boolean (optional) - Set to true to enable fetching window icons. The default
* `fetchWindowIcons` boolean (optional) - Set to true to enable fetching window icons. The default
value is false. When false the appIcon property of the sources return null. Same if a source has
the type screen.

Просмотреть файл

@ -19,12 +19,12 @@ The `dialog` module has the following methods:
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional)
* `defaultPath` String (optional)
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
* `title` string (optional)
* `defaultPath` string (optional)
* `buttonLabel` string (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `properties` String[]&#32;(optional) - Contains which features the dialog should
* `properties` string[]&#32;(optional) - Contains which features the dialog should
use. The following values are supported:
* `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected.
@ -41,11 +41,11 @@ The `dialog` module has the following methods:
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `dontAddToRecent` _Windows_ - Do not add the item being opened to the recent documents list.
* `message` String (optional) _macOS_ - Message to display above input
* `message` string (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
Returns `String[] | undefined`, the file paths chosen by the user; if the dialog is cancelled it returns `undefined`.
Returns `string[] | undefined`, the file paths chosen by the user; if the dialog is cancelled it returns `undefined`.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@ -82,12 +82,12 @@ dialog.showOpenDialogSync(mainWindow, {
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional)
* `defaultPath` String (optional)
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
* `title` string (optional)
* `defaultPath` string (optional)
* `buttonLabel` string (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `properties` String[]&#32;(optional) - Contains which features the dialog should
* `properties` string[]&#32;(optional) - Contains which features the dialog should
use. The following values are supported:
* `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected.
@ -104,15 +104,15 @@ dialog.showOpenDialogSync(mainWindow, {
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `dontAddToRecent` _Windows_ - Do not add the item being opened to the recent documents list.
* `message` String (optional) _macOS_ - Message to display above input
* `message` string (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
Returns `Promise<Object>` - Resolve with an object containing the following:
* `canceled` Boolean - whether or not the dialog was canceled.
* `filePaths` String[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.
* `bookmarks` String[]&#32;(optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see [table here](#bookmarks-array).)
* `canceled` boolean - whether or not the dialog was canceled.
* `filePaths` string[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.
* `bookmarks` string[]&#32;(optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see [table here](#bookmarks-array).)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@ -154,27 +154,27 @@ dialog.showOpenDialog(mainWindow, {
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` String (optional) - Absolute directory path, absolute file
* `title` string (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` string (optional) - Absolute directory path, absolute file
path, or file name to use by default.
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
* `buttonLabel` string (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `message` String (optional) _macOS_ - Message to display above text fields.
* `nameFieldLabel` String (optional) _macOS_ - Custom label for the text
* `message` string (optional) _macOS_ - Message to display above text fields.
* `nameFieldLabel` string (optional) _macOS_ - Custom label for the text
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box,
* `showsTagField` boolean (optional) _macOS_ - Show the tags input box,
defaults to `true`.
* `properties` String[]&#32;(optional)
* `properties` string[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `showOverwriteConfirmation` _Linux_ - Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists.
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
Returns `String | undefined`, the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
Returns `string | undefined`, the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@ -185,30 +185,30 @@ The `filters` specifies an array of file types that can be displayed, see
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` String (optional) - Absolute directory path, absolute file
* `title` string (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` string (optional) - Absolute directory path, absolute file
path, or file name to use by default.
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
* `buttonLabel` string (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `message` String (optional) _macOS_ - Message to display above text fields.
* `nameFieldLabel` String (optional) _macOS_ - Custom label for the text
* `message` string (optional) _macOS_ - Message to display above text fields.
* `nameFieldLabel` string (optional) _macOS_ - Custom label for the text
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box, defaults to `true`.
* `properties` String[]&#32;(optional)
* `showsTagField` boolean (optional) _macOS_ - Show the tags input box, defaults to `true`.
* `properties` string[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `showOverwriteConfirmation` _Linux_ - Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists.
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
Returns `Promise<Object>` - Resolve with an object containing the following:
* `canceled` Boolean - whether or not the dialog was canceled.
* `filePath` String (optional) - If the dialog is canceled, this will be `undefined`.
* `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
* `canceled` boolean - whether or not the dialog was canceled.
* `filePath` string (optional) - If the dialog is canceled, this will be `undefined`.
* `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@ -222,29 +222,29 @@ expanding and collapsing the dialog.
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `message` String - Content of the message box.
* `type` String (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
* `message` string - Content of the message box.
* `type` string (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `buttons` String[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
* `buttons` string[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
be selected by default when the message box opens.
* `title` String (optional) - Title of the message box, some platforms will not show it.
* `detail` String (optional) - Extra information of the message.
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `title` string (optional) - Title of the message box, some platforms will not show it.
* `detail` string (optional) - Extra information of the message.
* `icon` ([NativeImage](native-image.md) | string) (optional)
* `textWidth` Integer (optional) _macOS_ - Custom width of the text in the message box.
* `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the
return value.
* `noLink` Boolean (optional) - On Windows Electron will try to figure out which one of
* `noLink` boolean (optional) - On Windows Electron will try to figure out which one of
the `buttons` are common buttons (like "Cancel" or "Yes"), and show the
others as command links in the dialog. This can make the dialog appear in
the style of modern Windows apps. If you don't like this behavior, you can
set `noLink` to `true`.
* `normalizeAccessKeys` Boolean (optional) - Normalize the keyboard access keys
* `normalizeAccessKeys` boolean (optional) - Normalize the keyboard access keys
across platforms. Default is `false`. Enabling this assumes `&` is used in
the button labels for the placement of the keyboard shortcut access key
and labels will be converted so they work correctly on each platform, `&`
@ -265,12 +265,12 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `message` String - Content of the message box.
* `type` String (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
* `message` string - Content of the message box.
* `type` string (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `buttons` String[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
* `buttons` string[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
be selected by default when the message box opens.
@ -279,11 +279,11 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
cancelled by the user. On macOS, `signal` does not work with message boxes
that do not have a parent window, since those message boxes run
synchronously due to platform limitations.
* `title` String (optional) - Title of the message box, some platforms will not show it.
* `detail` String (optional) - Extra information of the message.
* `checkboxLabel` String (optional) - If provided, the message box will
* `title` string (optional) - Title of the message box, some platforms will not show it.
* `detail` string (optional) - Extra information of the message.
* `checkboxLabel` string (optional) - If provided, the message box will
include a checkbox with the given label.
* `checkboxChecked` Boolean (optional) - Initial checked state of the
* `checkboxChecked` boolean (optional) - Initial checked state of the
checkbox. `false` by default.
* `icon` [NativeImage](native-image.md) (optional)
* `textWidth` Integer (optional) _macOS_ - Custom width of the text in the message box.
@ -291,12 +291,12 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the
return value.
* `noLink` Boolean (optional) - On Windows Electron will try to figure out which one of
* `noLink` boolean (optional) - On Windows Electron will try to figure out which one of
the `buttons` are common buttons (like "Cancel" or "Yes"), and show the
others as command links in the dialog. This can make the dialog appear in
the style of modern Windows apps. If you don't like this behavior, you can
set `noLink` to `true`.
* `normalizeAccessKeys` Boolean (optional) - Normalize the keyboard access keys
* `normalizeAccessKeys` boolean (optional) - Normalize the keyboard access keys
across platforms. Default is `false`. Enabling this assumes `&` is used in
the button labels for the placement of the keyboard shortcut access key
and labels will be converted so they work correctly on each platform, `&`
@ -307,8 +307,8 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
Returns `Promise<Object>` - resolves with a promise containing the following properties:
* `response` Number - The index of the clicked button.
* `checkboxChecked` Boolean - The checked state of the checkbox if
* `response` number - The index of the clicked button.
* `checkboxChecked` boolean - The checked state of the checkbox if
`checkboxLabel` was set. Otherwise `false`.
Shows a message box.
@ -317,8 +317,8 @@ The `browserWindow` argument allows the dialog to attach itself to a parent wind
### `dialog.showErrorBox(title, content)`
* `title` String - The title to display in the error box.
* `content` String - The text content to display in the error box.
* `title` string - The title to display in the error box.
* `content` string - The text content to display in the error box.
Displays a modal dialog that shows an error message.
@ -332,7 +332,7 @@ and no GUI dialog will appear.
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `certificate` [Certificate](structures/certificate.md) - The certificate to trust/import.
* `message` String - The message to display to the user.
* `message` string - The message to display to the user.
Returns `Promise<void>` - resolves when the certificate trust dialog is shown.

Просмотреть файл

@ -16,7 +16,7 @@ app.dock.bounce()
#### `dock.bounce([type])` _macOS_
* `type` String (optional) - Can be `critical` or `informational`. The default is
* `type` string (optional) - Can be `critical` or `informational`. The default is
`informational`
Returns `Integer` - an ID representing the request.
@ -38,19 +38,19 @@ Cancel the bounce of `id`.
#### `dock.downloadFinished(filePath)` _macOS_
* `filePath` String
* `filePath` string
Bounces the Downloads stack if the filePath is inside the Downloads folder.
#### `dock.setBadge(text)` _macOS_
* `text` String
* `text` string
Sets the string to be displayed in the docks badging area.
#### `dock.getBadge()` _macOS_
Returns `String` - The badge string of the dock.
Returns `string` - The badge string of the dock.
#### `dock.hide()` _macOS_
@ -62,7 +62,7 @@ Returns `Promise<void>` - Resolves when the dock icon is shown.
#### `dock.isVisible()` _macOS_
Returns `Boolean` - Whether the dock icon is visible.
Returns `boolean` - Whether the dock icon is visible.
#### `dock.setMenu(menu)` _macOS_
@ -76,6 +76,6 @@ Returns `Menu | null` - The application's [dock menu][dock-menu].
#### `dock.setIcon(image)` _macOS_
* `image` ([NativeImage](native-image.md) | String)
* `image` ([NativeImage](native-image.md) | string)
Sets the `image` associated with this dock icon.

Просмотреть файл

@ -45,7 +45,7 @@ win.webContents.session.on('will-download', (event, item, webContents) => {
Returns:
* `event` Event
* `state` String - Can be `progressing` or `interrupted`.
* `state` string - Can be `progressing` or `interrupted`.
Emitted when the download has been updated and is not done.
@ -59,7 +59,7 @@ The `state` can be one of following:
Returns:
* `event` Event
* `state` String - Can be `completed`, `cancelled` or `interrupted`.
* `state` string - Can be `completed`, `cancelled` or `interrupted`.
Emitted when the download is in a terminal state. This includes a completed
download, a cancelled download (via `downloadItem.cancel()`), and interrupted
@ -77,7 +77,7 @@ The `downloadItem` object has the following methods:
#### `downloadItem.setSavePath(path)`
* `path` String - Set the save file path of the download item.
* `path` string - Set the save file path of the download item.
The API is only available in session's `will-download` callback function.
If `path` doesn't exist, Electron will try to make the directory recursively.
@ -86,7 +86,7 @@ routine to determine the save path; this usually prompts a save dialog.
#### `downloadItem.getSavePath()`
Returns `String` - The save path of the download item. This will be either the path
Returns `string` - The save path of the download item. This will be either the path
set via `downloadItem.setSavePath(path)` or the path selected from the shown
save dialog.
@ -109,7 +109,7 @@ Pauses the download.
#### `downloadItem.isPaused()`
Returns `Boolean` - Whether the download is paused.
Returns `boolean` - Whether the download is paused.
#### `downloadItem.resume()`
@ -119,7 +119,7 @@ Resumes the download that has been paused.
#### `downloadItem.canResume()`
Returns `Boolean` - Whether the download can resume.
Returns `boolean` - Whether the download can resume.
#### `downloadItem.cancel()`
@ -127,19 +127,19 @@ Cancels the download operation.
#### `downloadItem.getURL()`
Returns `String` - The origin URL where the item is downloaded from.
Returns `string` - The origin URL where the item is downloaded from.
#### `downloadItem.getMimeType()`
Returns `String` - The files mime type.
Returns `string` - The files mime type.
#### `downloadItem.hasUserGesture()`
Returns `Boolean` - Whether the download has user gesture.
Returns `boolean` - Whether the download has user gesture.
#### `downloadItem.getFilename()`
Returns `String` - The file name of the download item.
Returns `string` - The file name of the download item.
**Note:** The file name is not always the same as the actual one saved in local
disk. If user changes the file name in a prompted download saving dialog, the
@ -157,27 +157,27 @@ Returns `Integer` - The received bytes of the download item.
#### `downloadItem.getContentDisposition()`
Returns `String` - The Content-Disposition field from the response
Returns `string` - The Content-Disposition field from the response
header.
#### `downloadItem.getState()`
Returns `String` - The current state. Can be `progressing`, `completed`, `cancelled` or `interrupted`.
Returns `string` - The current state. Can be `progressing`, `completed`, `cancelled` or `interrupted`.
**Note:** The following methods are useful specifically to resume a
`cancelled` item when session is restarted.
#### `downloadItem.getURLChain()`
Returns `String[]` - The complete URL chain of the item including any redirects.
Returns `string[]` - The complete URL chain of the item including any redirects.
#### `downloadItem.getLastModifiedTime()`
Returns `String` - Last-Modified header value.
Returns `string` - Last-Modified header value.
#### `downloadItem.getETag()`
Returns `String` - ETag header value.
Returns `string` - ETag header value.
#### `downloadItem.getStartTime()`
@ -188,7 +188,7 @@ started.
#### `downloadItem.savePath`
A `String` property that determines the save file path of the download item.
A `string` property that determines the save file path of the download item.
The property is only available in session's `will-download` callback function.
If user doesn't set the save path via the property, Electron will use the original

Просмотреть файл

@ -47,7 +47,7 @@ The `globalShortcut` module has the following methods:
* `accelerator` [Accelerator](accelerator.md)
* `callback` Function
Returns `Boolean` - Whether or not the shortcut was registered successfully.
Returns `boolean` - Whether or not the shortcut was registered successfully.
Registers a global shortcut of `accelerator`. The `callback` is called when
the registered shortcut is pressed by the user.
@ -66,7 +66,7 @@ the app has been authorized as a [trusted accessibility client](https://develope
### `globalShortcut.registerAll(accelerators, callback)`
* `accelerators` String[] - an array of [Accelerator](accelerator.md)s.
* `accelerators` string[] - an array of [Accelerator](accelerator.md)s.
* `callback` Function
Registers a global shortcut of all `accelerator` items in `accelerators`. The `callback` is called when any of the registered shortcuts are pressed by the user.
@ -87,7 +87,7 @@ the app has been authorized as a [trusted accessibility client](https://develope
* `accelerator` [Accelerator](accelerator.md)
Returns `Boolean` - Whether this application has registered `accelerator`.
Returns `boolean` - Whether this application has registered `accelerator`.
When the accelerator is already taken by other applications, this call will
still return `false`. This behavior is intended by operating systems, since they

Просмотреть файл

@ -23,16 +23,16 @@ The `inAppPurchase` module has the following methods:
### `inAppPurchase.purchaseProduct(productID[, quantity])`
* `productID` String - The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).
* `productID` string - The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).
* `quantity` Integer (optional) - The number of items the user wants to purchase.
Returns `Promise<Boolean>` - Returns `true` if the product is valid and added to the payment queue.
Returns `Promise<boolean>` - Returns `true` if the product is valid and added to the payment queue.
You should listen for the `transactions-updated` event as soon as possible and certainly before you call `purchaseProduct`.
### `inAppPurchase.getProducts(productIDs)`
* `productIDs` String[] - The identifiers of the products to get.
* `productIDs` string[] - The identifiers of the products to get.
Returns `Promise<Product[]>` - Resolves with an array of [`Product`](structures/product.md) objects.
@ -40,7 +40,7 @@ Retrieves the product descriptions.
### `inAppPurchase.canMakePayments()`
Returns `Boolean` - whether a user can make a payment.
Returns `boolean` - whether a user can make a payment.
### `inAppPurchase.restoreCompletedTransactions()`
@ -50,7 +50,7 @@ Restores finished transactions. This method can be called either to install purc
### `inAppPurchase.getReceiptURL()`
Returns `String` - the path to the receipt.
Returns `string` - the path to the receipt.
### `inAppPurchase.finishAllTransactions()`
@ -58,6 +58,6 @@ Completes all pending transactions.
### `inAppPurchase.finishTransactionByDate(date)`
* `date` String - The ISO formatted date of the transaction to finish.
* `date` string - The ISO formatted date of the transaction to finish.
Completes the pending transactions corresponding to the date.

Просмотреть файл

@ -48,7 +48,7 @@ An `Integer` indicating the HTTP response status code.
#### `response.statusMessage`
A `String` representing the HTTP status message.
A `string` representing the HTTP status message.
#### `response.headers`
@ -66,7 +66,7 @@ formatted as follows:
#### `response.httpVersion`
A `String` indicating the HTTP protocol version number. Typical values are '1.0'
A `string` indicating the HTTP protocol version number. Typical values are '1.0'
or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
Integer-valued readable properties that return respectively the HTTP major and
minor version numbers.

Просмотреть файл

@ -57,7 +57,7 @@ The `ipcMain` module has the following method to listen for events:
### `ipcMain.on(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `event` IpcMainEvent
* `...args` any[]
@ -67,7 +67,7 @@ Listens to `channel`, when a new message arrives `listener` would be called with
### `ipcMain.once(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `event` IpcMainEvent
* `...args` any[]
@ -77,7 +77,7 @@ only the next time a message is sent to `channel`, after which it is removed.
### `ipcMain.removeListener(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `...args` any[]
@ -86,13 +86,13 @@ Removes the specified `listener` from the listener array for the specified
### `ipcMain.removeAllListeners([channel])`
* `channel` String (optional)
* `channel` string (optional)
Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@ -129,7 +129,7 @@ provided to the renderer process. Please refer to
### `ipcMain.handleOnce(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@ -139,7 +139,7 @@ Handles a single `invoke`able IPC message, then removes the listener. See
### `ipcMain.removeHandler(channel)`
* `channel` String
* `channel` string
Removes any handler for `channel`, if present.

Просмотреть файл

@ -17,7 +17,7 @@ The `ipcRenderer` module has the following method to listen for events and send
### `ipcRenderer.on(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `...args` any[]
@ -27,7 +27,7 @@ Listens to `channel`, when a new message arrives `listener` would be called with
### `ipcRenderer.once(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `...args` any[]
@ -37,7 +37,7 @@ only the next time a message is sent to `channel`, after which it is removed.
### `ipcRenderer.removeListener(channel, listener)`
* `channel` String
* `channel` string
* `listener` Function
* `...args` any[]
@ -46,13 +46,13 @@ Removes the specified `listener` from the listener array for the specified
### `ipcRenderer.removeAllListeners(channel)`
* `channel` String
* `channel` string
Removes all listeners, or those of the specified `channel`.
### `ipcRenderer.send(channel, ...args)`
* `channel` String
* `channel` string
* `...args` any[]
Send an asynchronous message to the main process via `channel`, along with
@ -78,7 +78,7 @@ If you want to receive a single response from the main process, like the result
### `ipcRenderer.invoke(channel, ...args)`
* `channel` String
* `channel` string
* `...args` any[]
Returns `Promise<any>` - Resolves with the response from the main process.
@ -121,7 +121,7 @@ If you do not need a response to the message, consider using [`ipcRenderer.send`
### `ipcRenderer.sendSync(channel, ...args)`
* `channel` String
* `channel` string
* `...args` any[]
Returns `any` - The value sent back by the [`ipcMain`](ipc-main.md) handler.
@ -150,7 +150,7 @@ and replies by setting `event.returnValue`.
### `ipcRenderer.postMessage(channel, message, [transfer])`
* `channel` String
* `channel` string
* `message` any
* `transfer` MessagePort[] (optional)
@ -180,15 +180,15 @@ documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
### `ipcRenderer.sendTo(webContentsId, channel, ...args)`
* `webContentsId` Number
* `channel` String
* `webContentsId` number
* `channel` string
* `...args` any[]
Sends a message to a window with `webContentsId` via `channel`.
### `ipcRenderer.sendToHost(channel, ...args)`
* `channel` String
* `channel` string
* `...args` any[]
Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in

Просмотреть файл

@ -14,40 +14,40 @@ See [`Menu`](menu.md) for examples.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
* `type` string (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
* `label` String (optional)
* `sublabel` String (optional)
* `toolTip` String (optional) _macOS_ - Hover text for this menu item.
* `label` string (optional)
* `sublabel` string (optional)
* `toolTip` string (optional) _macOS_ - Hover text for this menu item.
* `accelerator` [Accelerator](accelerator.md) (optional)
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `enabled` Boolean (optional) - If false, the menu item will be greyed out and
* `icon` ([NativeImage](native-image.md) | string) (optional)
* `enabled` boolean (optional) - If false, the menu item will be greyed out and
unclickable.
* `acceleratorWorksWhenHidden` Boolean (optional) _macOS_ - default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`.
* `visible` Boolean (optional) - If false, the menu item will be entirely hidden.
* `checked` Boolean (optional) - Should only be specified for `checkbox` or `radio` type
* `acceleratorWorksWhenHidden` boolean (optional) _macOS_ - default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`.
* `visible` boolean (optional) - If false, the menu item will be entirely hidden.
* `checked` boolean (optional) - Should only be specified for `checkbox` or `radio` type
menu items.
* `registerAccelerator` Boolean (optional) _Linux_ _Windows_ - If false, the accelerator won't be registered
* `registerAccelerator` boolean (optional) _Linux_ _Windows_ - If false, the accelerator won't be registered
with the system, but it will still be displayed. Defaults to true.
* `sharingItem` SharingItem (optional) _macOS_ - The item to share when the `role` is `shareMenu`.
* `submenu` (MenuItemConstructorOptions[] | [Menu](menu.md)) (optional) - Should be specified
for `submenu` type menu items. If `submenu` is specified, the `type: 'submenu'` can be omitted.
If the value is not a [`Menu`](menu.md) then it will be automatically converted to one using
`Menu.buildFromTemplate`.
* `id` String (optional) - Unique within a single menu. If defined then it can be used
* `id` string (optional) - Unique within a single menu. If defined then it can be used
as a reference to this item by the position attribute.
* `before` String[] (optional) - Inserts this item before the item with the specified label. If
* `before` string[] (optional) - Inserts this item before the item with the specified label. If
the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies
that the menu item in question should be placed in the same “group” as the item.
* `after` String[] (optional) - Inserts this item after the item with the specified label. If the
* `after` string[] (optional) - Inserts this item after the item with the specified label. If the
referenced item doesn't exist the item will be inserted at the end of
the menu.
* `beforeGroupContaining` String[] (optional) - Provides a means for a single context menu to declare
* `beforeGroupContaining` string[] (optional) - Provides a means for a single context menu to declare
the placement of their containing group before the containing group of the item
with the specified label.
* `afterGroupContaining` String[] (optional) - Provides a means for a single context menu to declare
* `afterGroupContaining` string[] (optional) - Provides a means for a single context menu to declare
the placement of their containing group after the containing group of the item
with the specified label.
@ -128,12 +128,12 @@ The following properties are available on instances of `MenuItem`:
#### `menuItem.id`
A `String` indicating the item's unique id, this property can be
A `string` indicating the item's unique id, this property can be
dynamically changed.
#### `menuItem.label`
A `String` indicating the item's visible label.
A `string` indicating the item's visible label.
#### `menuItem.click`
@ -151,11 +151,11 @@ item's submenu, if present.
#### `menuItem.type`
A `String` indicating the type of the item. Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
A `string` indicating the type of the item. Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
#### `menuItem.accelerator`
@ -169,30 +169,30 @@ An `Accelerator | null` indicating the item's [user-assigned accelerator](https:
#### `menuItem.icon`
A `NativeImage | String` (optional) indicating the
A `NativeImage | string` (optional) indicating the
item's icon, if set.
#### `menuItem.sublabel`
A `String` indicating the item's sublabel.
A `string` indicating the item's sublabel.
#### `menuItem.toolTip` _macOS_
A `String` indicating the item's hover text.
A `string` indicating the item's hover text.
#### `menuItem.enabled`
A `Boolean` indicating whether the item is enabled, this property can be
A `boolean` indicating whether the item is enabled, this property can be
dynamically changed.
#### `menuItem.visible`
A `Boolean` indicating whether the item is visible, this property can be
A `boolean` indicating whether the item is visible, this property can be
dynamically changed.
#### `menuItem.checked`
A `Boolean` indicating whether the item is checked, this property can be
A `boolean` indicating whether the item is checked, this property can be
dynamically changed.
A `checkbox` menu item will toggle the `checked` property on and off when
@ -205,7 +205,7 @@ You can add a `click` function for additional behavior.
#### `menuItem.registerAccelerator`
A `Boolean` indicating if the accelerator should be registered with the
A `boolean` indicating if the accelerator should be registered with the
system or just displayed.
This property can be dynamically changed.
@ -218,7 +218,7 @@ This property can be dynamically changed.
#### `menuItem.commandId`
A `Number` indicating an item's sequential unique id.
A `number` indicating an item's sequential unique id.
#### `menuItem.menu`

Просмотреть файл

@ -45,7 +45,7 @@ be dynamically modified.
#### `Menu.sendActionToFirstResponder(action)` _macOS_
* `action` String
* `action` string
Sends the `action` to the first responder of application. This is used for
emulating default macOS menu behaviors. Usually you would use the
@ -73,11 +73,11 @@ The `menu` object has the following instance methods:
* `options` Object (optional)
* `window` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.
* `x` Number (optional) - Default is the current mouse cursor position.
* `x` number (optional) - Default is the current mouse cursor position.
Must be declared if `y` is declared.
* `y` Number (optional) - Default is the current mouse cursor position.
* `y` number (optional) - Default is the current mouse cursor position.
Must be declared if `x` is declared.
* `positioningItem` Number (optional) _macOS_ - The index of the menu item to
* `positioningItem` number (optional) _macOS_ - The index of the menu item to
be positioned under the mouse cursor at the specified coordinates. Default
is -1.
* `callback` Function (optional) - Called when menu is closed.
@ -98,7 +98,7 @@ Appends the `menuItem` to the menu.
#### `menu.getMenuItemById(id)`
* `id` String
* `id` string
Returns `MenuItem | null` the item with the specified `id`

Просмотреть файл

@ -8,7 +8,7 @@ In Electron, for the APIs that take images, you can pass either file paths or
`NativeImage` instances. An empty image will be used when `null` is passed.
For example, when creating a tray or setting a window's icon, you can pass an
image file path as a `String`:
image file path as a `string`:
```javascript
const { BrowserWindow, Tray } = require('electron')
@ -121,14 +121,14 @@ Creates an empty `NativeImage` instance.
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
* `path` String - path to a file that we intend to construct a thumbnail out of.
* `path` string - path to a file that we intend to construct a thumbnail out of.
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
### `nativeImage.createFromPath(path)`
* `path` String
* `path` string
Returns `NativeImage`
@ -170,7 +170,7 @@ Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or JP
### `nativeImage.createFromDataURL(dataURL)`
* `dataURL` String
* `dataURL` string
Returns `NativeImage`
@ -178,8 +178,8 @@ Creates a new `NativeImage` instance from `dataURL`.
### `nativeImage.createFromNamedImage(imageName[, hslShift])` _macOS_
* `imageName` String
* `hslShift` Number[] (optional)
* `imageName` string
* `hslShift` number[] (optional)
Returns `NativeImage`
@ -248,7 +248,7 @@ data.
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns `String` - The data URL of the image.
Returns `string` - The data URL of the image.
#### `image.getBitmap([options])`
@ -272,7 +272,7 @@ image instead of a copy, so you _must_ ensure that the associated
#### `image.isEmpty()`
Returns `Boolean` - Whether the image is empty.
Returns `boolean` - Whether the image is empty.
#### `image.getSize([scaleFactor])`
@ -284,13 +284,13 @@ If `scaleFactor` is passed, this will return the size corresponding to the image
#### `image.setTemplateImage(option)`
* `option` Boolean
* `option` boolean
Marks the image as a template image.
#### `image.isTemplateImage()`
Returns `Boolean` - Whether the image is a template image.
Returns `boolean` - Whether the image is a template image.
#### `image.crop(rect)`
@ -303,7 +303,7 @@ Returns `NativeImage` - The cropped image.
* `options` Object
* `width` Integer (optional) - Defaults to the image's width.
* `height` Integer (optional) - Defaults to the image's height.
* `quality` String (optional) - The desired quality of the resize image.
* `quality` string (optional) - The desired quality of the resize image.
Possible values are `good`, `better`, or `best`. The default is `best`.
These values express a desired quality/speed tradeoff. They are translated
into an algorithm-specific method that depends on the capabilities
@ -336,7 +336,7 @@ Returns `Float[]` - An array of all scale factors corresponding to representatio
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer
is specified as `buffer`.
* `buffer` Buffer (optional) - The buffer containing the raw image data.
* `dataURL` String (optional) - The data URL containing either a base 64
* `dataURL` string (optional) - The data URL containing either a base 64
encoded PNG or JPEG image.
Add an image representation for a specific scale factor. This can be used
@ -349,6 +349,6 @@ can be called on empty images.
#### `nativeImage.isMacTemplateImage` _macOS_
A `Boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).
A `boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).
Please note that this property only has an effect on macOS.

Просмотреть файл

@ -21,13 +21,13 @@ The `nativeTheme` module has the following properties:
### `nativeTheme.shouldUseDarkColors` _Readonly_
A `Boolean` for if the OS / Chromium currently has a dark mode enabled or is
A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
being instructed to show a dark-style UI. If you want to modify this value you
should use `themeSource` below.
### `nativeTheme.themeSource`
A `String` property that can be `system`, `light` or `dark`. It is used to override and supersede
A `string` property that can be `system`, `light` or `dark`. It is used to override and supersede
the value that Chromium has chosen to use internally.
Setting this property to `system` will remove the override and
@ -60,10 +60,10 @@ Your application should then always use `shouldUseDarkColors` to determine what
### `nativeTheme.shouldUseHighContrastColors` _macOS_ _Windows_ _Readonly_
A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled
A `boolean` for if the OS / Chromium currently has high-contrast mode enabled
or is being instructed to show a high-contrast UI.
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
A `Boolean` for if the OS / Chromium currently has an inverted color scheme
A `boolean` for if the OS / Chromium currently has an inverted color scheme
or is being instructed to use an inverted color scheme.

Просмотреть файл

@ -24,14 +24,14 @@ of the `app` module gets emitted.
### `netLog.startLogging(path[, options])`
* `path` String - File path to record network logs.
* `path` string - File path to record network logs.
* `options` Object (optional)
* `captureMode` String (optional) - What kinds of data should be captured. By
* `captureMode` string (optional) - What kinds of data should be captured. By
default, only metadata about requests will be captured. Setting this to
`includeSensitive` will include cookies and authentication data. Setting
it to `everything` will include all bytes transferred on sockets. Can be
`default`, `includeSensitive` or `everything`.
* `maxFileSize` Number (optional) - When the log grows beyond this size,
* `maxFileSize` number (optional) - When the log grows beyond this size,
logging will automatically stop. Defaults to unlimited.
Returns `Promise<void>` - resolves when the net log has begun recording.
@ -48,4 +48,4 @@ Stops recording network events. If not called, net logging will automatically en
### `netLog.currentlyLogging` _Readonly_
A `Boolean` property that indicates whether network logs are currently being recorded.
A `boolean` property that indicates whether network logs are currently being recorded.

Просмотреть файл

@ -54,7 +54,7 @@ The `net` module has the following methods:
### `net.request(options)`
* `options` (ClientRequestConstructorOptions | String) - The `ClientRequest` constructor options.
* `options` (ClientRequestConstructorOptions | string) - The `ClientRequest` constructor options.
Returns [`ClientRequest`](./client-request.md)
@ -65,7 +65,7 @@ requests according to the specified protocol scheme in the `options` object.
### `net.isOnline()`
Returns `Boolean` - Whether there is currently internet connection.
Returns `boolean` - Whether there is currently internet connection.
A return value of `false` is a pretty strong indicator that the user
won't be able to connect to remote sites. However, a return value of
@ -77,7 +77,7 @@ will be successful.
### `net.online` _Readonly_
A `Boolean` property. Whether there is currently internet connection.
A `boolean` property. Whether there is currently internet connection.
A return value of `false` is a pretty strong indicator that the user
won't be able to connect to remote sites. However, a return value of

Просмотреть файл

@ -24,24 +24,24 @@ The `Notification` class has the following static methods:
#### `Notification.isSupported()`
Returns `Boolean` - Whether or not desktop notifications are supported on the current system
Returns `boolean` - Whether or not desktop notifications are supported on the current system
### `new Notification([options])`
* `options` Object (optional)
* `title` String (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `subtitle` String (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` String (optional) - The body text of the notification, which will be displayed below the title or subtitle.
* `silent` Boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
* `icon` (String | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
* `hasReply` Boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
* `timeoutType` String (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
* `replyPlaceholder` String (optional) _macOS_ - The placeholder to write in the inline reply input field.
* `sound` String (optional) _macOS_ - The name of the sound file to play when the notification is shown.
* `urgency` String (optional) _Linux_ - The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
* `title` string (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `subtitle` string (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` string (optional) - The body text of the notification, which will be displayed below the title or subtitle.
* `silent` boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
* `icon` (string | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
* `hasReply` boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
* `timeoutType` string (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
* `replyPlaceholder` string (optional) _macOS_ - The placeholder to write in the inline reply input field.
* `sound` string (optional) _macOS_ - The name of the sound file to play when the notification is shown.
* `urgency` string (optional) _Linux_ - The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
* `actions` [NotificationAction[]](structures/notification-action.md) (optional) _macOS_ - Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation.
* `closeButtonText` String (optional) _macOS_ - A custom title for the close button of an alert. An empty string will cause the default localized text to be used.
* `toastXml` String (optional) _Windows_ - A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.
* `closeButtonText` string (optional) _macOS_ - A custom title for the close button of an alert. An empty string will cause the default localized text to be used.
* `toastXml` string (optional) _Windows_ - A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.
### Instance Events
@ -84,7 +84,7 @@ is closed.
Returns:
* `event` Event
* `reply` String - The string the user entered into the inline reply field.
* `reply` string - The string the user entered into the inline reply field.
Emitted when the user clicks the "Reply" button on a notification with `hasReply: true`.
@ -93,14 +93,14 @@ Emitted when the user clicks the "Reply" button on a notification with `hasReply
Returns:
* `event` Event
* `index` Number - The index of the action that was activated.
* `index` number - The index of the action that was activated.
#### Event: 'failed' _Windows_
Returns:
* `event` Event
* `error` String - The error encountered during execution of the `show()` method.
* `error` string - The error encountered during execution of the `show()` method.
Emitted when an error is encountered while creating and showing the native notification.
@ -126,45 +126,45 @@ Dismisses the notification.
#### `notification.title`
A `String` property representing the title of the notification.
A `string` property representing the title of the notification.
#### `notification.subtitle`
A `String` property representing the subtitle of the notification.
A `string` property representing the subtitle of the notification.
#### `notification.body`
A `String` property representing the body of the notification.
A `string` property representing the body of the notification.
#### `notification.replyPlaceholder`
A `String` property representing the reply placeholder of the notification.
A `string` property representing the reply placeholder of the notification.
#### `notification.sound`
A `String` property representing the sound of the notification.
A `string` property representing the sound of the notification.
#### `notification.closeButtonText`
A `String` property representing the close button text of the notification.
A `string` property representing the close button text of the notification.
#### `notification.silent`
A `Boolean` property representing whether the notification is silent.
A `boolean` property representing whether the notification is silent.
#### `notification.hasReply`
A `Boolean` property representing whether the notification has a reply action.
A `boolean` property representing whether the notification has a reply action.
#### `notification.urgency` _Linux_
A `String` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
A `string` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information.
#### `notification.timeoutType` _Linux_ _Windows_
A `String` property representing the type of timeout duration for the notification. Can be 'default' or 'never'.
A `string` property representing the type of timeout duration for the notification. Can be 'default' or 'never'.
If `timeoutType` is set to 'never', the notification never expires. It stays open until closed by the calling API or the user.
@ -174,7 +174,7 @@ A [`NotificationAction[]`](structures/notification-action.md) property represent
#### `notification.toastXml` _Windows_
A `String` property representing the custom Toast XML of the notification.
A `string` property representing the custom Toast XML of the notification.
### Playing Sounds

Просмотреть файл

@ -55,7 +55,7 @@ The `powerMonitor` module has the following methods:
* `idleThreshold` Integer
Returns `String` - The system's current state. Can be `active`, `idle`, `locked` or `unknown`.
Returns `string` - The system's current state. Can be `active`, `idle`, `locked` or `unknown`.
Calculate the system idle state. `idleThreshold` is the amount of time (in seconds)
before considered idle. `locked` is available on supported systems only.
@ -68,7 +68,7 @@ Calculate system idle time in seconds.
### `powerMonitor.isOnBatteryPower()`
Returns `Boolean` - Whether the system is on battery power.
Returns `boolean` - Whether the system is on battery power.
To monitor for changes in this property, use the `on-battery` and `on-ac`
events.
@ -77,6 +77,6 @@ events.
### `powerMonitor.onBatteryPower`
A `Boolean` property. True if the system is on battery power.
A `boolean` property. True if the system is on battery power.
See [`powerMonitor.isOnBatteryPower()`](#powermonitorisonbatterypower).

Просмотреть файл

@ -21,7 +21,7 @@ The `powerSaveBlocker` module has the following methods:
### `powerSaveBlocker.start(type)`
* `type` String - Power save blocker type.
* `type` string - Power save blocker type.
* `prevent-app-suspension` - Prevent the application from being suspended.
Keeps system active but allows screen to be turned off. Example use cases:
downloading a file or playing audio.
@ -53,4 +53,4 @@ Stops the specified power save blocker.
* `id` Integer - The power save blocker id returned by `powerSaveBlocker.start`.
Returns `Boolean` - Whether the corresponding `powerSaveBlocker` has started.
Returns `boolean` - Whether the corresponding `powerSaveBlocker` has started.

Просмотреть файл

@ -49,66 +49,66 @@ beginning to load the web page or the main script.
### `process.defaultApp` _Readonly_
A `Boolean`. When app is started by being passed as parameter to the default app, this
A `boolean`. When app is started by being passed as parameter to the default app, this
property is `true` in the main process, otherwise it is `undefined`.
### `process.isMainFrame` _Readonly_
A `Boolean`, `true` when the current renderer context is the "main" renderer
A `boolean`, `true` when the current renderer context is the "main" renderer
frame. If you want the ID of the current frame you should use `webFrame.routingId`.
### `process.mas` _Readonly_
A `Boolean`. For Mac App Store build, this property is `true`, for other builds it is
A `boolean`. For Mac App Store build, this property is `true`, for other builds it is
`undefined`.
### `process.noAsar`
A `Boolean` that controls ASAR support inside your application. Setting this to `true`
A `boolean` that controls ASAR support inside your application. Setting this to `true`
will disable the support for `asar` archives in Node's built-in modules.
### `process.noDeprecation`
A `Boolean` that controls whether or not deprecation warnings are printed to `stderr`.
A `boolean` that controls whether or not deprecation warnings are printed to `stderr`.
Setting this to `true` will silence deprecation warnings. This property is used
instead of the `--no-deprecation` command line flag.
### `process.resourcesPath` _Readonly_
A `String` representing the path to the resources directory.
A `string` representing the path to the resources directory.
### `process.sandboxed` _Readonly_
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
A `boolean`. When the renderer process is sandboxed, this property is `true`,
otherwise it is `undefined`.
### `process.contextIsolated` _Readonly_
A `Boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
A `boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
It is `undefined` in the main process.
### `process.throwDeprecation`
A `Boolean` that controls whether or not deprecation warnings will be thrown as
A `boolean` that controls whether or not deprecation warnings will be thrown as
exceptions. Setting this to `true` will throw errors for deprecations. This
property is used instead of the `--throw-deprecation` command line flag.
### `process.traceDeprecation`
A `Boolean` that controls whether or not deprecations printed to `stderr` include
A `boolean` that controls whether or not deprecations printed to `stderr` include
their stack trace. Setting this to `true` will print stack traces for deprecations.
This property is instead of the `--trace-deprecation` command line flag.
### `process.traceProcessWarnings`
A `Boolean` that controls whether or not process warnings printed to `stderr` include
A `boolean` that controls whether or not process warnings printed to `stderr` include
their stack trace. Setting this to `true` will print stack traces for process warnings
(including deprecations). This property is instead of the `--trace-warnings` command
line flag.
### `process.type` _Readonly_
A `String` representing the current process's type, can be:
A `string` representing the current process's type, can be:
* `browser` - The main process
* `renderer` - A renderer process
@ -116,20 +116,20 @@ A `String` representing the current process's type, can be:
### `process.versions.chrome` _Readonly_
A `String` representing Chrome's version string.
A `string` representing Chrome's version string.
### `process.versions.electron` _Readonly_
A `String` representing Electron's version string.
A `string` representing Electron's version string.
### `process.windowsStore` _Readonly_
A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
A `boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
for otherwise it is `undefined`.
### `process.contextId` _Readonly_
A `String` (optional) representing a globally unique ID of the current JavaScript context.
A `string` (optional) representing a globally unique ID of the current JavaScript context.
Each frame has its own JavaScript context. When contextIsolation is enabled, the isolated
world also has a separate JavaScript context.
This property is only available in the renderer process.
@ -144,7 +144,7 @@ Causes the main thread of the current process crash.
### `process.getCreationTime()`
Returns `Number | null` - The number of milliseconds since epoch, or `null` if the information is unavailable
Returns `number | null` - The number of milliseconds since epoch, or `null` if the information is unavailable
Indicates the creation time of the application.
The time is represented as number of milliseconds since epoch. It returns null if it is unable to get the process creation time.
@ -169,7 +169,7 @@ Returns `Object`:
* `heapSizeLimit` Integer
* `mallocedMemory` Integer
* `peakMallocedMemory` Integer
* `doesZapGarbage` Boolean
* `doesZapGarbage` boolean
Returns an object with V8 heap statistics. Note that all statistics are reported in Kilobytes.
@ -217,7 +217,7 @@ that all statistics are reported in Kilobytes.
### `process.getSystemVersion()`
Returns `String` - The version of the host operating system.
Returns `string` - The version of the host operating system.
Example:
@ -233,9 +233,9 @@ console.log(version)
### `process.takeHeapSnapshot(filePath)`
* `filePath` String - Path to the output file.
* `filePath` string - Path to the output file.
Returns `Boolean` - Indicates whether the snapshot has been created successfully.
Returns `boolean` - Indicates whether the snapshot has been created successfully.
Takes a V8 heap snapshot and saves it to `filePath`.

Просмотреть файл

@ -110,13 +110,13 @@ expect streaming responses.
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
@ -131,13 +131,13 @@ from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `Buffer` as a response.
@ -155,29 +155,29 @@ protocol.registerBufferProtocol('atom', (request, callback) => {
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `String` as a response.
Registers a protocol of `scheme` that will send a `string` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`
should be called with either a `string` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` ProtocolResponse
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send an HTTP request as a response.
@ -186,13 +186,13 @@ should be called with an object that has the `url` property.
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Returns `boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a stream as a response.
@ -235,95 +235,95 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether the protocol was successfully unregistered
Returns `boolean` - Whether the protocol was successfully unregistered
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether `scheme` is already registered.
Returns `boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
* `response` (string | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
which sends a `string` as a response.
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` [ProtocolResponse](structures/protocol-response.md)
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `scheme` string
* `handler` Function
* `request` [ProtocolRequest](structures/protocol-request.md)
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Returns `boolean` - Whether the protocol was successfully intercepted
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether the protocol was successfully unintercepted
Returns `boolean` - Whether the protocol was successfully unintercepted
Remove the interceptor installed for `scheme` and restore its original handler.
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
* `scheme` string
Returns `Boolean` - Whether `scheme` is already intercepted.
Returns `boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem

Просмотреть файл

@ -16,7 +16,7 @@ The `safeStorage` module has the following methods:
### `safeStorage.isEncryptionAvailable()`
Returns `Boolean` - Whether encryption is available.
Returns `boolean` - Whether encryption is available.
On Linux, returns true if the secret key is
available. On MacOS, returns true if Keychain is available.
@ -24,7 +24,7 @@ On Windows, returns true with no other preconditions.
### `safeStorage.encryptString(plainText)`
* `plainText` String
* `plainText` string
Returns `Buffer` - An array of bytes representing the encrypted string.
@ -34,7 +34,7 @@ This function will throw an error if encryption fails.
* `encrypted` Buffer
Returns `String` - the decrypted string. Decrypts the encrypted buffer
Returns `string` - the decrypted string. Decrypts the encrypted buffer
obtained with `safeStorage.encryptString` back into a string.
This function will throw an error if decryption fails.

Просмотреть файл

@ -76,7 +76,7 @@ Returns:
* `event` Event
* `display` [Display](structures/display.md)
* `changedMetrics` String[]
* `changedMetrics` string[]
Emitted when one or more metrics change in a `display`. The `changedMetrics` is
an array of strings that describe the changes. Possible changes are `bounds`,

Просмотреть файл

@ -37,12 +37,12 @@ Returns:
* `event` Event
* `messageDetails` Object - Information about the console message
* `message` String - The actual console message
* `versionId` Number - The version ID of the service worker that sent the log message
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `sourceUrl` String - The URL the message came from
* `lineNumber` Number - The line number of the source that triggered this console message
* `message` string - The actual console message
* `versionId` number - The version ID of the service worker that sent the log message
* `source` string - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
* `level` number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `sourceUrl` string - The URL the message came from
* `lineNumber` number - The line number of the source that triggered this console message
Emitted when a service worker logs something to the console.
@ -52,7 +52,7 @@ Returns:
* `event` Event
* `details` Object - Information about the registered service worker
* `scope` String - The base URL that a service worker is registered for
* `scope` string - The base URL that a service worker is registered for
Emitted when a service worker has been registered. Can occur after a call to [`navigator.serviceWorker.register('/sw.js')`](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register) successfully resolves or when a Chrome extension is loaded.
@ -62,11 +62,11 @@ The following methods are available on instances of `ServiceWorkers`:
#### `serviceWorkers.getAllRunning()`
Returns `Record<Number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
Returns `Record<number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
#### `serviceWorkers.getFromVersionID(versionId)`
* `versionId` Number
* `versionId` number
Returns [`ServiceWorkerInfo`](structures/service-worker-info.md) - Information about this service worker

Просмотреть файл

@ -25,9 +25,9 @@ The `session` module has the following methods:
### `session.fromPartition(partition[, options])`
* `partition` String
* `partition` string
* `options` Object (optional)
* `cache` Boolean - Whether to enable cache.
* `cache` boolean - Whether to enable cache.
Returns `Session` - A session instance from `partition` string. When there is an existing
`Session` with the same `partition`, it will be returned; otherwise a new
@ -132,9 +132,9 @@ initialized to support the start of the extension's background page.
Returns:
* `event` Event
* `preconnectUrl` String - The URL being requested for preconnection by the
* `preconnectUrl` string - The URL being requested for preconnection by the
renderer.
* `allowCredentials` Boolean - True if the renderer is requesting that the
* `allowCredentials` boolean - True if the renderer is requesting that the
connection include credentials (see the
[spec](https://w3c.github.io/resource-hints/#preconnect) for more details.)
@ -146,7 +146,7 @@ a [resource hint](https://w3c.github.io/resource-hints/).
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
* `languageCode` string - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully initialized. This
occurs after the file has been downloaded.
@ -156,7 +156,7 @@ occurs after the file has been downloaded.
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
* `languageCode` string - The language code of the dictionary file
Emitted when a hunspell dictionary file starts downloading
@ -165,7 +165,7 @@ Emitted when a hunspell dictionary file starts downloading
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
* `languageCode` string - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully downloaded
@ -174,7 +174,7 @@ Emitted when a hunspell dictionary file has been successfully downloaded
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
* `languageCode` string - The language code of the dictionary file
Emitted when a hunspell dictionary file download fails. For details
on the failure you should collect a netlog and inspect the download
@ -189,7 +189,7 @@ Returns:
* `deviceList` [HIDDevice[]](structures/hid-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
* `callback` Function
* `deviceId` String | null (optional)
* `deviceId` string | null (optional)
Emitted when a HID device needs to be selected when a call to
`navigator.hid.requestDevice` is made. `callback` should be called with
@ -278,7 +278,7 @@ Returns:
* `portList` [SerialPort[]](structures/serial-port.md)
* `webContents` [WebContents](web-contents.md)
* `callback` Function
* `portId` String
* `portId` string
Emitted when a serial port needs to be selected when a call to
`navigator.serial.requestPort` is made. `callback` should be called with
@ -377,13 +377,13 @@ Clears the sessions HTTP cache.
#### `ses.clearStorageData([options])`
* `options` Object (optional)
* `origin` String (optional) - Should follow `window.location.origin`s representation
* `origin` string (optional) - Should follow `window.location.origin`s representation
`scheme://host:port`.
* `storages` String[] (optional) - The types of storages to clear, can contain:
* `storages` string[] (optional) - The types of storages to clear, can contain:
`appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`,
`shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not
specified, clear all storage types.
* `quotas` String[] (optional) - The types of quotas to clear, can contain:
* `quotas` string[] (optional) - The types of quotas to clear, can contain:
`temporary`, `persistent`, `syncable`. If not specified, clear all quotas.
Returns `Promise<void>` - resolves when the storage data has been cleared.
@ -395,7 +395,7 @@ Writes any unwritten DOMStorage data to disk.
#### `ses.setProxy(config)`
* `config` Object
* `mode` String (optional) - The proxy mode. Should be one of `direct`,
* `mode` string (optional) - The proxy mode. Should be one of `direct`,
`auto_detect`, `pac_script`, `fixed_servers` or `system`. If it's
unspecified, it will be automatically determined based on other specified
options.
@ -416,9 +416,9 @@ Writes any unwritten DOMStorage data to disk.
Note that the system mode is different from setting no proxy configuration.
In the latter case, Electron falls back to the system settings
only if no command-line options influence the proxy configuration.
* `pacScript` String (optional) - The URL associated with the PAC file.
* `proxyRules` String (optional) - Rules indicating which proxies to use.
* `proxyBypassRules` String (optional) - Rules indicating which URLs should
* `pacScript` string (optional) - The URL associated with the PAC file.
* `proxyRules` string (optional) - Rules indicating which proxies to use.
* `proxyBypassRules` string (optional) - Rules indicating which URLs should
bypass the proxy settings.
Returns `Promise<void>` - Resolves when the proxy setting process is complete.
@ -497,7 +497,7 @@ The `proxyBypassRules` is a comma separated list of rules described below:
* `url` URL
Returns `Promise<String>` - Resolves with the proxy information for `url`.
Returns `Promise<string>` - Resolves with the proxy information for `url`.
#### `ses.forceReloadProxyConfig()`
@ -505,7 +505,7 @@ Returns `Promise<void>` - Resolves when the all internal states of proxy service
#### `ses.setDownloadPath(path)`
* `path` String - The download location.
* `path` string - The download location.
Sets download saving directory. By default, the download directory will be the
`Downloads` under the respective app folder.
@ -513,7 +513,7 @@ Sets download saving directory. By default, the download directory will be the
#### `ses.enableNetworkEmulation(options)`
* `options` Object
* `offline` Boolean (optional) - Whether to emulate network outage. Defaults
* `offline` boolean (optional) - Whether to emulate network outage. Defaults
to false.
* `latency` Double (optional) - RTT in ms. Defaults to 0 which will disable
latency throttling.
@ -539,8 +539,8 @@ window.webContents.session.enableNetworkEmulation({ offline: true })
#### `ses.preconnect(options)`
* `options` Object
* `url` String - URL for preconnect. Only the origin is relevant for opening the socket.
* `numSockets` Number (optional) - number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
* `url` string - URL for preconnect. Only the origin is relevant for opening the socket.
* `numSockets` number (optional) - number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
Preconnects the given number of sockets to an origin.
@ -559,11 +559,11 @@ the original network configuration.
* `proc` Function | null
* `request` Object
* `hostname` String
* `hostname` string
* `certificate` [Certificate](structures/certificate.md)
* `validatedCertificate` [Certificate](structures/certificate.md)
* `isIssuedByKnownRoot` Boolean - `true` if Chromium recognises the root CA as a standard root. If it isn't then it's probably the case that this certificate was generated by a MITM proxy whose root has been installed locally (for example, by a corporate proxy). This should not be trusted if the `verificationResult` is not `OK`.
* `verificationResult` String - `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
* `isIssuedByKnownRoot` boolean - `true` if Chromium recognises the root CA as a standard root. If it isn't then it's probably the case that this certificate was generated by a MITM proxy whose root has been installed locally (for example, by a corporate proxy). This should not be trusted if the `verificationResult` is not `OK`.
* `verificationResult` string - `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
* `errorCode` Integer - Error code.
* `callback` Function
* `verificationResult` Integer - Value can be one of certificate error codes
@ -601,7 +601,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `handler` Function | null
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
* `permission` String - The type of requested permission.
* `permission` string - The type of requested permission.
* `clipboard-read` - Request access to read from the clipboard.
* `media` - Request access to media devices such as camera, microphone and speakers.
* `display-capture` - Request access to capture the screen.
@ -615,14 +615,14 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `openExternal` - Request to open links in external applications.
* `unknown` - An unrecognized permission request
* `callback` Function
* `permissionGranted` Boolean - Allow or deny the permission.
* `permissionGranted` boolean - Allow or deny the permission.
* `details` Object - Some properties are only available on certain permission types.
* `externalURL` String (optional) - The url of the `openExternal` request.
* `securityOrigin` String (optional) - The security origin of the `media` request.
* `mediaTypes` String[] (optional) - The types of media access being requested, elements can be `video`
* `externalURL` string (optional) - The url of the `openExternal` request.
* `securityOrigin` string (optional) - The security origin of the `media` request.
* `mediaTypes` string[] (optional) - The types of media access being requested, elements can be `video`
or `audio`
* `requestingUrl` String - The last URL the requesting frame loaded
* `isMainFrame` Boolean - Whether the frame making the request is the main frame
* `requestingUrl` string - The last URL the requesting frame loaded
* `isMainFrame` boolean - Whether the frame making the request is the main frame
Sets the handler which can be used to respond to permission requests for the `session`.
Calling `callback(true)` will allow the permission and `callback(false)` will reject it.
@ -643,17 +643,17 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
#### `ses.setPermissionCheckHandler(handler)`
* `handler` Function\<Boolean> | null
* `handler` Function\<boolean> | null
* `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively.
* `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, `hid`, or `serial`.
* `requestingOrigin` String - The origin URL of the permission check
* `permission` string - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, `hid`, or `serial`.
* `requestingOrigin` string - The origin URL of the permission check
* `details` Object - Some properties are only available on certain permission types.
* `embeddingOrigin` String (optional) - The origin of the frame embedding the frame that made the permission check. Only set for cross-origin sub frames making permission checks.
* `securityOrigin` String (optional) - The security origin of the `media` check.
* `mediaType` String (optional) - The type of media access being requested, can be `video`,
* `embeddingOrigin` string (optional) - The origin of the frame embedding the frame that made the permission check. Only set for cross-origin sub frames making permission checks.
* `securityOrigin` string (optional) - The security origin of the `media` check.
* `mediaType` string (optional) - The type of media access being requested, can be `video`,
`audio` or `unknown`
* `requestingUrl` String (optional) - The last URL the requesting frame loaded. This is not provided for cross-origin sub frames making permission checks.
* `isMainFrame` Boolean - Whether the frame making the request is the main frame
* `requestingUrl` string (optional) - The last URL the requesting frame loaded. This is not provided for cross-origin sub frames making permission checks.
* `isMainFrame` boolean - Whether the frame making the request is the main frame
Sets the handler which can be used to respond to permission checks for the `session`.
Returning `true` will allow the permission and `false` will reject it. Please note that
@ -675,10 +675,10 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
#### `ses.setDevicePermissionHandler(handler)`
* `handler` Function\<Boolean> | null
* `handler` Function\<boolean> | null
* `details` Object
* `deviceType` String - The type of device that permission is being requested on, can be `hid` or `serial`.
* `origin` String - The origin URL of the device permission check.
* `deviceType` string - The type of device that permission is being requested on, can be `hid` or `serial`.
* `origin` string - The origin URL of the device permission check.
* `device` [HIDDevice](structures/hid-device.md) | [SerialPort](structures/serial-port.md)- the device that permission is being requested for.
* `frame` [WebFrameMain](web-frame-main.md) - WebFrameMain checking the device permission.
@ -753,7 +753,7 @@ Clears the host resolver cache.
#### `ses.allowNTLMCredentialsForDomains(domains)`
* `domains` String - A comma-separated list of servers for which
* `domains` string - A comma-separated list of servers for which
integrated authentication is enabled.
Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
@ -771,8 +771,8 @@ session.defaultSession.allowNTLMCredentialsForDomains('*')
#### `ses.setUserAgent(userAgent[, acceptLanguages])`
* `userAgent` String
* `acceptLanguages` String (optional)
* `userAgent` string
* `acceptLanguages` string (optional)
Overrides the `userAgent` and `acceptLanguages` for this session.
@ -784,22 +784,22 @@ This doesn't affect existing `WebContents`, and each `WebContents` can use
#### `ses.isPersistent()`
Returns `Boolean` - Whether or not this session is a persistent one. The default
Returns `boolean` - Whether or not this session is a persistent one. The default
`webContents` session of a `BrowserWindow` is persistent. When creating a session
from a partition, session prefixed with `persist:` will be persistent, while others
will be temporary.
#### `ses.getUserAgent()`
Returns `String` - The user agent for this session.
Returns `string` - The user agent for this session.
#### `ses.setSSLConfig(config)`
* `config` Object
* `minVersion` String (optional) - Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The
* `minVersion` string (optional) - Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The
minimum SSL version to allow when connecting to remote servers. Defaults to
`tls1`.
* `maxVersion` String (optional) - Can be `tls1.2` or `tls1.3`. The maximum SSL version
* `maxVersion` string (optional) - Can be `tls1.2` or `tls1.3`. The maximum SSL version
to allow when connecting to remote servers. Defaults to `tls1.3`.
* `disabledCipherSuites` Integer[] (optional) - List of cipher suites which
should be explicitly prevented from being used in addition to those
@ -818,13 +818,13 @@ reused for new connections.
#### `ses.getBlobData(identifier)`
* `identifier` String - Valid UUID.
* `identifier` string - Valid UUID.
Returns `Promise<Buffer>` - resolves with blob data.
#### `ses.downloadURL(url)`
* `url` String
* `url` string
Initiates a download of the resource at `url`.
The API will generate a [DownloadItem](download-item.md) that can be accessed
@ -836,13 +836,13 @@ unlike [`webContents.downloadURL`](web-contents.md#contentsdownloadurlurl).
#### `ses.createInterruptedDownload(options)`
* `options` Object
* `path` String - Absolute path of the download.
* `urlChain` String[] - Complete URL chain for the download.
* `mimeType` String (optional)
* `path` string - Absolute path of the download.
* `urlChain` string[] - Complete URL chain for the download.
* `mimeType` string (optional)
* `offset` Integer - Start range for the download.
* `length` Integer - Total length of the download.
* `lastModified` String (optional) - Last-Modified header value.
* `eTag` String (optional) - ETag header value.
* `lastModified` string (optional) - Last-Modified header value.
* `eTag` string (optional) - ETag header value.
* `startTime` Double (optional) - Time when download was started in
number of seconds since UNIX epoch.
@ -858,29 +858,29 @@ Returns `Promise<void>` - resolves when the sessions HTTP authentication cach
#### `ses.setPreloads(preloads)`
* `preloads` String[] - An array of absolute path to preload scripts
* `preloads` string[] - An array of absolute path to preload scripts
Adds scripts that will be executed on ALL web contents that are associated with
this session just before normal `preload` scripts run.
#### `ses.getPreloads()`
Returns `String[]` an array of paths to preload scripts that have been
Returns `string[]` an array of paths to preload scripts that have been
registered.
#### `ses.setSpellCheckerEnabled(enable)`
* `enable` Boolean
* `enable` boolean
Sets whether to enable the builtin spell checker.
#### `ses.isSpellCheckerEnabled()`
Returns `Boolean` - Whether the builtin spell checker is enabled.
Returns `boolean` - Whether the builtin spell checker is enabled.
#### `ses.setSpellCheckerLanguages(languages)`
* `languages` String[] - An array of language codes to enable the spellchecker for.
* `languages` string[] - An array of language codes to enable the spellchecker for.
The built in spellchecker does not automatically detect what language a user is typing in. In order for the
spell checker to correctly check their words you must call this API with an array of language codes. You can
@ -890,7 +890,7 @@ get the list of supported language codes with the `ses.availableSpellCheckerLang
#### `ses.getSpellCheckerLanguages()`
Returns `String[]` - An array of language codes the spellchecker is enabled for. If this list is empty the spellchecker
Returns `string[]` - An array of language codes the spellchecker is enabled for. If this list is empty the spellchecker
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
setting with the current OS locale. This setting is persisted across restarts.
@ -898,7 +898,7 @@ setting with the current OS locale. This setting is persisted across restarts.
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`
* `url` String - A base URL for Electron to download hunspell dictionaries from.
* `url` string - A base URL for Electron to download hunspell dictionaries from.
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
@ -914,32 +914,32 @@ note the trailing slash. The URL to the dictionaries is formed as `${url}${file
#### `ses.listWordsInSpellCheckerDictionary()`
Returns `Promise<String[]>` - An array of all words in app's custom dictionary.
Returns `Promise<string[]>` - An array of all words in app's custom dictionary.
Resolves when the full dictionary is loaded from disk.
#### `ses.addWordToSpellCheckerDictionary(word)`
* `word` String - The word you want to add to the dictionary
* `word` string - The word you want to add to the dictionary
Returns `Boolean` - Whether the word was successfully written to the custom dictionary. This API
Returns `boolean` - Whether the word was successfully written to the custom dictionary. This API
will not work on non-persistent (in-memory) sessions.
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
#### `ses.removeWordFromSpellCheckerDictionary(word)`
* `word` String - The word you want to remove from the dictionary
* `word` string - The word you want to remove from the dictionary
Returns `Boolean` - Whether the word was successfully removed from the custom dictionary. This API
Returns `boolean` - Whether the word was successfully removed from the custom dictionary. This API
will not work on non-persistent (in-memory) sessions.
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
#### `ses.loadExtension(path[, options])`
* `path` String - Path to a directory containing an unpacked Chrome extension
* `path` string - Path to a directory containing an unpacked Chrome extension
* `options` Object (optional)
* `allowFileAccess` Boolean - Whether to allow the extension to read local files over `file://`
* `allowFileAccess` boolean - Whether to allow the extension to read local files over `file://`
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
devtools extensions on `file://` URLs. Defaults to false.
@ -984,7 +984,7 @@ supported and will throw an error.
#### `ses.removeExtension(extensionId)`
* `extensionId` String - ID of extension to remove
* `extensionId` string - ID of extension to remove
Unloads an extension.
@ -993,7 +993,7 @@ is emitted.
#### `ses.getExtension(extensionId)`
* `extensionId` String - ID of extension to query
* `extensionId` string - ID of extension to query
Returns `Extension` | `null` - The loaded extension with the given ID.
@ -1009,7 +1009,7 @@ is emitted.
#### `ses.getStoragePath()`
A `String | null` indicating the absolute file system path where data for this
A `string | null` indicating the absolute file system path where data for this
session is persisted on disk. For in memory sessions this returns `null`.
### Instance Properties
@ -1018,16 +1018,16 @@ The following properties are available on instances of `Session`:
#### `ses.availableSpellCheckerLanguages` _Readonly_
A `String[]` array which consists of all the known available spell checker languages. Providing a language
A `string[]` array which consists of all the known available spell checker languages. Providing a language
code to the `setSpellCheckerLanguages` API that isn't in this array will result in an error.
#### `ses.spellCheckerEnabled`
A `Boolean` indicating whether builtin spell checker is enabled.
A `boolean` indicating whether builtin spell checker is enabled.
#### `ses.storagePath` _Readonly_
A `String | null` indicating the absolute file system path where data for this
A `string | null` indicating the absolute file system path where data for this
session is persisted on disk. For in memory sessions this returns `null`.
#### `ses.cookies` _Readonly_

Просмотреть файл

@ -27,11 +27,11 @@ The `shareMenu` object has the following instance methods:
* `options` PopupOptions (optional)
* `browserWindow` [BrowserWindow](browser-window.md) (optional) - Default is the focused window.
* `x` Number (optional) - Default is the current mouse cursor position.
* `x` number (optional) - Default is the current mouse cursor position.
Must be declared if `y` is declared.
* `y` Number (optional) - Default is the current mouse cursor position.
* `y` number (optional) - Default is the current mouse cursor position.
Must be declared if `x` is declared.
* `positioningItem` Number (optional) _macOS_ - The index of the menu item to
* `positioningItem` number (optional) _macOS_ - The index of the menu item to
be positioned under the mouse cursor at the specified coordinates. Default
is -1.
* `callback` Function (optional) - Called when menu is closed.

Просмотреть файл

@ -22,24 +22,24 @@ The `shell` module has the following methods:
### `shell.showItemInFolder(fullPath)`
* `fullPath` String
* `fullPath` string
Show the given file in a file manager. If possible, select the file.
### `shell.openPath(path)`
* `path` String
* `path` string
Returns `Promise<String>` - Resolves with a string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Returns `Promise<string>` - Resolves with a string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Open the given file in the desktop's default manner.
### `shell.openExternal(url[, options])`
* `url` String - Max 2081 characters on windows.
* `url` string - Max 2081 characters on windows.
* `options` Object (optional)
* `activate` Boolean (optional) _macOS_ - `true` to bring the opened application to the foreground. The default is `true`.
* `workingDirectory` String (optional) _Windows_ - The working directory.
* `activate` boolean (optional) _macOS_ - `true` to bring the opened application to the foreground. The default is `true`.
* `workingDirectory` string (optional) _Windows_ - The working directory.
Returns `Promise<void>`
@ -47,7 +47,7 @@ Open the given external protocol URL in the desktop's default manner. (For examp
### `shell.trashItem(path)`
* `path` String - path to the item to be moved to the trash.
* `path` string - path to the item to be moved to the trash.
Returns `Promise<void>` - Resolves when the operation has been completed.
Rejects if there was an error while deleting the requested item.
@ -61,21 +61,21 @@ Play the beep sound.
### `shell.writeShortcutLink(shortcutPath[, operation], options)` _Windows_
* `shortcutPath` String
* `operation` String (optional) - Default is `create`, can be one of following:
* `shortcutPath` string
* `operation` string (optional) - Default is `create`, can be one of following:
* `create` - Creates a new shortcut, overwriting if necessary.
* `update` - Updates specified properties only on an existing shortcut.
* `replace` - Overwrites an existing shortcut, fails if the shortcut doesn't
exist.
* `options` [ShortcutDetails](structures/shortcut-details.md)
Returns `Boolean` - Whether the shortcut was created successfully.
Returns `boolean` - Whether the shortcut was created successfully.
Creates or updates a shortcut link at `shortcutPath`.
### `shell.readShortcutLink(shortcutPath)` _Windows_
* `shortcutPath` String
* `shortcutPath` string
Returns [`ShortcutDetails`](structures/shortcut-details.md)

Просмотреть файл

@ -1,4 +1,4 @@
# BluetoothDevice Object
* `deviceName` String
* `deviceId` String
* `deviceName` string
* `deviceId` string

Просмотреть файл

@ -1,8 +1,8 @@
# CertificatePrincipal Object
* `commonName` String - Common Name.
* `organizations` String[] - Organization names.
* `organizationUnits` String[] - Organization Unit names.
* `locality` String - Locality.
* `state` String - State or province.
* `country` String - Country or region.
* `commonName` string - Common Name.
* `organizations` string[] - Organization names.
* `organizationUnits` string[] - Organization Unit names.
* `locality` string - Locality.
* `state` string - State or province.
* `country` string - Country or region.

Просмотреть файл

@ -1,12 +1,12 @@
# Certificate Object
* `data` String - PEM encoded data
* `data` string - PEM encoded data
* `issuer` [CertificatePrincipal](certificate-principal.md) - Issuer principal
* `issuerName` String - Issuer's Common Name
* `issuerName` string - Issuer's Common Name
* `issuerCert` Certificate - Issuer certificate (if not self-signed)
* `subject` [CertificatePrincipal](certificate-principal.md) - Subject principal
* `subjectName` String - Subject's Common Name
* `serialNumber` String - Hex value represented string
* `validStart` Number - Start date of the certificate being valid in seconds
* `validExpiry` Number - End date of the certificate being valid in seconds
* `fingerprint` String - Fingerprint of the certificate
* `subjectName` string - Subject's Common Name
* `serialNumber` string - Hex value represented string
* `validStart` number - Start date of the certificate being valid in seconds
* `validExpiry` number - End date of the certificate being valid in seconds
* `fingerprint` string - Fingerprint of the certificate

Просмотреть файл

@ -1,15 +1,15 @@
# Cookie Object
* `name` String - The name of the cookie.
* `value` String - The value of the cookie.
* `domain` String (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains.
* `hostOnly` Boolean (optional) - Whether the cookie is a host-only cookie; this will only be `true` if no domain was passed.
* `path` String (optional) - The path of the cookie.
* `secure` Boolean (optional) - Whether the cookie is marked as secure.
* `httpOnly` Boolean (optional) - Whether the cookie is marked as HTTP only.
* `session` Boolean (optional) - Whether the cookie is a session cookie or a persistent
* `name` string - The name of the cookie.
* `value` string - The value of the cookie.
* `domain` string (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains.
* `hostOnly` boolean (optional) - Whether the cookie is a host-only cookie; this will only be `true` if no domain was passed.
* `path` string (optional) - The path of the cookie.
* `secure` boolean (optional) - Whether the cookie is marked as secure.
* `httpOnly` boolean (optional) - Whether the cookie is marked as HTTP only.
* `session` boolean (optional) - Whether the cookie is a session cookie or a persistent
cookie with an expiration date.
* `expirationDate` Double (optional) - The expiration date of the cookie as
the number of seconds since the UNIX epoch. Not provided for session
cookies.
* `sameSite` String - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy applied to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`.
* `sameSite` string - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy applied to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`.

Просмотреть файл

@ -1,7 +1,7 @@
# CPUUsage Object
* `percentCPUUsage` Number - Percentage of CPU used since the last call to getCPUUsage.
* `percentCPUUsage` number - Percentage of CPU used since the last call to getCPUUsage.
First call returns 0.
* `idleWakeupsPerSecond` Number - The number of average idle CPU wakeups per second
* `idleWakeupsPerSecond` number - The number of average idle CPU wakeups per second
since the last call to getCPUUsage. First call returns 0. Will always return 0 on
Windows.

Просмотреть файл

@ -1,4 +1,4 @@
# CrashReport Object
* `date` Date
* `id` String
* `id` string

Просмотреть файл

@ -1,11 +1,11 @@
# CustomScheme Object
* `scheme` String - Custom schemes to be registered with options.
* `scheme` string - Custom schemes to be registered with options.
* `privileges` Object (optional)
* `standard` Boolean (optional) - Default false.
* `secure` Boolean (optional) - Default false.
* `bypassCSP` Boolean (optional) - Default false.
* `allowServiceWorkers` Boolean (optional) - Default false.
* `supportFetchAPI` Boolean (optional) - Default false.
* `corsEnabled` Boolean (optional) - Default false.
* `stream` Boolean (optional) - Default false.
* `standard` boolean (optional) - Default false.
* `secure` boolean (optional) - Default false.
* `bypassCSP` boolean (optional) - Default false.
* `allowServiceWorkers` boolean (optional) - Default false.
* `supportFetchAPI` boolean (optional) - Default false.
* `corsEnabled` boolean (optional) - Default false.
* `stream` boolean (optional) - Default false.

Просмотреть файл

@ -1,13 +1,13 @@
# DesktopCapturerSource Object
* `id` String - The identifier of a window or screen that can be used as a
* `id` string - The identifier of a window or screen that can be used as a
`chromeMediaSourceId` constraint when calling
[`navigator.webkitGetUserMedia`]. The format of the identifier will be
`window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
the current process, and 0 for all others. ZZ is a sequential number
that represents the screen, and it does not equal to the index in the
source's name.
* `name` String - A screen source will be named either `Entire Screen` or
* `name` string - A screen source will be named either `Entire Screen` or
`Screen <index>`, while the name of a window source will match the window
title.
* `thumbnail` [NativeImage](../native-image.md) - A thumbnail image. **Note:**
@ -15,7 +15,7 @@
`thumbnailSize` specified in the `options` passed to
`desktopCapturer.getSources`. The actual size depends on the scale of the
screen or window.
* `display_id` String - A unique identifier that will correspond to the `id` of
* `display_id` string - A unique identifier that will correspond to the `id` of
the matching [Display](display.md) returned by the [Screen API](../screen.md).
On some platforms, this is equivalent to the `XX` portion of the `id` field
above and on others it will differ. It will be an empty string if not

Просмотреть файл

@ -1,21 +1,21 @@
# Display Object
* `id` Number - Unique identifier associated with the display.
* `rotation` Number - Can be 0, 90, 180, 270, represents screen rotation in
* `id` number - Unique identifier associated with the display.
* `rotation` number - Can be 0, 90, 180, 270, represents screen rotation in
clock-wise degrees.
* `scaleFactor` Number - Output device's pixel scale factor.
* `touchSupport` String - Can be `available`, `unavailable`, `unknown`.
* `monochrome` Boolean - Whether or not the display is a monochrome display.
* `accelerometerSupport` String - Can be `available`, `unavailable`, `unknown`.
* `colorSpace` String - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions
* `colorDepth` Number - The number of bits per pixel.
* `depthPerComponent` Number - The number of bits per color component.
* `displayFrequency` Number - The display refresh rate.
* `scaleFactor` number - Output device's pixel scale factor.
* `touchSupport` string - Can be `available`, `unavailable`, `unknown`.
* `monochrome` boolean - Whether or not the display is a monochrome display.
* `accelerometerSupport` string - Can be `available`, `unavailable`, `unknown`.
* `colorSpace` string - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions
* `colorDepth` number - The number of bits per pixel.
* `depthPerComponent` number - The number of bits per color component.
* `displayFrequency` number - The display refresh rate.
* `bounds` [Rectangle](rectangle.md) - the bounds of the display in DIP points.
* `size` [Size](size.md)
* `workArea` [Rectangle](rectangle.md) - the work area of the display in DIP points.
* `workAreaSize` [Size](size.md)
* `internal` Boolean - `true` for an internal display and `false` for an external display
* `internal` boolean - `true` for an internal display and `false` for an external display
The `Display` object represents a physical display connected to the system. A
fake `Display` may exist on a headless system, or a `Display` may correspond to

Просмотреть файл

@ -1,4 +1,4 @@
# ExtensionInfo Object
* `name` String
* `version` String
* `name` string
* `version` string

Просмотреть файл

@ -1,8 +1,8 @@
# Extension Object
* `id` String
* `id` string
* `manifest` any - Copy of the [extension's manifest data](https://developer.chrome.com/extensions/manifest).
* `name` String
* `path` String - The extension's file path.
* `version` String
* `url` String - The extension's `chrome-extension://` URL.
* `name` string
* `path` string - The extension's file path.
* `version` string
* `url` string - The extension's `chrome-extension://` URL.

Просмотреть файл

@ -1,4 +1,4 @@
# FileFilter Object
* `name` String
* `extensions` String[]
* `name` string
* `extensions` string[]

Просмотреть файл

@ -1,4 +1,4 @@
# FilePathWithHeaders Object
* `path` String - The path to the file to send.
* `path` string - The path to the file to send.
* `headers` Record<string, string> (optional) - Additional headers to be sent.

Просмотреть файл

@ -1,18 +1,18 @@
# GPUFeatureStatus Object
* `2d_canvas` String - Canvas.
* `flash_3d` String - Flash.
* `flash_stage3d` String - Flash Stage3D.
* `flash_stage3d_baseline` String - Flash Stage3D Baseline profile.
* `gpu_compositing` String - Compositing.
* `multiple_raster_threads` String - Multiple Raster Threads.
* `native_gpu_memory_buffers` String - Native GpuMemoryBuffers.
* `rasterization` String - Rasterization.
* `video_decode` String - Video Decode.
* `video_encode` String - Video Encode.
* `vpx_decode` String - VPx Video Decode.
* `webgl` String - WebGL.
* `webgl2` String - WebGL2.
* `2d_canvas` string - Canvas.
* `flash_3d` string - Flash.
* `flash_stage3d` string - Flash Stage3D.
* `flash_stage3d_baseline` string - Flash Stage3D Baseline profile.
* `gpu_compositing` string - Compositing.
* `multiple_raster_threads` string - Multiple Raster Threads.
* `native_gpu_memory_buffers` string - Native GpuMemoryBuffers.
* `rasterization` string - Rasterization.
* `video_decode` string - Video Decode.
* `video_encode` string - Video Encode.
* `vpx_decode` string - VPx Video Decode.
* `webgl` string - WebGL.
* `webgl2` string - WebGL2.
Possible values:

Просмотреть файл

@ -1,8 +1,8 @@
# HIDDevice Object
* `deviceId` String - Unique identifier for the device.
* `name` String - Name of the device.
* `deviceId` string - Unique identifier for the device.
* `name` string - Name of the device.
* `vendorId` Integer - The USB vendor ID.
* `productId` Integer - The USB product ID.
* `serialNumber` String (optional) - The USB device serial number.
* `guid` String (optional) - Unique identifier for the HID interface. A device may have multiple HID interfaces.
* `serialNumber` string (optional) - The USB device serial number.
* `guid` string (optional) - Unique identifier for the HID interface. A device may have multiple HID interfaces.

Просмотреть файл

@ -1,6 +1,6 @@
# InputEvent Object
* `modifiers` String[] (optional) - An array of modifiers of the event, can
* `modifiers` string[] (optional) - An array of modifiers of the event, can
be `shift`, `control`, `ctrl`, `alt`, `meta`, `command`, `cmd`, `isKeypad`,
`isAutoRepeat`, `leftButtonDown`, `middleButtonDown`, `rightButtonDown`,
`capsLock`, `numLock`, `left`, `right`.

Просмотреть файл

@ -1,8 +1,8 @@
# IOCounters Object
* `readOperationCount` Number - The number of I/O read operations.
* `writeOperationCount` Number - The number of I/O write operations.
* `otherOperationCount` Number - Then number of I/O other operations.
* `readTransferCount` Number - The number of I/O read transfers.
* `writeTransferCount` Number - The number of I/O write transfers.
* `otherTransferCount` Number - Then number of I/O other transfers.
* `readOperationCount` number - The number of I/O read operations.
* `writeOperationCount` number - The number of I/O write operations.
* `otherOperationCount` number - Then number of I/O other operations.
* `readTransferCount` number - The number of I/O read transfers.
* `writeTransferCount` number - The number of I/O write transfers.
* `otherTransferCount` number - Then number of I/O other transfers.

Просмотреть файл

@ -7,5 +7,5 @@
* `senderFrame` WebFrameMain _Readonly_ - The frame that sent this message
* `ports` MessagePortMain[] - A list of MessagePorts that were transferred with this message
* `reply` Function - A function that will send an IPC message to the renderer frame that sent the original message that you are currently handling. You should use this method to "reply" to the sent message in order to guarantee the reply will go to the correct process and frame.
* `channel` String
* `channel` string
* `...args` any[]

Просмотреть файл

@ -1,6 +1,6 @@
# JumpListCategory Object
* `type` String (optional) - One of the following:
* `type` string (optional) - One of the following:
* `tasks` - Items in this category will be placed into the standard `Tasks`
category. There can be only one such category, and it will always be
displayed at the bottom of the Jump List.
@ -10,7 +10,7 @@
of the category and its items are set by Windows. Items may be added to
this category indirectly using `app.addRecentDocument(path)`.
* `custom` - Displays tasks or file links, `name` must be set by the app.
* `name` String (optional) - Must be set if `type` is `custom`, otherwise it should be
* `name` string (optional) - Must be set if `type` is `custom`, otherwise it should be
omitted.
* `items` JumpListItem[] (optional) - Array of [`JumpListItem`](jump-list-item.md) objects if `type` is `tasks` or
`custom`, otherwise it should be omitted.

Просмотреть файл

@ -1,29 +1,29 @@
# JumpListItem Object
* `type` String (optional) - One of the following:
* `type` string (optional) - One of the following:
* `task` - A task will launch an app with specific arguments.
* `separator` - Can be used to separate items in the standard `Tasks`
category.
* `file` - A file link will open a file using the app that created the
Jump List, for this to work the app must be registered as a handler for
the file type (though it doesn't have to be the default handler).
* `path` String (optional) - Path of the file to open, should only be set if `type` is
* `path` string (optional) - Path of the file to open, should only be set if `type` is
`file`.
* `program` String (optional) - Path of the program to execute, usually you should
* `program` string (optional) - Path of the program to execute, usually you should
specify `process.execPath` which opens the current program. Should only be
set if `type` is `task`.
* `args` String (optional) - The command line arguments when `program` is executed. Should
* `args` string (optional) - The command line arguments when `program` is executed. Should
only be set if `type` is `task`.
* `title` String (optional) - The text to be displayed for the item in the Jump List.
* `title` string (optional) - The text to be displayed for the item in the Jump List.
Should only be set if `type` is `task`.
* `description` String (optional) - Description of the task (displayed in a tooltip).
* `description` string (optional) - Description of the task (displayed in a tooltip).
Should only be set if `type` is `task`. Maximum length 260 characters.
* `iconPath` String (optional) - The absolute path to an icon to be displayed in a
* `iconPath` string (optional) - The absolute path to an icon to be displayed in a
Jump List, which can be an arbitrary resource file that contains an icon
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to
show the program icon.
* `iconIndex` Number (optional) - The index of the icon in the resource file. If a
* `iconIndex` number (optional) - The index of the icon in the resource file. If a
resource file contains multiple icons this value can be used to specify the
zero-based index of the icon that should be displayed for this task. If a
resource file contains only one icon, this property should be set to zero.
* `workingDirectory` String (optional) - The working directory. Default is empty.
* `workingDirectory` string (optional) - The working directory. Default is empty.

Просмотреть файл

@ -1,7 +1,7 @@
# KeyboardEvent Object
* `ctrlKey` Boolean (optional) - whether the Control key was used in an accelerator to trigger the Event
* `metaKey` Boolean (optional) - whether a meta key was used in an accelerator to trigger the Event
* `shiftKey` Boolean (optional) - whether a Shift key was used in an accelerator to trigger the Event
* `altKey` Boolean (optional) - whether an Alt key was used in an accelerator to trigger the Event
* `triggeredByAccelerator` Boolean (optional) - whether an accelerator was used to trigger the event as opposed to another user gesture like mouse click
* `ctrlKey` boolean (optional) - whether the Control key was used in an accelerator to trigger the Event
* `metaKey` boolean (optional) - whether a meta key was used in an accelerator to trigger the Event
* `shiftKey` boolean (optional) - whether a Shift key was used in an accelerator to trigger the Event
* `altKey` boolean (optional) - whether an Alt key was used in an accelerator to trigger the Event
* `triggeredByAccelerator` boolean (optional) - whether an accelerator was used to trigger the event as opposed to another user gesture like mouse click

Просмотреть файл

@ -1,6 +1,6 @@
# KeyboardInputEvent Object extends `InputEvent`
* `type` String - The type of the event, can be `keyDown`, `keyUp` or `char`.
* `keyCode` String - The character that will be sent
* `type` string - The type of the event, can be `keyDown`, `keyUp` or `char`.
* `keyCode` string - The character that will be sent
as the keyboard event. Should only use the valid key codes in
[Accelerator](../accelerator.md).

Просмотреть файл

@ -1,5 +1,5 @@
# MemoryUsageDetails Object
* `count` Number
* `size` Number
* `liveSize` Number
* `count` number
* `size` number
* `liveSize` number

Просмотреть файл

@ -1,5 +1,5 @@
# MimeTypedBuffer Object
* `mimeType` String (optional) - MIME type of the buffer.
* `charset` String (optional) - Charset of the buffer.
* `mimeType` string (optional) - MIME type of the buffer.
* `charset` string (optional) - Charset of the buffer.
* `data` Buffer - The actual Buffer content.

Просмотреть файл

@ -1,10 +1,10 @@
# MouseInputEvent Object extends `InputEvent`
* `type` String - The type of the event, can be `mouseDown`,
* `type` string - The type of the event, can be `mouseDown`,
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
* `x` Integer
* `y` Integer
* `button` String (optional) - The button pressed, can be `left`, `middle`, `right`.
* `button` string (optional) - The button pressed, can be `left`, `middle`, `right`.
* `globalX` Integer (optional)
* `globalY` Integer (optional)
* `movementX` Integer (optional)

Просмотреть файл

@ -1,11 +1,11 @@
# MouseWheelInputEvent Object extends `MouseInputEvent`
* `type` String - The type of the event, can be `mouseWheel`.
* `type` string - The type of the event, can be `mouseWheel`.
* `deltaX` Integer (optional)
* `deltaY` Integer (optional)
* `wheelTicksX` Integer (optional)
* `wheelTicksY` Integer (optional)
* `accelerationRatioX` Integer (optional)
* `accelerationRatioY` Integer (optional)
* `hasPreciseScrollingDeltas` Boolean (optional)
* `canScroll` Boolean (optional)
* `hasPreciseScrollingDeltas` boolean (optional)
* `canScroll` boolean (optional)

Просмотреть файл

@ -1,7 +1,7 @@
# NotificationAction Object
* `type` String - The type of action, can be `button`.
* `text` String (optional) - The label for the given action.
* `type` string - The type of action, can be `button`.
* `text` string (optional) - The label for the given action.
## Platform / Action Support

Просмотреть файл

@ -1,7 +1,7 @@
# NotificationResponse Object
* `actionIdentifier` String - The identifier string of the action that the user selected.
* `date` Number - The delivery date of the notification.
* `identifier` String - The unique identifier for this notification request.
* `userInfo` Record<String, any> - A dictionary of custom information associated with the notification.
* `userText` String (optional) - The text entered or chosen by the user.
* `actionIdentifier` string - The identifier string of the action that the user selected.
* `date` number - The delivery date of the notification.
* `identifier` string - The unique identifier for this notification request.
* `userInfo` Record<string, any> - A dictionary of custom information associated with the notification.
* `userText` string (optional) - The text entered or chosen by the user.

Просмотреть файл

@ -1,7 +1,7 @@
# Point Object
* `x` Number
* `y` Number
* `x` number
* `y` number
**Note:** Both `x` and `y` must be whole integers, when providing a point object
as input to an Electron API we will automatically round your `x` and `y` values

Просмотреть файл

@ -2,10 +2,10 @@
* `data` ([UploadRawData](upload-raw-data.md) | [UploadFile](upload-file.md))[] - The post data to be sent to the
new window.
* `contentType` String - The `content-type` header used for the data. One of
* `contentType` string - The `content-type` header used for the data. One of
`application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to
the `enctype` attribute of the submitted HTML form.
* `boundary` String (optional) - The boundary used to separate multiple parts of
* `boundary` string (optional) - The boundary used to separate multiple parts of
the message. Only valid when `contentType` is `multipart/form-data`.
Note that keys starting with `--` are not currently supported. For example, this will errantly submit as `multipart/form-data` when `nativeWindowOpen` is set to `false` in webPreferences:

Просмотреть файл

@ -1,10 +1,10 @@
# PrinterInfo Object
* `name` String - the name of the printer as understood by the OS.
* `displayName` String - the name of the printer as shown in Print Preview.
* `description` String - a longer description of the printer's type.
* `status` Number - the current status of the printer.
* `isDefault` Boolean - whether or not a given printer is set as the default printer on the OS.
* `name` string - the name of the printer as understood by the OS.
* `displayName` string - the name of the printer as shown in Print Preview.
* `description` string - a longer description of the printer's type.
* `status` number - the current status of the printer.
* `isDefault` boolean - whether or not a given printer is set as the default printer on the OS.
* `options` Object - an object containing a variable number of platform-specific printer information.
The number represented by `status` means different things on different platforms: on Windows its potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).

Просмотреть файл

@ -1,7 +1,7 @@
# ProcessMetric Object
* `pid` Integer - Process id of the process.
* `type` String - Process type. One of the following values:
* `type` string - Process type. One of the following values:
* `Browser`
* `Tab`
* `Utility`
@ -11,17 +11,17 @@
* `Pepper Plugin`
* `Pepper Plugin Broker`
* `Unknown`
* `serviceName` String (optional) - The non-localized name of the process.
* `name` String (optional) - The name of the process.
* `serviceName` string (optional) - The non-localized name of the process.
* `name` string (optional) - The name of the process.
Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.
* `cpu` [CPUUsage](cpu-usage.md) - CPU usage of the process.
* `creationTime` Number - Creation time for this process.
* `creationTime` number - Creation time for this process.
The time is represented as number of milliseconds since epoch.
Since the `pid` can be reused after a process dies,
it is useful to use both the `pid` and the `creationTime` to uniquely identify a process.
* `memory` [MemoryInfo](memory-info.md) - Memory information for the process.
* `sandboxed` Boolean (optional) _macOS_ _Windows_ - Whether the process is sandboxed on OS level.
* `integrityLevel` String (optional) _Windows_ - One of the following values:
* `sandboxed` boolean (optional) _macOS_ _Windows_ - Whether the process is sandboxed on OS level.
* `integrityLevel` string (optional) _Windows_ - One of the following values:
* `untrusted`
* `low`
* `medium`

Просмотреть файл

@ -1,11 +1,11 @@
# Product Object
* `productIdentifier` String - The string that identifies the product to the Apple App Store.
* `localizedDescription` String - A description of the product.
* `localizedTitle` String - The name of the product.
* `contentVersion` String - A string that identifies the version of the content.
* `contentLengths` Number[] - The total size of the content, in bytes.
* `price` Number - The cost of the product in the local currency.
* `formattedPrice` String - The locale formatted price of the product.
* `currencyCode` String - 3 character code presenting a product's currency based on the ISO 4217 standard.
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.
* `productIdentifier` string - The string that identifies the product to the Apple App Store.
* `localizedDescription` string - A description of the product.
* `localizedTitle` string - The name of the product.
* `contentVersion` string - A string that identifies the version of the content.
* `contentLengths` number[] - The total size of the content, in bytes.
* `price` number - The cost of the product in the local currency.
* `formattedPrice` string - The locale formatted price of the product.
* `currencyCode` string - 3 character code presenting a product's currency based on the ISO 4217 standard.
* `isDownloadable` boolean - A boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.

Просмотреть файл

@ -1,7 +1,7 @@
# ProtocolRequest Object
* `url` String
* `referrer` String
* `method` String
* `url` string
* `referrer` string
* `method` string
* `uploadData` [UploadData[]](upload-data.md) (optional)
* `headers` Record<String, String>
* `headers` Record<string, string>

Просмотреть файл

@ -1,4 +1,4 @@
# ProtocolResponseUploadData Object
* `contentType` String - MIME type of the content.
* `data` String | Buffer - Content to be sent.
* `contentType` string - MIME type of the content.
* `data` string | Buffer - Content to be sent.

Просмотреть файл

@ -3,27 +3,27 @@
* `error` Integer (optional) - When assigned, the `request` will fail with the
`error` number . For the available error numbers you can use, please see the
[net error list][net-error].
* `statusCode` Number (optional) - The HTTP response code, default is 200.
* `charset` String (optional) - The charset of response body, default is
* `statusCode` number (optional) - The HTTP response code, default is 200.
* `charset` string (optional) - The charset of response body, default is
`"utf-8"`.
* `mimeType` String (optional) - The MIME type of response body, default is
* `mimeType` string (optional) - The MIME type of response body, default is
`"text/html"`. Setting `mimeType` would implicitly set the `content-type`
header in response, but if `content-type` is already set in `headers`, the
`mimeType` would be ignored.
* `headers` Record<string, string | string[]> (optional) - An object containing the response headers. The
keys must be String, and values must be either String or Array of String.
* `data` (Buffer | String | ReadableStream) (optional) - The response body. When
keys must be string, and values must be either string or Array of string.
* `data` (Buffer | string | ReadableStream) (optional) - The response body. When
returning stream as response, this is a Node.js readable stream representing
the response body. When returning `Buffer` as response, this is a `Buffer`.
When returning `String` as response, this is a `String`. This is ignored for
When returning `string` as response, this is a `string`. This is ignored for
other types of responses.
* `path` String (optional) - Path to the file which would be sent as response
* `path` string (optional) - Path to the file which would be sent as response
body. This is only used for file responses.
* `url` String (optional) - Download the `url` and pipe the result as response
* `url` string (optional) - Download the `url` and pipe the result as response
body. This is only used for URL responses.
* `referrer` String (optional) - The `referrer` URL. This is only used for file
* `referrer` string (optional) - The `referrer` URL. This is only used for file
and URL responses.
* `method` String (optional) - The HTTP `method`. This is only used for file
* `method` string (optional) - The HTTP `method`. This is only used for file
and URL responses.
* `session` Session (optional) - The session used for requesting URL, by default
the HTTP request will reuse the current session. Setting `session` to `null`

Просмотреть файл

@ -1,6 +1,6 @@
# Rectangle Object
* `x` Number - The x coordinate of the origin of the rectangle (must be an integer).
* `y` Number - The y coordinate of the origin of the rectangle (must be an integer).
* `width` Number - The width of the rectangle (must be an integer).
* `height` Number - The height of the rectangle (must be an integer).
* `x` number - The x coordinate of the origin of the rectangle (must be an integer).
* `y` number - The y coordinate of the origin of the rectangle (must be an integer).
* `width` number - The width of the rectangle (must be an integer).
* `height` number - The height of the rectangle (must be an integer).

Просмотреть файл

@ -1,7 +1,7 @@
# Referrer Object
* `url` String - HTTP Referrer URL.
* `policy` String - Can be `default`, `unsafe-url`,
* `url` string - HTTP Referrer URL.
* `policy` string - Can be `default`, `unsafe-url`,
`no-referrer-when-downgrade`, `no-referrer`, `origin`,
`strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
See the [Referrer-Policy spec][1] for more details on the

Просмотреть файл

@ -1,4 +1,4 @@
# ScrubberItem Object
* `label` String (optional) - The text to appear in this item.
* `label` string (optional) - The text to appear in this item.
* `icon` NativeImage (optional) - The image to appear in this item.

Просмотреть файл

@ -1,5 +1,5 @@
# SegmentedControlSegment Object
* `label` String (optional) - The text to appear in this segment.
* `label` string (optional) - The text to appear in this segment.
* `icon` NativeImage (optional) - The image to appear in this segment.
* `enabled` Boolean (optional) - Whether this segment is selectable. Default: true.
* `enabled` boolean (optional) - Whether this segment is selectable. Default: true.

Просмотреть файл

@ -1,10 +1,10 @@
# SerialPort Object
* `portId` String - Unique identifier for the port.
* `portName` String - Name of the port.
* `displayName` String - A string suitable for display to the user for describing this device.
* `vendorId` String - Optional USB vendor ID.
* `productId` String - Optional USB product ID.
* `serialNumber` String - The USB device serial number.
* `usbDriverName` String (optional) - Represents a single serial port on macOS can be enumerated by multiple drivers.
* `deviceInstanceId` String (optional) - A stable identifier on Windows that can be used for device permissions.
* `portId` string - Unique identifier for the port.
* `portName` string - Name of the port.
* `displayName` string - A string suitable for display to the user for describing this device.
* `vendorId` string - Optional USB vendor ID.
* `productId` string - Optional USB product ID.
* `serialNumber` string - The USB device serial number.
* `usbDriverName` string (optional) - Represents a single serial port on macOS can be enumerated by multiple drivers.
* `deviceInstanceId` string (optional) - A stable identifier on Windows that can be used for device permissions.

Просмотреть файл

@ -1,5 +1,5 @@
# ServiceWorkerInfo Object
* `scriptUrl` String - The full URL to the script that this service worker runs
* `scope` String - The base URL that this service worker is active for.
* `renderProcessId` Number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.
* `scriptUrl` string - The full URL to the script that this service worker runs
* `scope` string - The base URL that this service worker is active for.
* `renderProcessId` number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.

Просмотреть файл

@ -1,4 +1,4 @@
# SharedWorkerInfo Object
* `id` String - The unique id of the shared worker.
* `url` String - The url of the shared worker.
* `id` string - The unique id of the shared worker.
* `url` string - The url of the shared worker.

Просмотреть файл

@ -1,5 +1,5 @@
# SharingItem Object
* `texts` String[] (optional) - An array of text to share.
* `filePaths` String[] (optional) - An array of files to share.
* `urls` String[] (optional) - An array of URLs to share.
* `texts` string[] (optional) - An array of text to share.
* `filePaths` string[] (optional) - An array of files to share.
* `urls` string[] (optional) - An array of URLs to share.

Просмотреть файл

@ -1,17 +1,17 @@
# ShortcutDetails Object
* `target` String - The target to launch from this shortcut.
* `cwd` String (optional) - The working directory. Default is empty.
* `args` String (optional) - The arguments to be applied to `target` when
* `target` string - The target to launch from this shortcut.
* `cwd` string (optional) - The working directory. Default is empty.
* `args` string (optional) - The arguments to be applied to `target` when
launching from this shortcut. Default is empty.
* `description` String (optional) - The description of the shortcut. Default
* `description` string (optional) - The description of the shortcut. Default
is empty.
* `icon` String (optional) - The path to the icon, can be a DLL or EXE. `icon`
* `icon` string (optional) - The path to the icon, can be a DLL or EXE. `icon`
and `iconIndex` have to be set together. Default is empty, which uses the
target's icon.
* `iconIndex` Number (optional) - The resource ID of icon when `icon` is a
* `iconIndex` number (optional) - The resource ID of icon when `icon` is a
DLL or EXE. Default is 0.
* `appUserModelId` String (optional) - The Application User Model ID. Default
* `appUserModelId` string (optional) - The Application User Model ID. Default
is empty.
* `toastActivatorClsid` String (optional) - The Application Toast Activator CLSID. Needed
* `toastActivatorClsid` string (optional) - The Application Toast Activator CLSID. Needed
for participating in Action Center.

Просмотреть файл

@ -1,4 +1,4 @@
# Size Object
* `width` Number
* `height` Number
* `width` number
* `height` number

Просмотреть файл

@ -1,15 +1,15 @@
# Task Object
* `program` String - Path of the program to execute, usually you should
* `program` string - Path of the program to execute, usually you should
specify `process.execPath` which opens the current program.
* `arguments` String - The command line arguments when `program` is
* `arguments` string - The command line arguments when `program` is
executed.
* `title` String - The string to be displayed in a JumpList.
* `description` String - Description of this task.
* `iconPath` String - The absolute path to an icon to be displayed in a
* `title` string - The string to be displayed in a JumpList.
* `description` string - Description of this task.
* `iconPath` string - The absolute path to an icon to be displayed in a
JumpList, which can be an arbitrary resource file that contains an icon. You
can usually specify `process.execPath` to show the icon of the program.
* `iconIndex` Number - The icon index in the icon file. If an icon file
* `iconIndex` number - The icon index in the icon file. If an icon file
consists of two or more icons, set this value to identify the icon. If an
icon file consists of one icon, this value is 0.
* `workingDirectory` String (optional) - The working directory. Default is empty.
* `workingDirectory` string (optional) - The working directory. Default is empty.

Просмотреть файл

@ -3,11 +3,11 @@
* `icon` [NativeImage](../native-image.md) - The icon showing in thumbnail
toolbar.
* `click` Function
* `tooltip` String (optional) - The text of the button's tooltip.
* `flags` String[] (optional) - Control specific states and behaviors of the
* `tooltip` string (optional) - The text of the button's tooltip.
* `flags` string[] (optional) - Control specific states and behaviors of the
button. By default, it is `['enabled']`.
The `flags` is an array that can include following `String`s:
The `flags` is an array that can include following `string`s:
* `enabled` - The button is active and available to the user.
* `disabled` - The button is disabled. It is present, but has a visual state

Просмотреть файл

@ -1,11 +1,11 @@
# TraceCategoriesAndOptions Object
* `categoryFilter` String - A filter to control what category groups
* `categoryFilter` string - A filter to control what category groups
should be traced. A filter can have an optional '-' prefix to exclude
category groups that contain a matching category. Having both included
and excluded category patterns in the same list is not supported. Examples:
`test_MyTest*`, `test_MyTest*,test_OtherStuff`, `-excluded_category1,-excluded_category2`.
* `traceOptions` String - Controls what kind of tracing is enabled,
* `traceOptions` string - Controls what kind of tracing is enabled,
it is a comma-delimited sequence of the following strings:
`record-until-full`, `record-continuously`, `trace-to-console`, `enable-sampling`, `enable-systrace`,
e.g. `'record-until-full,enable-sampling'`.

Просмотреть файл

@ -1,6 +1,6 @@
# TraceConfig Object
* `recording_mode` String (optional) - Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible` or `trace-to-console`. Defaults to `record-until-full`.
* `recording_mode` string (optional) - Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible` or `trace-to-console`. Defaults to `record-until-full`.
* `trace_buffer_size_in_kb` number (optional) - maximum size of the trace
recording buffer in kilobytes. Defaults to 100MB.
* `trace_buffer_size_in_events` number (optional) - maximum size of the trace
@ -9,17 +9,17 @@
according to a specific list of events that have been manually vetted to not
include any PII. See [the implementation in
Chromium][trace_event_args_whitelist.cc] for specifics.
* `included_categories` String[] (optional) - a list of tracing categories to
* `included_categories` string[] (optional) - a list of tracing categories to
include. Can include glob-like patterns using `*` at the end of the category
name. See [tracing categories][] for the list of categories.
* `excluded_categories` String[] (optional) - a list of tracing categories to
* `excluded_categories` string[] (optional) - a list of tracing categories to
exclude. Can include glob-like patterns using `*` at the end of the category
name. See [tracing categories][] for the list of categories.
* `included_process_ids` number[] (optional) - a list of process IDs to
include in the trace. If not specified, trace all processes.
* `histogram_names` String[] (optional) - a list of [histogram][] names to report
* `histogram_names` string[] (optional) - a list of [histogram][] names to report
with the trace.
* `memory_dump_config` Record<String, any> (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.

Просмотреть файл

@ -1,11 +1,11 @@
# Transaction Object
* `transactionIdentifier` String - A string that uniquely identifies a successful payment transaction.
* `transactionDate` String - The date the transaction was added to the App Stores payment queue.
* `originalTransactionIdentifier` String - The identifier of the restored transaction by the App Store.
* `transactionState` String - The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or `deferred`.
* `transactionIdentifier` string - A string that uniquely identifies a successful payment transaction.
* `transactionDate` string - The date the transaction was added to the App Stores payment queue.
* `originalTransactionIdentifier` string - The identifier of the restored transaction by the App Store.
* `transactionState` string - The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or `deferred`.
* `errorCode` Integer - The error code if an error occurred while processing the transaction.
* `errorMessage` String - The error message if an error occurred while processing the transaction.
* `errorMessage` string - The error message if an error occurred while processing the transaction.
* `payment` Object
* `productIdentifier` String - The identifier of the purchased product.
* `productIdentifier` string - The identifier of the purchased product.
* `quantity` Integer - The quantity purchased.

Просмотреть файл

@ -1,6 +1,6 @@
# UploadData Object
* `bytes` Buffer - Content being sent.
* `file` String (optional) - Path of file being uploaded.
* `blobUUID` String (optional) - UUID of blob data. Use [ses.getBlobData](../session.md#sesgetblobdataidentifier) method
* `file` string (optional) - Path of file being uploaded.
* `blobUUID` string (optional) - UUID of blob data. Use [ses.getBlobData](../session.md#sesgetblobdataidentifier) method
to retrieve the data.

Просмотреть файл

@ -1,7 +1,7 @@
# UploadFile Object
* `type` 'file' - `file`.
* `filePath` String - Path of file to be uploaded.
* `filePath` string - Path of file to be uploaded.
* `offset` Integer - Defaults to `0`.
* `length` Integer - Number of bytes to read from `offset`.
Defaults to `0`.

Просмотреть файл

@ -1,11 +1,11 @@
# UserDefaultTypes Object
* `string` String
* `boolean` Boolean
* `integer` Number
* `float` Number
* `double` Number
* `url` String
* `string` string
* `boolean` boolean
* `integer` number
* `float` number
* `double` number
* `url` string
* `array` Array\<unknown>
* `dictionary` Record\<string, unknown>

Просмотреть файл

@ -1,3 +1,3 @@
# WebRequestFilter Object
* `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.
* `urls` string[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.

Просмотреть файл

@ -1,5 +1,5 @@
# WebSource Object
* `code` String
* `url` String (optional)
* `code` string
* `url` string (optional)
* `startLine` Integer (optional) - Default is 1.

Просмотреть файл

@ -18,7 +18,7 @@ The `systemPreferences` object emits the following events:
Returns:
* `event` Event
* `newColor` String - The new RGBA color the user assigned to be their system
* `newColor` string - The new RGBA color the user assigned to be their system
accent color.
### Event: 'color-changed' _Windows_
@ -32,7 +32,7 @@ Returns:
Returns:
* `event` Event
* `invertedColorScheme` Boolean - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is being used, `false` otherwise.
* `invertedColorScheme` boolean - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is being used, `false` otherwise.
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
@ -41,7 +41,7 @@ Returns:
Returns:
* `event` Event
* `highContrastColorScheme` Boolean - `true` if a high contrast theme is being used, `false` otherwise.
* `highContrastColorScheme` boolean - `true` if a high contrast theme is being used, `false` otherwise.
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
@ -49,48 +49,48 @@ Returns:
### `systemPreferences.isDarkMode()` _macOS_ _Windows_ _Deprecated_
Returns `Boolean` - Whether the system is in Dark Mode.
Returns `boolean` - Whether the system is in Dark Mode.
**Deprecated:** Should use the new [`nativeTheme.shouldUseDarkColors`](native-theme.md#nativethemeshouldusedarkcolors-readonly) API.
### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_
Returns `Boolean` - Whether the Swipe between pages setting is on.
Returns `boolean` - Whether the Swipe between pages setting is on.
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_
* `event` String
* `userInfo` Record<String, any>
* `deliverImmediately` Boolean (optional) - `true` to post notifications immediately even when the subscribing app is inactive.
* `event` string
* `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
that contains the user information dictionary sent along with the notification.
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_
* `event` String
* `userInfo` Record<String, any>
* `event` string
* `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` Record<String, any>
* `event` string
* `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.subscribeNotification(event, callback)` _macOS_
* `event` String
* `event` string
* `callback` Function
* `event` String
* `userInfo` Record<String, unknown>
* `object` String
* `event` string
* `userInfo` Record<string, unknown>
* `object` string
Returns `Number` - The ID of this subscription
Returns `number` - The ID of this subscription
Subscribes to native notifications of macOS, `callback` will be called with
`callback(event, userInfo)` when the corresponding `event` happens. The
@ -111,26 +111,26 @@ example values of `event` are:
### `systemPreferences.subscribeLocalNotification(event, callback)` _macOS_
* `event` String
* `event` string
* `callback` Function
* `event` String
* `userInfo` Record<String, unknown>
* `object` String
* `event` string
* `userInfo` Record<string, unknown>
* `object` string
Returns `Number` - The ID of this subscription
Returns `number` - The ID of this subscription
Same as `subscribeNotification`, but uses `NSNotificationCenter` for local defaults.
This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
### `systemPreferences.subscribeWorkspaceNotification(event, callback)` _macOS_
* `event` String
* `event` string
* `callback` Function
* `event` String
* `userInfo` Record<String, unknown>
* `object` String
* `event` string
* `userInfo` Record<string, unknown>
* `object` string
Returns `Number` - The ID of this subscription
Returns `number` - The ID of this subscription
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
This is necessary for events such as `NSWorkspaceDidActivateApplicationNotification`.
@ -155,13 +155,13 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.
### `systemPreferences.registerDefaults(defaults)` _macOS_
* `defaults` Record<String, String | Boolean | Number> - 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`.
### `systemPreferences.getUserDefault<Type extends keyof UserDefaultTypes>(key, type)` _macOS_
* `key` String
* `key` string
* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`,
`url`, `array` or `dictionary`.
@ -179,9 +179,9 @@ Some popular `key` and `type`s are:
### `systemPreferences.setUserDefault(key, type, value)` _macOS_
* `key` String
* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`.
* `value` String
* `key` string
* `type` string - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`.
* `value` string
Set the value of `key` in `NSUserDefaults`.
@ -194,14 +194,14 @@ Some popular `key` and `type`s are:
### `systemPreferences.removeUserDefault(key)` _macOS_
* `key` String
* `key` string
Removes the `key` in `NSUserDefaults`. This can be used to restore the default
or global value of a `key` previously set with `setUserDefault`.
### `systemPreferences.isAeroGlassEnabled()` _Windows_
Returns `Boolean` - `true` if [DWM composition][dwm-composition] (Aero Glass) is
Returns `boolean` - `true` if [DWM composition][dwm-composition] (Aero Glass) is
enabled, and `false` otherwise.
An example of using it to determine if you should create a transparent window or
@ -233,7 +233,7 @@ if (browserOptions.transparent) {
### `systemPreferences.getAccentColor()` _Windows_ _macOS_
Returns `String` - The users current system wide accent color preference in RGBA
Returns `string` - The users current system wide accent color preference in RGBA
hexadecimal form.
```js
@ -248,7 +248,7 @@ This API is only available on macOS 10.14 Mojave or newer.
### `systemPreferences.getColor(color)` _Windows_ _macOS_
* `color` String - One of the following values:
* `color` string - One of the following values:
* On **Windows**:
* `3d-dark-shadow` - Dark shadow for three-dimensional display elements.
* `3d-face` - Face color for three-dimensional display elements and for dialog
@ -325,7 +325,7 @@ This API is only available on macOS 10.14 Mojave or newer.
* `window-background` - The background of a window.
* `window-frame-text` - The text in the window's titlebar area.
Returns `String` - The system color setting in RGB hexadecimal form (`#ABCDEF`).
Returns `string` - The system color setting in RGB hexadecimal form (`#ABCDEF`).
See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for more details.
The following colors are only available on macOS 10.14: `find-highlight`, `selected-content-background`, `separator`, `unemphasized-selected-content-background`, `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
@ -335,7 +335,7 @@ The following colors are only available on macOS 10.14: `find-highlight`, `selec
### `systemPreferences.getSystemColor(color)` _macOS_
* `color` String - One of the following values:
* `color` string - One of the following values:
* `blue`
* `brown`
* `gray`
@ -346,32 +346,32 @@ The following colors are only available on macOS 10.14: `find-highlight`, `selec
* `red`
* `yellow`
Returns `String` - The standard system color formatted as `#RRGGBBAA`.
Returns `string` - The standard system color formatted as `#RRGGBBAA`.
Returns one of several standard system colors that automatically adapt to vibrancy and changes in accessibility settings like 'Increase contrast' and 'Reduce transparency'. See [Apple Documentation](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#system-colors) for more details.
### `systemPreferences.isInvertedColorScheme()` _Windows_ _Deprecated_
Returns `Boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise.
Returns `boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise.
**Deprecated:** Should use the new [`nativeTheme.shouldUseInvertedColorScheme`](native-theme.md#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly) API.
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_ _Deprecated_
Returns `Boolean` - `true` if a high contrast theme is active, `false` otherwise.
Returns `boolean` - `true` if a high contrast theme is active, `false` otherwise.
**Deprecated:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
### `systemPreferences.getEffectiveAppearance()` _macOS_
Returns `String` - Can be `dark`, `light` or `unknown`.
Returns `string` - Can be `dark`, `light` or `unknown`.
Gets the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
Returns `String` | `null` - Can be `dark`, `light` or `unknown`.
Returns `string` | `null` - Can be `dark`, `light` or `unknown`.
Gets the macOS appearance setting that you have declared you want for
your application, maps to [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc).
@ -379,20 +379,20 @@ You can use the `setAppLevelAppearance` API to set this value.
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_ _Deprecated_
* `appearance` String | null - Can be `dark` or `light`
* `appearance` string | null - Can be `dark` or `light`
Sets the appearance setting for your application, this should override the
system default and override the value of `getEffectiveAppearance`.
### `systemPreferences.canPromptTouchID()` _macOS_
Returns `Boolean` - whether or not this device has the ability to use Touch ID.
Returns `boolean` - whether or not this device has the ability to use Touch ID.
**NOTE:** This API will return `false` on macOS systems older than Sierra 10.12.2.
### `systemPreferences.promptTouchID(reason)` _macOS_
* `reason` String - The reason you are asking for Touch ID authentication
* `reason` string - The reason you are asking for Touch ID authentication
Returns `Promise<void>` - resolves if the user has successfully authenticated with Touch ID.
@ -412,15 +412,15 @@ This API itself will not protect your user data; rather, it is a mechanism to al
### `systemPreferences.isTrustedAccessibilityClient(prompt)` _macOS_
* `prompt` Boolean - whether or not the user will be informed via prompt if the current process is untrusted.
* `prompt` boolean - whether or not the user will be informed via prompt if the current process is untrusted.
Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
Returns `boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
### `systemPreferences.getMediaAccessStatus(mediaType)` _Windows_ _macOS_
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
* `mediaType` string - Can be `microphone`, `camera` or `screen`.
Returns `String` - Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
Returns `string` - Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
This user consent was not required on macOS 10.13 High Sierra or lower so this method will always return `granted`.
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
@ -431,9 +431,9 @@ It will always return `granted` for `screen` and for all media types on older ve
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_
* `mediaType` String - the type of media being requested; can be `microphone`, `camera`.
* `mediaType` string - the type of media being requested; can be `microphone`, `camera`.
Returns `Promise<Boolean>` - A promise that resolves with `true` if consent was granted and `false` if it was denied. If an invalid `mediaType` is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it _must_ be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status.
Returns `Promise<boolean>` - A promise that resolves with `true` if consent was granted and `false` if it was denied. If an invalid `mediaType` is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it _must_ be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status.
**Important:** In order to properly leverage this API, you [must set](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc) the `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your app's `Info.plist` file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See [Electron Application Distribution](../tutorial/application-distribution.md#macos) for more information about how to set these in the context of Electron.
@ -443,9 +443,9 @@ This user consent was not required until macOS 10.14 Mojave, so this method will
Returns `Object`:
* `shouldRenderRichAnimation` Boolean - Returns true if rich animations should be rendered. Looks at session type (e.g. remote desktop) and accessibility settings to give guidance for heavy animations.
* `scrollAnimationsEnabledBySystem` Boolean - Determines on a per-platform basis whether scroll animations (e.g. produced by home/end key) should be enabled.
* `prefersReducedMotion` Boolean - Determines whether the user desires reduced motion based on platform APIs.
* `shouldRenderRichAnimation` boolean - Returns true if rich animations should be rendered. Looks at session type (e.g. remote desktop) and accessibility settings to give guidance for heavy animations.
* `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis whether scroll animations (e.g. produced by home/end key) should be enabled.
* `prefersReducedMotion` boolean - Determines whether the user desires reduced motion based on platform APIs.
Returns an object with system animation settings.
@ -453,7 +453,7 @@ Returns an object with system animation settings.
### `systemPreferences.appLevelAppearance` _macOS_
A `String` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for
A `string` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for
your application. This maps to values in: [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc). Setting this will override the
system default as well as the value of `getEffectiveAppearance`.
@ -463,7 +463,7 @@ This property is only available on macOS 10.14 Mojave or newer.
### `systemPreferences.effectiveAppearance` _macOS_ _Readonly_
A `String` property that can be `dark`, `light` or `unknown`.
A `string` property that can be `dark`, `light` or `unknown`.
Returns the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)

Просмотреть файл

@ -8,14 +8,14 @@ _This class is not exported from the `'electron'` module. It is only available a
### `new TouchBarButton(options)`
* `options` Object
* `label` String (optional) - Button text.
* `accessibilityLabel` String (optional) - A short description of the button for use by screenreaders like VoiceOver.
* `backgroundColor` String (optional) - Button background color in hex format,
* `label` string (optional) - Button text.
* `accessibilityLabel` string (optional) - A short description of the button for use by screenreaders like VoiceOver.
* `backgroundColor` string (optional) - Button background color in hex format,
i.e `#ABCDEF`.
* `icon` [NativeImage](native-image.md) | String (optional) - Button icon.
* `iconPosition` String (optional) - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
* `icon` [NativeImage](native-image.md) | string (optional) - Button icon.
* `iconPosition` string (optional) - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
* `click` Function (optional) - Function to call when the button is clicked.
* `enabled` Boolean (optional) - Whether the button is in an enabled state. Default is `true`.
* `enabled` boolean (optional) - Whether the button is in an enabled state. Default is `true`.
When defining `accessibilityLabel`, ensure you have considered macOS [best practices](https://developer.apple.com/documentation/appkit/nsaccessibilitybutton/1524910-accessibilitylabel?language=objc).
@ -25,16 +25,16 @@ The following properties are available on instances of `TouchBarButton`:
#### `touchBarButton.accessibilityLabel`
A `String` representing the description of the button to be read by a screen reader. Will only be read by screen readers if no label is set.
A `string` representing the description of the button to be read by a screen reader. Will only be read by screen readers if no label is set.
#### `touchBarButton.label`
A `String` representing the button's current text. Changing this value immediately updates the button
A `string` representing the button's current text. Changing this value immediately updates the button
in the touch bar.
#### `touchBarButton.backgroundColor`
A `String` hex code representing the button's current background color. Changing this value immediately updates
A `string` hex code representing the button's current background color. Changing this value immediately updates
the button in the touch bar.
#### `touchBarButton.icon`
@ -44,8 +44,8 @@ in the touch bar.
#### `touchBarButton.iconPosition`
A `String` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
A `string` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
#### `touchBarButton.enabled`
A `Boolean` representing whether the button is in an enabled state.
A `boolean` representing whether the button is in an enabled state.

Просмотреть файл

@ -8,12 +8,12 @@ _This class is not exported from the `'electron'` module. It is only available a
### `new TouchBarColorPicker(options)`
* `options` Object
* `availableColors` String[] (optional) - Array of hex color strings to
* `availableColors` string[] (optional) - Array of hex color strings to
appear as possible colors to select.
* `selectedColor` String (optional) - The selected hex color in the picker,
* `selectedColor` string (optional) - The selected hex color in the picker,
i.e `#ABCDEF`.
* `change` Function (optional) - Function to call when a color is selected.
* `color` String - The color that the user selected from the picker.
* `color` string - The color that the user selected from the picker.
### Instance Properties
@ -21,10 +21,10 @@ The following properties are available on instances of `TouchBarColorPicker`:
#### `touchBarColorPicker.availableColors`
A `String[]` array representing the color picker's available colors to select. Changing this value immediately
A `string[]` array representing the color picker's available colors to select. Changing this value immediately
updates the color picker in the touch bar.
#### `touchBarColorPicker.selectedColor`
A `String` hex code representing the color picker's currently selected color. Changing this value immediately
A `string` hex code representing the color picker's currently selected color. Changing this value immediately
updates the color picker in the touch bar.

Просмотреть файл

@ -8,9 +8,9 @@ _This class is not exported from the `'electron'` module. It is only available a
### `new TouchBarLabel(options)`
* `options` Object
* `label` String (optional) - Text to display.
* `accessibilityLabel` String (optional) - A short description of the button for use by screenreaders like VoiceOver.
* `textColor` String (optional) - Hex color of text, i.e `#ABCDEF`.
* `label` string (optional) - Text to display.
* `accessibilityLabel` string (optional) - A short description of the button for use by screenreaders like VoiceOver.
* `textColor` string (optional) - Hex color of text, i.e `#ABCDEF`.
When defining `accessibilityLabel`, ensure you have considered macOS [best practices](https://developer.apple.com/documentation/appkit/nsaccessibilitybutton/1524910-accessibilitylabel?language=objc).
@ -20,14 +20,14 @@ The following properties are available on instances of `TouchBarLabel`:
#### `touchBarLabel.label`
A `String` representing the label's current text. Changing this value immediately updates the label in
A `string` representing the label's current text. Changing this value immediately updates the label in
the touch bar.
#### `touchBarLabel.accessibilityLabel`
A `String` representing the description of the label to be read by a screen reader.
A `string` representing the description of the label to be read by a screen reader.
#### `touchBarLabel.textColor`
A `String` hex code representing the label's current text color. Changing this value immediately updates the
A `string` hex code representing the label's current text color. Changing this value immediately updates the
label in the touch bar.

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше