Skip to content

Commit

Permalink
Upgrade to electron v27.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Oct 10, 2023
1 parent 6bb08da commit bb79e59
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 601 deletions.
14 changes: 7 additions & 7 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": "v26.3.0"
"electron": "v27.0.0"
}
}
879 changes: 379 additions & 500 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": "26.3.0",
"version": "27.0.0",
"contributors": [
"tong",
"fponticelli"
Expand Down
2 changes: 1 addition & 1 deletion src/electron/BrowserWindowConstructorOptions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ typedef BrowserWindowConstructorOptions = {
@:optional
var thickFrame : Bool;
/**
Add a type of vibrancy effect to the window, only on macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
Add a type of vibrancy effect to the window, only on macOS. Can be `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`.
**/
@:optional
var vibrancy : String;
Expand Down
8 changes: 0 additions & 8 deletions src/electron/Product.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ typedef Product = {
The name of the product.
**/
var localizedTitle : String;
/**
A string that identifies the version of the content.
**/
var contentVersion : String;
/**
The total size of the content, in bytes.
**/
var contentLengths : Array<Float>;
/**
The cost of the product in the local currency.
**/
Expand Down
6 changes: 5 additions & 1 deletion src/electron/WebPreferences.hx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ typedef WebPreferences = {
Defaults to `Impact`.
**/
@:optional
var fantasy : String; };
var fantasy : String; /**
Defaults to `Latin Modern Math`.
**/
@:optional
var math : String; };
/**
Defaults to `16`.
**/
Expand Down
4 changes: 3 additions & 1 deletion src/electron/main/App.hx
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ package electron.main;
On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the Unity integration documentation.
**Note:** On macOS, you need to ensure that your application has the permission to display notifications for this method to work.
**/
static function setBadgeCount(?count:Int):Bool;
/**
Expand Down Expand Up @@ -674,7 +676,7 @@ package electron.main;
/**
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 set `NSPrincipalClass` to `AtomApplication`.
As with the `open-file` event, be sure to register a listener for the `open-url` event early in your application startup to detect if the the application being is being opened to handle a URL. If you register the listener in response to a `ready` event, you'll miss URLs that trigger the launch of your application.
As with the `open-file` event, be sure to register a listener for the `open-url` event early in your application startup to detect if the application is being opened to handle a URL. If you register the listener in response to a `ready` event, you'll miss URLs that trigger the launch of your application.
**/
var open_url : electron.main.AppEvent<Void -> Void> = "open-url";
/**
Expand Down
13 changes: 10 additions & 3 deletions src/electron/main/BrowserWindow.hx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ package electron.main;
A `Integer` property representing the unique ID of the window. Each ID is unique among all `BrowserWindow` instances of the entire Electron application.
**/
var id : Int;
/**
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
**/
@:optional
var tabbingIdentifier : String;
/**
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
Expand Down Expand Up @@ -903,6 +908,10 @@ package electron.main;
Selects the next tab when native tabs are enabled and there are other tabs in the window.
**/
function selectNextTab():Void;
/**
Shows or hides the tab overview when native tabs are enabled.
**/
function showAllTabs():Void;
/**
Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.
**/
Expand All @@ -921,8 +930,6 @@ package electron.main;
function addTabbedWindow(browserWindow:electron.main.BrowserWindow):Void;
/**
Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window.
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS.
**/
function setVibrancy(type:haxe.extern.EitherType<String, Dynamic>):Void;
/**
Expand Down Expand Up @@ -974,7 +981,7 @@ package electron.main;
**/
function setTopBrowserView(browserView:electron.main.BrowserView):Void;
/**
an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`.
a sorted by z-index array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases.
**/
Expand Down
4 changes: 2 additions & 2 deletions src/electron/main/MenuItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package electron.main;
**/
var type : String;
/**
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`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
**/
@:optional
var role : String;
Expand Down Expand Up @@ -105,7 +105,7 @@ package electron.main;
**/
@:optional
var click : haxe.Constraints.Function; /**
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`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `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.
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`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See roles.
**/
@:optional
var role : String; /**
Expand Down
26 changes: 2 additions & 24 deletions src/electron/main/SystemPreferences.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ package electron.main;
**/
@:jsRequire("electron", "systemPreferences") extern class SystemPreferences extends js.node.events.EventEmitter<electron.main.SystemPreferences> {
/**
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. Setting this will override the system default as well as the value of `getEffectiveAppearance`.
Possible values that can be set are `dark` and `light`, and possible return values are `dark`, `light`, and `unknown`.
This property is only available on macOS 10.14 Mojave or newer.
A `boolean` property which determines whether the app avoids using semitransparent backgrounds. This maps to NSWorkspace.accessibilityDisplayShouldReduceTransparency
**/
static var appLevelAppearance : String;
static var accessibilityDisplayShouldReduceTransparency : Bool;
/**
A `string` property that can be `dark`, `light` or `unknown`.
Expand Down Expand Up @@ -143,16 +139,6 @@ package electron.main;
Gets the macOS appearance setting that is currently applied to your application, maps to NSApplication.effectiveAppearance
**/
static function getEffectiveAppearance():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. You can use the `setAppLevelAppearance` API to set this value.
**/
static function getAppLevelAppearance():String;
/**
Sets the appearance setting for your application, this should override the system default and override the value of `getEffectiveAppearance`.
**/
static function setAppLevelAppearance(appearance:haxe.extern.EitherType<String, Dynamic>):Void;
/**
whether or not this device has the ability to use Touch ID.
**/
Expand Down Expand Up @@ -195,12 +181,4 @@ package electron.main;
@:enum abstract SystemPreferencesEvent<T:(haxe.Constraints.Function)>(js.node.events.EventEmitter.Event<T>) from js.node.events.EventEmitter.Event<T> {
var accent_color_changed : electron.main.SystemPreferencesEvent<Void -> Void> = "accent-color-changed";
var color_changed : electron.main.SystemPreferencesEvent<Void -> Void> = "color-changed";
/**
**Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
**/
var inverted_color_scheme_changed : electron.main.SystemPreferencesEvent<Void -> Void> = "inverted-color-scheme-changed";
/**
**Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
**/
var high_contrast_color_scheme_changed : electron.main.SystemPreferencesEvent<Void -> Void> = "high-contrast-color-scheme-changed";
}
23 changes: 14 additions & 9 deletions src/electron/main/WebContents.hx
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,6 @@ package electron.main;
/**
Get the system printer list.
**Deprecated:** Should use the new `contents.getPrintersAsync` API.
**/
function getPrinters():Array<electron.PrinterInfo>;
/**
Get the system printer list.
Resolves with a `PrinterInfo[]`
**/
function getPrintersAsync():js.lib.Promise<Any>;
Expand Down Expand Up @@ -620,7 +613,7 @@ var to : Float; }>; /**
**/
@:optional
var right : Float; }; /**
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
**/
@:optional
var pageRanges : String; /**
Expand Down Expand Up @@ -672,7 +665,11 @@ var to : Float; }>; /**
Whether to bring the opened devtools window to the foreground. The default is `true`.
**/
@:optional
var activate : Bool; }):Void;
var activate : Bool; /**
A title for the DevTools window (only in `undocked` or `detach` mode).
**/
@:optional
var title : String; }):Void;
/**
Closes the devtools.
**/
Expand All @@ -685,6 +682,14 @@ var to : Float; }>; /**
Whether the devtools view is focused .
**/
function isDevToolsFocused():Bool;
/**
the current title of the DevTools window. This will only be visible if DevTools is opened in `undocked` or `detach` mode.
**/
function getDevToolsTitle():String;
/**
Changes the title of the DevTools window to `title`. This will only be visible if DevTools is opened in `undocked` or `detach` mode.
**/
function setDevToolsTitle(title:String):Void;
/**
Toggles the developer tools.
**/
Expand Down
4 changes: 3 additions & 1 deletion src/electron/remote/App.hx
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ package electron.remote;
On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the Unity integration documentation.
**Note:** On macOS, you need to ensure that your application has the permission to display notifications for this method to work.
**/
static function setBadgeCount(?count:Int):Bool;
/**
Expand Down Expand Up @@ -674,7 +676,7 @@ package electron.remote;
/**
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 set `NSPrincipalClass` to `AtomApplication`.
As with the `open-file` event, be sure to register a listener for the `open-url` event early in your application startup to detect if the the application being is being opened to handle a URL. If you register the listener in response to a `ready` event, you'll miss URLs that trigger the launch of your application.
As with the `open-file` event, be sure to register a listener for the `open-url` event early in your application startup to detect if the application is being opened to handle a URL. If you register the listener in response to a `ready` event, you'll miss URLs that trigger the launch of your application.
**/
var open_url : electron.remote.AppEvent<Void -> Void> = "open-url";
/**
Expand Down
13 changes: 10 additions & 3 deletions src/electron/remote/BrowserWindow.hx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ package electron.remote;
A `Integer` property representing the unique ID of the window. Each ID is unique among all `BrowserWindow` instances of the entire Electron application.
**/
var id : Int;
/**
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
**/
@:optional
var tabbingIdentifier : String;
/**
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
Expand Down Expand Up @@ -903,6 +908,10 @@ package electron.remote;
Selects the next tab when native tabs are enabled and there are other tabs in the window.
**/
function selectNextTab():Void;
/**
Shows or hides the tab overview when native tabs are enabled.
**/
function showAllTabs():Void;
/**
Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.
**/
Expand All @@ -921,8 +930,6 @@ package electron.remote;
function addTabbedWindow(browserWindow:electron.remote.BrowserWindow):Void;
/**
Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window.
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS.
**/
function setVibrancy(type:haxe.extern.EitherType<String, Dynamic>):Void;
/**
Expand Down Expand Up @@ -974,7 +981,7 @@ package electron.remote;
**/
function setTopBrowserView(browserView:electron.remote.BrowserView):Void;
/**
an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`.
a sorted by z-index array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases.
**/
Expand Down
Loading

0 comments on commit bb79e59

Please sign in to comment.