Skip to content

Commit

Permalink
Upgrade to electron v29.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Feb 21, 2024
1 parent 6c72663 commit caa0a34
Show file tree
Hide file tree
Showing 15 changed files with 565 additions and 459 deletions.
52 changes: 35 additions & 17 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"start": "electron ."
},
"devDependencies": {
"electron": "v28.2.0"
"electron": "v29.0.0"
}
}
820 changes: 436 additions & 384 deletions electron-api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"description": "Type definitions for the electron framework",
"releasenote": "See CHANGELOG",
"version": "28.2.0",
"version": "29.0.0",
"contributors": [
"tong",
"fponticelli"
Expand Down
2 changes: 1 addition & 1 deletion src/electron/CrashReporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ package electron;
**Note:** This method is only available in the main process.
**/
static function getLastCrashReport():electron.CrashReport;
static function getLastCrashReport():haxe.extern.EitherType<electron.CrashReport, Dynamic>;
/**
Returns all uploaded crash reports. Each report contains the date and uploaded ID.
Expand Down
2 changes: 2 additions & 0 deletions src/electron/File.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package electron;
typedef File = Dynamic;
2 changes: 0 additions & 2 deletions src/electron/SaveDialogOptions.hx

This file was deleted.

2 changes: 1 addition & 1 deletion src/electron/UserDefaultTypes.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package electron;
/**
This type is a helper alias, no object will never exist of this type.
This type is a helper alias, no object will ever exist of this type.
@see https://electronjs.org/docs/api/structures/user-default-types
**/
typedef UserDefaultTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/electron/UtilityProcess.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package electron;
**/
@:optional
var cwd : String; /**
Allows configuring the mode for `stdout` and `stderr` of the child process. Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`, for more details on these values you can refer to stdio documentation from Node.js. Currently this option only supports configuring `stdout` and `stderr` to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported; `stdin` will always be ignored. For example, the supported values will be processed as following:
Allows configuring the mode for `stdout` and `stderr` of the child process. Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`, for more details on these values you can refer to stdio documentation from Node.js. Currently this option only supports configuring `stdout` and `stderr` to either `pipe`, `inherit` or `ignore`. Configuring `stdin` to any property other than `ignore` is not supported and will result in an error. For example, the supported values will be processed as following:
**/
@:optional
var stdio : haxe.extern.EitherType<Array<String>, String>; /**
Expand Down
45 changes: 27 additions & 18 deletions src/electron/main/App.hx
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,11 @@ package electron.main;
* `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.
* `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login automatically. This setting is not available on MAS builds.
* `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.
* `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.
* `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open as hidden at login. This does not work on macOS 13 and up.
* `wasOpenedAtLogin` boolean _macOS_ _Deprecated_ - `true` if the app was opened at login automatically. This setting is not available on MAS builds or on macOS 13 and up.
* `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `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 or on macOS 13 and up.
* `restoreState` boolean _macOS_ _Deprecated_ - `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 or on macOS 13 and up.
* `status` string _macOS_ - can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
* `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.
Expand All @@ -468,6 +469,14 @@ package electron.main;
* `enabled` boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.
**/
static function getLoginItemSettings(?options:{ /**
Can be one of `mainAppService`, `agentService`, `daemonService`, or `loginItemService`. Defaults to `mainAppService`. Only available on macOS 13 and up. See app.setLoginItemSettings for more information about each type.
**/
@:optional
var type : String; /**
The name of the service. Required if `type` is non-default. Only available on macOS 13 and up.
**/
@:optional
var serviceName : String; /**
The executable path to compare against. Defaults to `process.execPath`.
**/
@:optional
Expand All @@ -477,17 +486,29 @@ package electron.main;
@:optional
var args : Array<String>; }):Any;
/**
Set the app's login item settings.
To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll want to set the launch path to Update.exe, and pass arguments that specify your application name. For example:
For more information about setting different services as login items on macOS 13 and up, see `SMAppService`.
**/
static function setLoginItemSettings(settings:{ /**
`true` to open the app at login, `false` to remove the app as a login item. Defaults to `false`.
**/
@:optional
var openAtLogin : Bool; /**
`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.
`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 build s or on macOS 13 and up.
**/
@:optional
var openAsHidden : Bool; /**
The type of service to add as a login item. Defaults to `mainAppService`. Only available on macOS 13 and up.
**/
@:optional
var type : String; /**
The name of the service. Required if `type` is non-default. Only available on macOS 13 and up.
**/
@:optional
var serviceName : String; /**
The executable to launch at login. Defaults to `process.execPath`.
**/
@:optional
Expand All @@ -500,7 +521,7 @@ package electron.main;
**/
@:optional
var enabled : Bool; /**
value name to write into registry. Defaults to the app's AppUserModelId(). Set the app's login item settings.
value name to write into registry. Defaults to the app's AppUserModelId().
**/
@:optional
var name : String; }):Void;
Expand Down Expand Up @@ -747,18 +768,6 @@ package electron.main;
Emitted whenever there is a GPU info update.
**/
var gpu_info_update : electron.main.AppEvent<Void -> Void> = "gpu-info-update";
/**
Emitted when the GPU process crashes or is killed.
**Deprecated:** This event is superceded by the `child-process-gone` event which contains more information about why the child process disappeared. It isn't always because it crashed. The `killed` boolean can be replaced by checking `reason === 'killed'` when you switch to that event.
**/
var gpu_process_crashed : electron.main.AppEvent<Void -> Void> = "gpu-process-crashed";
/**
Emitted when the renderer process of `webContents` crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event which contains more information about why the render process disappeared. It isn't always because it crashed. The `killed` boolean can be replaced by checking `reason === 'killed'` when you switch to that event.
**/
var renderer_process_crashed : electron.main.AppEvent<Void -> Void> = "renderer-process-crashed";
/**
Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed.
**/
Expand Down
12 changes: 5 additions & 7 deletions src/electron/main/WebContents.hx
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,11 @@ var to : Float; }>; /**
Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.
**/
@:optional
var generateTaggedPDF : Bool; }):js.lib.Promise<Any>;
var generateTaggedPDF : Bool; /**
Whether or not to generate a PDF document outline from content headers. Defaults to false.
**/
@:optional
var generateDocumentOutline : Bool; }):js.lib.Promise<Any>;
/**
Adds the specified path to DevTools workspace. Must be used after DevTools creation:
**/
Expand Down Expand Up @@ -1021,12 +1025,6 @@ var to : Float; }>; /**
**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the specification.
**/
var will_prevent_unload : electron.main.WebContentsEvent<Void -> Void> = "will-prevent-unload";
/**
Emitted when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event which contains more information about why the render process disappeared. It isn't always because it crashed. The `killed` boolean can be replaced by checking `reason === 'killed'` when you switch to that event.
**/
var crashed : electron.main.WebContentsEvent<Void -> Void> = "crashed";
/**
Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed.
**/
Expand Down
Loading

0 comments on commit caa0a34

Please sign in to comment.