@bouko/electron 1.0.7 → 1.1.0

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.js CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="./ipc.d.ts" />
1
2
  export * from "./ipc";
2
3
  export * from "./csp";
3
4
  export * from "./files/_";
package/dist/ipc/index.js CHANGED
@@ -18,7 +18,7 @@ export function setupAppIpc() {
18
18
  const window = BrowserWindow.fromWebContents(event.sender);
19
19
  window?.close();
20
20
  });
21
- ipcMain.on("app:open", (_, url) => {
21
+ ipcMain.on("app:open-link", (_, url) => {
22
22
  if (url)
23
23
  shell.openExternal(url);
24
24
  });
package/dist/ipc.d.ts ADDED
@@ -0,0 +1,24 @@
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
+ };
17
+
18
+ }
19
+
20
+ interface Window {
21
+ api: IpcApi;
22
+ }
23
+
24
+ }
@@ -0,0 +1,24 @@
1
+ export {};
2
+
3
+ type ChoosePathProps = {
4
+ title: string;
5
+ default?: "music";
6
+ };
7
+
8
+ declare global {
9
+
10
+ interface Window {
11
+
12
+ api: {
13
+
14
+ app: {
15
+ minimize: () => void;
16
+ close: () => void;
17
+ choosePath: (opts: ChoosePathProps) => Promise<string | null>;
18
+ };
19
+
20
+ };
21
+
22
+ }
23
+
24
+ }
@@ -0,0 +1,5 @@
1
+ declare module "*.svg" {
2
+ import { FC, SVGProps } from "react";
3
+ const content: FC<SVGProps<SVGElement>>;
4
+ export default content;
5
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/electron",
4
- "version": "1.0.7",
4
+ "version": "1.1.0",
5
5
  "description": "",
6
6
  "keywords": [],
7
7
  "author": "",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "exports": {
18
18
  ".": "./dist/index.js",
19
+ "./types": "./dist/index.d.ts",
19
20
  "./styles.css": "./dist/styles.css"
20
21
  },
21
22
  "engines": {},