@proton-app/main 0.0.4 → 0.0.6

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.
@@ -1,4 +1,5 @@
1
- export declare function setupAppIpc(): void;
1
+ import Storage from "electron-store";
2
+ export declare function setupAppIpc<T extends Record<string, unknown>>(storage: Storage<T>): void;
2
3
  export type IpcSchema = Record<string, Record<string, {
3
4
  input?: unknown;
4
5
  result: unknown;
@@ -4,7 +4,7 @@ exports.IpcManager = void 0;
4
4
  exports.setupAppIpc = setupAppIpc;
5
5
  const electron_1 = require("electron");
6
6
  const files_1 = require("./files");
7
- function setupAppIpc() {
7
+ function setupAppIpc(storage) {
8
8
  electron_1.ipcMain.on("app:minimize", (event) => {
9
9
  const window = electron_1.BrowserWindow.fromWebContents(event.sender);
10
10
  window?.minimize();
@@ -27,6 +27,9 @@ function setupAppIpc() {
27
27
  defaultPath: "music"
28
28
  });
29
29
  });
30
+ electron_1.ipcMain.handle("app:get-value", (_, key) => {
31
+ return storage.get(key);
32
+ });
30
33
  }
31
34
  class IpcManager {
32
35
  delimiter;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- /// <reference path="./ipc.d.ts" />
17
+ /// <reference path="./ipc.ts" />
18
18
  require("./ipc");
19
19
  __exportStar(require("./csp"), exports);
20
20
  __exportStar(require("./files"), exports);
package/dist/ipc.d.ts CHANGED
@@ -1,25 +1,19 @@
1
- export {};
2
-
3
- type ChoosePathProps = {
4
- title: string;
5
- default?: "music";
6
- };
7
-
8
- declare global {
9
-
10
- interface IpcApi {
11
-
12
- app: {
13
- minimize: () => void;
14
- close: () => void;
15
- choosePath: (opts: ChoosePathProps) => Promise<string | null>;
16
- openLink: (url: string) => void;
17
- };
18
-
19
- }
20
-
21
- interface Window {
22
- api: IpcApi;
23
- }
24
-
25
- }
1
+ export {};
2
+ type ChoosePathProps = {
3
+ title: string;
4
+ default?: "music";
5
+ };
6
+ declare global {
7
+ interface IpcApi {
8
+ app: {
9
+ minimize: () => void;
10
+ close: () => void;
11
+ choosePath: (opts: ChoosePathProps) => Promise<string | null>;
12
+ openLink: (url: string) => void;
13
+ getValue: <T>(key: string) => T;
14
+ };
15
+ }
16
+ interface Window {
17
+ api: IpcApi;
18
+ }
19
+ }
package/dist/ipc.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,71 +1,43 @@
1
1
  {
2
+
2
3
  "name": "@proton-app/main",
3
- "version": "0.0.4",
4
+ "version": "0.0.6",
4
5
  "description": "",
5
-
6
6
  "keywords": [],
7
-
8
7
  "author": "",
9
-
10
8
  "license": "ISC",
11
-
12
9
  "main": "./dist/index.js",
13
-
14
10
  "types": "./dist/index.d.ts",
15
-
16
11
  "files": [
17
-
18
12
  "dist"
19
-
20
13
  ],
21
-
22
14
  "publishConfig": {
23
-
24
15
  "access": "public"
25
-
26
16
  },
27
-
28
17
  "exports": {
29
-
30
18
  ".": {
31
-
32
19
  "default": "./dist/index.js",
33
-
34
20
  "types": "./dist/index.d.ts"
35
-
36
21
  },
37
-
38
22
  "./types": "./dist/index.d.ts"
39
-
40
23
  },
41
-
42
24
  "engines": {},
43
25
 
44
26
  "scripts": {
45
-
46
27
  "build": "tsc"
47
-
48
28
  },
49
29
 
50
30
  "dependencies": {
51
-
52
31
  "@bouko/ts": "^0.3.8",
53
-
32
+ "electron-store": "^11.0.2",
54
33
  "path": "^0.12.7"
55
-
56
34
  },
57
35
 
58
36
  "devDependencies": {
59
-
60
37
  "@types/react": "^19.2.13",
61
-
62
38
  "electron": "^39.2.7",
63
-
64
39
  "react-router-dom": "^7.12.0",
65
-
66
40
  "typescript": "^5.9.3"
67
-
68
41
  }
69
42
 
70
- }
71
-
43
+ }