java-bridge 2.1.8-beta.1 → 2.1.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.
@@ -16,11 +16,6 @@ export interface JVMOptions extends JavaOptions {
16
16
  * Additional arguments to pass to the JVM
17
17
  */
18
18
  opts?: Array<string> | null;
19
- /**
20
- * Additional items to add to the class path.
21
- * This also allows wildcard imports, e.g. `/lib/*`
22
- */
23
- classpath?: string[];
24
19
  }
25
20
  /**
26
21
  * Ensure the java vm is created.
@@ -45,7 +40,7 @@ export interface JVMOptions extends JavaOptions {
45
40
  * Let the plugin find the jvm.(dylib|dll|so)
46
41
  * ```ts
47
42
  * ensureJvm({
48
- * JavaVersion.VER_9,
43
+ * version: JavaVersion.VER_9,
49
44
  * useDaemonThreads: true
50
45
  * });
51
46
  * ```
@@ -154,7 +149,7 @@ export declare function setClassLoader(classLoader: UnknownJavaClass): void;
154
149
  * public constructor();
155
150
  * }
156
151
  *
157
- * // This causes the class to be import when the module is loaded.
152
+ * // This causes the class to be imported when the module is loaded.
158
153
  * class ArrayList<T> extends importClass<typeof ArrayListClass>('java.util.ArrayList')<T> {}
159
154
  *
160
155
  * // Create a new ArrayList instance
@@ -186,9 +181,10 @@ export declare function importClassAsync<T extends JavaClassConstructorType = Un
186
181
  * This doesn't check if the jars are valid and/or even exist.
187
182
  * The new classpath will be available to all classes imported after this call.
188
183
  *
189
- * **Note: This can only import single files, not directories.**
184
+ * If you want to import whole directories, you can use glob patterns.
190
185
  *
191
186
  * ## Example
187
+ * ### Append single files
192
188
  * ```ts
193
189
  * import { appendClasspath } from 'java-bridge';
194
190
  *
@@ -206,30 +202,19 @@ export declare function importClassAsync<T extends JavaClassConstructorType = Un
206
202
  * classpath.append('/path/to/jar.jar');
207
203
  * ```
208
204
  *
209
- * @param path the path(s) to add
210
- */
211
- export declare function appendClasspath(path: string | string[]): void;
212
- /**
213
- * Append either a single or multiple jars or directories to the class path.
214
- * This will check if the path(s) passed are directories and will
215
- * add a trailing slash to the path if it doesn't already have one
216
- * so the class loader will treat it as a directory. This will
217
- * check if the file or directory exists and throw an error if it doesn't exist.
218
- *
219
- * ## Example
205
+ * ### Append a directory to the class path
220
206
  * ```ts
221
- * appendClasspathAny('/path/to/dir');
222
- * ```
207
+ * import { appendClasspath } from 'java-bridge';
223
208
  *
224
- * Pass multiple paths:
225
- * ```ts
226
- * appendClasspathAny(['/path/to/dir1', '/path/to/my.jar']);
209
+ * // Append a directory to the class path
210
+ * appendClasspath('/path/to/dir/*');
211
+ * // Append just the jar files in the directory
212
+ * appendClasspath('/path/to/dir/*.jar');
227
213
  * ```
228
214
  *
229
- * @param path the file(s) or directory(s) to add
230
- * @param recursive whether to recursively add all files in the directory
215
+ * @param path the path(s) to add
231
216
  */
232
- export declare function appendClasspathAny(path: string | string[], recursive?: boolean): void;
217
+ export declare function appendClasspath(path: string | string[]): void;
233
218
  /**
234
219
  * Check if `this_obj` is instance of `other`.
235
220
  * This uses the native java `instanceof` operator.
@@ -281,10 +266,6 @@ export declare namespace classpath {
281
266
  * @inheritDoc appendClasspath
282
267
  */
283
268
  function append(path: string | string[]): void;
284
- /**
285
- * @inheritDoc appendClasspathAny
286
- */
287
- function appendAny(path: string | string[], recursive?: boolean): void;
288
269
  /**
289
270
  * Get the loaded files or directories in the class path
290
271
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "java-bridge",
3
- "version": "2.1.8-beta.1",
3
+ "version": "2.1.8",
4
4
  "main": "dist/index.prod.min.js",
5
5
  "types": "dist/ts-src/index.d.ts",
6
6
  "description": "A bridge between Node.js and Java APIs",
@@ -108,11 +108,11 @@
108
108
  "webpack-node-externals": "^3.0.0"
109
109
  },
110
110
  "optionalDependencies": {
111
- "java-bridge-win32-x64-msvc": "2.1.8-beta.1",
112
- "java-bridge-darwin-x64": "2.1.8-beta.1",
113
- "java-bridge-linux-x64-gnu": "2.1.8-beta.1",
114
- "java-bridge-darwin-arm64": "2.1.8-beta.1",
115
- "java-bridge-win32-ia32-msvc": "2.1.8-beta.1",
116
- "java-bridge-linux-arm64-gnu": "2.1.8-beta.1"
111
+ "java-bridge-win32-x64-msvc": "2.1.8",
112
+ "java-bridge-darwin-x64": "2.1.8",
113
+ "java-bridge-linux-x64-gnu": "2.1.8",
114
+ "java-bridge-darwin-arm64": "2.1.8",
115
+ "java-bridge-win32-ia32-msvc": "2.1.8",
116
+ "java-bridge-linux-arm64-gnu": "2.1.8"
117
117
  }
118
118
  }