kokorobox-native 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. package/index.d.ts +28 -0
  2. package/index.js +3 -2
  3. package/package.json +8 -12
package/index.d.ts CHANGED
@@ -9,6 +9,28 @@ export interface NativeCapabilities {
9
9
  windowsAccount: boolean;
10
10
  windowsElevation: boolean;
11
11
  windowsFirewall: boolean;
12
+ launchAtLogin: boolean;
13
+ networkContext: boolean;
14
+ }
15
+
16
+ export interface LaunchAtLoginOptions {
17
+ /** Stable, filesystem-safe identifier, such as `com.amamiyakokoro.kokorobox`. */
18
+ identifier: string;
19
+ displayName: string;
20
+ executablePath: string;
21
+ arguments?: string[];
22
+ }
23
+
24
+ export interface LaunchAtLoginStatus {
25
+ enabled: boolean;
26
+ backend: "windows-task-scheduler" | "macos-login-item" | "linux-xdg-autostart";
27
+ }
28
+
29
+ /** Best-effort active-network state. Unavailable fields are omitted instead of guessed. */
30
+ export interface NetworkContext {
31
+ defaultInterface?: string;
32
+ dnsServers: string[];
33
+ ssid?: string;
12
34
  }
13
35
 
14
36
  export interface ApplicationInfo {
@@ -75,6 +97,12 @@ export function fileToStr(
75
97
  ): RuleStringResult;
76
98
  export function getAppName(path: string): string;
77
99
  export function getNativeCapabilities(): NativeCapabilities;
100
+ export function getLaunchAtLogin(options: LaunchAtLoginOptions): Promise<LaunchAtLoginStatus>;
101
+ export function setLaunchAtLogin(
102
+ options: LaunchAtLoginOptions,
103
+ enabled: boolean,
104
+ ): Promise<LaunchAtLoginStatus>;
105
+ export function getNetworkContext(): Promise<NetworkContext>;
78
106
  export function inspectApplication(path: string): Promise<ApplicationInfo>;
79
107
  export function scanWindowsApplications(
80
108
  directory: string,
package/index.js CHANGED
@@ -52,14 +52,12 @@ function requireNative() {
52
52
  if (process.platform === "win32") {
53
53
  if (process.arch === "x64") return requireBinding("win32-x64-msvc");
54
54
  if (process.arch === "arm64") return requireBinding("win32-arm64-msvc");
55
- if (process.arch === "ia32") return requireBinding("win32-ia32-msvc");
56
55
  } else if (process.platform === "darwin") {
57
56
  if (process.arch === "x64") return requireBinding("darwin-x64");
58
57
  if (process.arch === "arm64") return requireBinding("darwin-arm64");
59
58
  } else if (process.platform === "linux") {
60
59
  if (process.arch === "x64") return requireBinding("linux-x64-gnu");
61
60
  if (process.arch === "arm64") return requireBinding("linux-arm64-gnu");
62
- if (process.arch === "loong64") return requireBinding("linux-loong64-gnu");
63
61
  }
64
62
 
65
63
  loadErrors.push(
@@ -83,6 +81,9 @@ export const fileToDataUrl = nativeBinding.fileToDataUrl;
83
81
  export const fileToStr = nativeBinding.fileToStr;
84
82
  export const getAppName = nativeBinding.getAppName;
85
83
  export const getNativeCapabilities = nativeBinding.getNativeCapabilities;
84
+ export const getLaunchAtLogin = nativeBinding.getLaunchAtLogin;
85
+ export const setLaunchAtLogin = nativeBinding.setLaunchAtLogin;
86
+ export const getNetworkContext = nativeBinding.getNetworkContext;
86
87
  export const inspectApplication = nativeBinding.inspectApplication;
87
88
  export const scanWindowsApplications = nativeBinding.scanWindowsApplications;
88
89
  export const getCurrentUserSid = nativeBinding.getCurrentUserSid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kokorobox-native",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "KokoroBox native bridge",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -24,13 +24,11 @@
24
24
  "binaryName": "kokorobox-native",
25
25
  "targets": [
26
26
  "x86_64-pc-windows-msvc",
27
- "i686-pc-windows-msvc",
28
27
  "aarch64-pc-windows-msvc",
29
28
  "x86_64-apple-darwin",
30
29
  "aarch64-apple-darwin",
31
30
  "x86_64-unknown-linux-gnu",
32
- "aarch64-unknown-linux-gnu",
33
- "loongarch64-unknown-linux-gnu"
31
+ "aarch64-unknown-linux-gnu"
34
32
  ]
35
33
  },
36
34
  "scripts": {
@@ -49,13 +47,11 @@
49
47
  "access": "public"
50
48
  },
51
49
  "optionalDependencies": {
52
- "kokorobox-native-win32-x64-msvc": "0.3.0",
53
- "kokorobox-native-win32-ia32-msvc": "0.3.0",
54
- "kokorobox-native-win32-arm64-msvc": "0.3.0",
55
- "kokorobox-native-darwin-x64": "0.3.0",
56
- "kokorobox-native-darwin-arm64": "0.3.0",
57
- "kokorobox-native-linux-x64-gnu": "0.3.0",
58
- "kokorobox-native-linux-arm64-gnu": "0.3.0",
59
- "kokorobox-native-linux-loong64-gnu": "0.3.0"
50
+ "kokorobox-native-win32-x64-msvc": "0.4.0",
51
+ "kokorobox-native-win32-arm64-msvc": "0.4.0",
52
+ "kokorobox-native-darwin-x64": "0.4.0",
53
+ "kokorobox-native-darwin-arm64": "0.4.0",
54
+ "kokorobox-native-linux-x64-gnu": "0.4.0",
55
+ "kokorobox-native-linux-arm64-gnu": "0.4.0"
60
56
  }
61
57
  }