@el3um4s/electron-window
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -16,2 +16,3 @@ /// <reference types="node" /> | ||
createWindow(options?: CreateWindow): BrowserWindow; | ||
loadUrl(url: string): void; | ||
setIpcMain(api: Array<IPC>): Promise<void>; | ||
@@ -18,0 +19,0 @@ addBrowserView(options?: CreateBrowserView): Promise<void>; |
@@ -49,2 +49,5 @@ "use strict"; | ||
} | ||
loadUrl(url) { | ||
this.window.loadURL(url); | ||
} | ||
setIpcMain(api) { | ||
@@ -51,0 +54,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@el3um4s/electron-window", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Electron - create a window with optional autoupdater and browserview", | ||
@@ -57,9 +57,9 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@types/jest": "^29.0.0", | ||
"@types/node": "^18.7.16", | ||
"@typescript-eslint/eslint-plugin": "^5.36.2", | ||
"@typescript-eslint/parser": "^5.36.2", | ||
"@types/jest": "^29.0.3", | ||
"@types/node": "^18.7.18", | ||
"@typescript-eslint/eslint-plugin": "^5.37.0", | ||
"@typescript-eslint/parser": "^5.37.0", | ||
"ansi-regex": ">=6.0.1", | ||
"electron": "^20.1.3", | ||
"eslint": "^8.23.0", | ||
"electron": "^20.1.4", | ||
"eslint": "^8.23.1", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -71,3 +71,3 @@ "eslint-config-standard": "^17.0.0", | ||
"jest": "^29.0.3", | ||
"ts-jest": "^29.0.0", | ||
"ts-jest": "^29.0.1", | ||
"typescript": "^4.8.3" | ||
@@ -74,0 +74,0 @@ }, |
@@ -136,2 +136,21 @@ # Electron Window | ||
`loadUrl(url: string): void`: load a new url in the window | ||
```ts | ||
import ElectronWindow from "@el3um4s/electron-window"; | ||
let window: ElectronWindow; | ||
const options = { | ||
url: "https://www.google.com", | ||
themeSource: "light", | ||
preload: "path/to/preload.js", | ||
}; | ||
window = new ElectronWindow(); | ||
window.createWindow(options); | ||
window.loadUrl("https://www.youtube.com"); | ||
``` | ||
`async setIpcMain(api: Array<IPC>): Promise<void>`: set the ipcMain for the window | ||
@@ -138,0 +157,0 @@ |
34606
477
490