@bouko/electron 1.0.6 → 1.0.8

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.
@@ -0,0 +1,2 @@
1
+ export * from "./dialog";
2
+ export * from "./paths";
@@ -0,0 +1,2 @@
1
+ export * from "./dialog";
2
+ export * from "./paths";
@@ -1 +1,2 @@
1
1
  export declare const getUserDataPath: (x: string) => string;
2
+ export declare const getAppDataPath: (x: string) => string;
@@ -1,3 +1,4 @@
1
1
  import { app } from "electron";
2
2
  import { join } from "path";
3
3
  export const getUserDataPath = (x) => join(app.getPath("userData"), x);
4
+ export const getAppDataPath = (x) => join(app.getPath("appData"), x);
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from "./ipc";
2
2
  export * from "./csp";
3
- export * from "./files";
3
+ export * from "./files/_";
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
- export * from "./files";
4
+ export * from "./files/_";
package/dist/ipc/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ipcMain, BrowserWindow } from "electron";
1
+ import { ipcMain, BrowserWindow, shell } from "electron";
2
2
  import { choosePath } from "../files/dialog";
3
3
  export class IpcManager {
4
4
  id;
@@ -18,7 +18,11 @@ export function setupAppIpc() {
18
18
  const window = BrowserWindow.fromWebContents(event.sender);
19
19
  window?.close();
20
20
  });
21
- ipcMain.on("app:choose-path", async (event) => {
21
+ ipcMain.on("app:open-link", (_, url) => {
22
+ if (url)
23
+ shell.openExternal(url);
24
+ });
25
+ ipcMain.handle("app:choose-path", async (event) => {
22
26
  const window = BrowserWindow.fromWebContents(event.sender);
23
27
  if (!window)
24
28
  return;
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 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,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.6",
4
+ "version": "1.0.8",
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": {},