@petrea/wasm 0.0.0 → 0.5.1

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,82 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+
4
+ /** The WASI flavor this loader instantiates. */
5
+ export declare const __napiBindingTarget: 'wasm32-wasip1'
6
+
7
+ /** A TypeScript-only construct with runtime semantics that was kept verbatim. */
8
+ export interface NativeUnsupported {
9
+ nodeType: string
10
+ start: number
11
+ end: number
12
+ }
13
+
14
+ /** The `replaceOptions` flags. */
15
+ export interface ReplaceNativeOptions {
16
+ /**
17
+ * Skip matches that look like an assignment (`KEY = x`, `KEY => x`) or
18
+ * a declaration (`const|let|var KEY`).
19
+ */
20
+ preventAssignment?: boolean
21
+ /**
22
+ * Derive `typeof prefix` guard keys for legal member-chain dotted keys,
23
+ * replacing them with the quoted literal `"object"`.
24
+ */
25
+ objectGuards?: boolean
26
+ }
27
+
28
+ /**
29
+ * Async entry point: parses and blanks on a background thread; rejects with
30
+ * a `SyntaxError`-style error when the input cannot be parsed.
31
+ */
32
+ export declare function transpileAsync(input: string, options?: TranspileNativeOptions | undefined | null): Promise<TranspileNativeResult>
33
+
34
+ /**
35
+ * Options for the native bindings. `onError` reporting comes back as data so
36
+ * the background task never calls back into JS; the JS wrapper invokes the
37
+ * user callback.
38
+ */
39
+ export interface TranspileNativeOptions {
40
+ /** Parse the input as `ts` (default) or `tsx`. */
41
+ lang?: string
42
+ /**
43
+ * Source path quoted in parse-failure diagnostics; its extension also
44
+ * selects the parse mode (a `.tsx` filename enables JSX).
45
+ */
46
+ filename?: string
47
+ /**
48
+ * Plain-text replacement run before the pipeline parses; the JS
49
+ * `replace` option (see `types.ts` for the semantics).
50
+ */
51
+ replace?: Record<string, string>
52
+ /** Flags for `replace`; both default to false. */
53
+ replaceOptions?: ReplaceNativeOptions
54
+ /** Blank statically-dead branches in place; the JS `dce` option. */
55
+ dce?: boolean
56
+ }
57
+
58
+ export interface TranspileNativeResult {
59
+ code: string
60
+ unsupported: Array<NativeUnsupported>
61
+ }
62
+
63
+ /** Synchronous counterpart of `transpile_async` (the JS `transpileSync` export). */
64
+ export declare function transpileNativeSync(input: string, options?: TranspileNativeOptions | undefined | null): TranspileNativeResult
65
+
66
+ /**
67
+ * UTF-16 variant of [`TranspileNativeResult`]: raw code units are the only
68
+ * way to round-trip raw lone surrogates (a Rust `String` cannot hold them).
69
+ */
70
+ export interface TranspileUnitsResult {
71
+ code: Uint16Array
72
+ unsupported: Array<NativeUnsupported>
73
+ }
74
+
75
+ /**
76
+ * UTF-16 entry point: raw lone surrogates — which cannot cross into a Rust
77
+ * `String` — are handled losslessly here; report offsets are UTF-16 units.
78
+ */
79
+ export declare function transpileUtf16Async(units: Uint16Array, options?: TranspileNativeOptions | undefined | null): Promise<TranspileUnitsResult>
80
+
81
+ /** Synchronous UTF-16 entry point (see [`transpile_utf16_async`]). */
82
+ export declare function transpileUtf16Sync(units: Uint16Array, options?: TranspileNativeOptions | undefined | null): TranspileUnitsResult
Binary file
@@ -0,0 +1,2 @@
1
+ declare const wasmUrl: string;
2
+ export default wasmUrl;
package/package.json CHANGED
@@ -1,14 +1,52 @@
1
1
  {
2
2
  "name": "@petrea/wasm",
3
- "version": "0.0.0",
4
- "main": "index.js",
3
+ "type": "module",
4
+ "version": "0.5.1",
5
5
  "description": "WebAssembly binding for petrea (wasm32-wasip1)",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
6
  "license": "MIT",
10
7
  "repository": {
11
8
  "type": "git",
12
9
  "url": "https://github.com/Teages/petrea"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./binding.wasip1.d.cts",
14
+ "browser": "./binding.wasip1-browser.js",
15
+ "require": "./binding.wasip1.cjs",
16
+ "default": "./binding.wasip1.cjs"
17
+ },
18
+ "./workerd": {
19
+ "types": "./binding.wasip1-deferred.d.ts",
20
+ "default": "./binding.wasip1-deferred.js"
21
+ },
22
+ "./wasm": {
23
+ "types": "./binding.wasm32-wasip1.wasm.d.ts",
24
+ "default": "./binding.wasm32-wasip1.wasm"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "main": "binding.wasip1.cjs",
29
+ "types": "binding.wasip1.d.cts",
30
+ "files": [
31
+ "binding.wasip1-browser.js",
32
+ "binding.wasip1-deferred.d.ts",
33
+ "binding.wasip1-deferred.js",
34
+ "binding.wasip1.cjs",
35
+ "binding.wasip1.d.cts",
36
+ "binding.wasm32-wasip1.wasm",
37
+ "binding.wasm32-wasip1.wasm.d.ts"
38
+ ],
39
+ "engines": {
40
+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"
41
+ },
42
+ "browser": "binding.wasip1-browser.js",
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "provenance": true
46
+ },
47
+ "dependencies": {
48
+ "@emnapi/core": "2.0.0-alpha.5",
49
+ "@emnapi/runtime": "2.0.0-alpha.5",
50
+ "@napi-rs/wasm-runtime": "~1.2.3"
13
51
  }
14
- }
52
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # @petrea/wasm
2
-
3
- This is a stub package published by setup-trusted-publishing to enable OIDC trusted publishing configuration.
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = {};