@bouko/electron 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ipc.d.ts +13 -0
- package/dist/ipc.js +23 -0
- package/package.json +58 -56
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/ipc.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Control IPC Handlers.
|
|
3
|
+
*
|
|
4
|
+
* Registers IPC listeners used by the renderer process to
|
|
5
|
+
* control the app window. Uses the `BrowserWindow` instance
|
|
6
|
+
* from the sent `WebContents`, ensuring the correct window
|
|
7
|
+
* is targeted even in multi-window setups.
|
|
8
|
+
*
|
|
9
|
+
* Channels:
|
|
10
|
+
* - `minimize`: Minimizes the window.
|
|
11
|
+
* - `close`: Closes the window.
|
|
12
|
+
**/
|
|
13
|
+
export declare function setupAppIpc(): void;
|
package/dist/ipc.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ipcMain, BrowserWindow } from "electron";
|
|
2
|
+
/**
|
|
3
|
+
* App Control IPC Handlers.
|
|
4
|
+
*
|
|
5
|
+
* Registers IPC listeners used by the renderer process to
|
|
6
|
+
* control the app window. Uses the `BrowserWindow` instance
|
|
7
|
+
* from the sent `WebContents`, ensuring the correct window
|
|
8
|
+
* is targeted even in multi-window setups.
|
|
9
|
+
*
|
|
10
|
+
* Channels:
|
|
11
|
+
* - `minimize`: Minimizes the window.
|
|
12
|
+
* - `close`: Closes the window.
|
|
13
|
+
**/
|
|
14
|
+
export function setupAppIpc() {
|
|
15
|
+
ipcMain.on("app:minimize", (event) => {
|
|
16
|
+
const window = BrowserWindow.fromWebContents(event.sender);
|
|
17
|
+
window?.minimize();
|
|
18
|
+
});
|
|
19
|
+
ipcMain.on("app:close", (event) => {
|
|
20
|
+
const window = BrowserWindow.fromWebContents(event.sender);
|
|
21
|
+
window?.close();
|
|
22
|
+
});
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
"name": "@bouko/electron",
|
|
4
|
-
|
|
5
|
-
"version": "1.0.
|
|
6
|
-
|
|
7
|
-
"description": "",
|
|
8
|
-
|
|
9
|
-
"keywords": [],
|
|
10
|
-
|
|
11
|
-
"author": "",
|
|
12
|
-
|
|
13
|
-
"license": "ISC",
|
|
14
|
-
|
|
15
|
-
"main": "./dist/index.js",
|
|
16
|
-
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
|
|
19
|
-
"files": [
|
|
20
|
-
|
|
21
|
-
"dist"
|
|
22
|
-
|
|
23
|
-
],
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
"scripts": {
|
|
34
|
-
|
|
35
|
-
"build": "tsc"
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
1
|
+
{
|
|
2
|
+
|
|
3
|
+
"name": "@bouko/electron",
|
|
4
|
+
|
|
5
|
+
"version": "1.0.2",
|
|
6
|
+
|
|
7
|
+
"description": "",
|
|
8
|
+
|
|
9
|
+
"keywords": [],
|
|
10
|
+
|
|
11
|
+
"author": "",
|
|
12
|
+
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
|
|
19
|
+
"files": [
|
|
20
|
+
|
|
21
|
+
"dist"
|
|
22
|
+
|
|
23
|
+
],
|
|
24
|
+
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
|
|
27
|
+
"access": "public"
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"engines": {},
|
|
32
|
+
|
|
33
|
+
"scripts": {
|
|
34
|
+
|
|
35
|
+
"build": "tsc"
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"dependencies": {
|
|
40
|
+
|
|
41
|
+
"@bouko/ts": "^0.3.8",
|
|
42
|
+
|
|
43
|
+
"path": "^0.12.7"
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
|
|
49
|
+
"electron": "^39.2.7",
|
|
50
|
+
|
|
51
|
+
"react-router-dom": "^7.12.0",
|
|
52
|
+
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|