@json-eval-rs/vanilla 0.0.45

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,27 @@
1
+ /**
2
+ * @json-eval-rs/vanilla
3
+ * JSON Eval RS for direct browser usage or environments needing manual WASM loading (e.g. Next.js Turbopack)
4
+ */
5
+ import { JSONEvalCore, JSONEvalOptions } from '@json-eval-rs/webcore';
6
+ import init from '../pkg/json_eval_rs.js';
7
+ /**
8
+ * JSONEval class for vanilla/web usage.
9
+ * Requires calling `init(wasmUrl)` before use.
10
+ */
11
+ export declare class JSONEval extends JSONEvalCore {
12
+ constructor(options: JSONEvalOptions);
13
+ /**
14
+ * Initialize the WASM module.
15
+ * Shortcut for the default export from pkg.
16
+ * @param input - Path to WASM file or WASM binary
17
+ * @returns Promise resolving to WASM module
18
+ */
19
+ static initWasm(input?: string | Request | Response | BufferSource | WebAssembly.Module): Promise<any>;
20
+ }
21
+ /**
22
+ * Get library version
23
+ */
24
+ export declare function version(): string;
25
+ export { init };
26
+ export * from '@json-eval-rs/webcore';
27
+ export default JSONEval;
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @json-eval-rs/vanilla
3
+ * JSON Eval RS for direct browser usage or environments needing manual WASM loading (e.g. Next.js Turbopack)
4
+ */
5
+ import { JSONEvalCore, getVersion } from '@json-eval-rs/webcore';
6
+ // @ts-ignore - implicitly loaded, file exists after build
7
+ import init, * as wasm from '../pkg/json_eval_rs.js';
8
+ /**
9
+ * JSONEval class for vanilla/web usage.
10
+ * Requires calling `init(wasmUrl)` before use.
11
+ */
12
+ export class JSONEval extends JSONEvalCore {
13
+ constructor(options) {
14
+ super(wasm, options);
15
+ }
16
+ /**
17
+ * Initialize the WASM module.
18
+ * Shortcut for the default export from pkg.
19
+ * @param input - Path to WASM file or WASM binary
20
+ * @returns Promise resolving to WASM module
21
+ */
22
+ static async initWasm(input) {
23
+ return init(input);
24
+ }
25
+ }
26
+ /**
27
+ * Get library version
28
+ */
29
+ export function version() {
30
+ return getVersion(wasm);
31
+ }
32
+ // Re-export init for direct usage
33
+ export { init };
34
+ // Re-export types for convenience
35
+ export * from '@json-eval-rs/webcore';
36
+ export default JSONEval;
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@json-eval-rs/vanilla",
3
+ "version": "0.0.45",
4
+ "description": "JSON Eval RS for direct browser usage (vanilla JS) or manual WASM loading (Next.js Turbopack compat)",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "pkg/*.js",
11
+ "pkg/*.wasm",
12
+ "pkg/*.d.ts"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepack": "npm run build"
17
+ },
18
+ "keywords": [
19
+ "json",
20
+ "json-logic",
21
+ "schema",
22
+ "validation",
23
+ "wasm",
24
+ "web",
25
+ "vanilla",
26
+ "browser",
27
+ "nextjs",
28
+ "turbopack"
29
+ ],
30
+ "author": "Muhamad Rizki",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/byrizki/jsoneval-rs.git",
35
+ "directory": "bindings/web/packages/vanilla"
36
+ },
37
+ "dependencies": {
38
+ "@json-eval-rs/webcore": "*"
39
+ },
40
+ "sideEffects": false
41
+ }