Skip to content

Commit

Permalink
Upgrade to electron v30.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed May 24, 2024
1 parent 5fd2d42 commit ce75198
Show file tree
Hide file tree
Showing 8 changed files with 327 additions and 322 deletions.
609 changes: 300 additions & 309 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": "30.0.1",
"version": "30.0.8",
"contributors": [
"tong",
"fponticelli"
Expand Down
6 changes: 3 additions & 3 deletions src/electron/main/Dialog.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ package electron.main;
@:optional
var securityScopedBookmarks : Bool; }):js.lib.Promise<Any>;
/**
the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
the path of the file chosen by the user; if the dialog is cancelled it returns an empty string.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
Expand Down Expand Up @@ -111,12 +111,12 @@ package electron.main;
Create a security scoped bookmark 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.
**/
@:optional
var securityScopedBookmarks : Bool; }):haxe.extern.EitherType<String, Dynamic>;
var securityScopedBookmarks : Bool; }):String;
/**
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`.
* `filePath` string - If the dialog is canceled, this will be an empty string.
* `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.)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
Expand Down
10 changes: 7 additions & 3 deletions src/electron/main/Protocol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ package electron.main;
```
const { app, protocol, net } = require('electron')
const path = require('node:path')
const url = require('node:url')
app.whenReady().then(() => {
protocol.handle('atom', (request) =>
net.fetch('file://' + request.url.slice('atom://'.length)))
protocol.handle('atom', (request) => {
const filePath = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
})
})
```
Expand All @@ -34,7 +38,7 @@ package electron.main;
ses.protocol.handle('atom', (request) => {
const filePath = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
return net.fetch(url.pathToFileURL(path.resolve(__dirname, filePath)).toString())
})
const mainWindow = new BrowserWindow({ webPreferences: { partition } })
Expand Down
3 changes: 3 additions & 0 deletions src/electron/main/View.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ package electron.main;
**/
var children : Array<electron.main.View>;
function new():Void;
/**
If the same View is added to a parent which already contains it, it will be reordered such that it becomes the topmost view.
**/
function addChildView(view:electron.main.View, ?index:Int):Void;
function removeChildView(view:electron.main.View):Void;
function setBounds(bounds:electron.Rectangle):Void;
Expand Down
6 changes: 3 additions & 3 deletions src/electron/remote/Dialog.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ package electron.remote;
@:optional
var securityScopedBookmarks : Bool; }):js.lib.Promise<Any>;
/**
the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
the path of the file chosen by the user; if the dialog is cancelled it returns an empty string.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
Expand Down Expand Up @@ -111,12 +111,12 @@ package electron.remote;
Create a security scoped bookmark 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.
**/
@:optional
var securityScopedBookmarks : Bool; }):haxe.extern.EitherType<String, Dynamic>;
var securityScopedBookmarks : Bool; }):String;
/**
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`.
* `filePath` string - If the dialog is canceled, this will be an empty string.
* `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.)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
Expand Down
10 changes: 7 additions & 3 deletions src/electron/remote/Protocol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ package electron.remote;
```
const { app, protocol, net } = require('electron')
const path = require('node:path')
const url = require('node:url')
app.whenReady().then(() => {
protocol.handle('atom', (request) =>
net.fetch('file://' + request.url.slice('atom://'.length)))
protocol.handle('atom', (request) => {
const filePath = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
})
})
```
Expand All @@ -34,7 +38,7 @@ package electron.remote;
ses.protocol.handle('atom', (request) => {
const filePath = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
return net.fetch(url.pathToFileURL(path.resolve(__dirname, filePath)).toString())
})
const mainWindow = new BrowserWindow({ webPreferences: { partition } })
Expand Down
3 changes: 3 additions & 0 deletions src/electron/remote/View.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ package electron.remote;
**/
var children : Array<electron.remote.View>;
function new():Void;
/**
If the same View is added to a parent which already contains it, it will be reordered such that it becomes the topmost view.
**/
function addChildView(view:electron.remote.View, ?index:Int):Void;
function removeChildView(view:electron.remote.View):Void;
function setBounds(bounds:electron.Rectangle):Void;
Expand Down

0 comments on commit ce75198

Please sign in to comment.