thrust-wasm 0.2.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.
- package/README.md +67 -0
- package/esm/package.json +23 -0
- package/esm/thrust_wasm.d.ts +52 -0
- package/esm/thrust_wasm.js +5 -0
- package/esm/thrust_wasm_bg.js +1019 -0
- package/esm/thrust_wasm_bg.wasm +0 -0
- package/nodejs/package.json +17 -0
- package/nodejs/thrust_wasm.d.ts +52 -0
- package/nodejs/thrust_wasm.js +1022 -0
- package/nodejs/thrust_wasm_bg.wasm +0 -0
- package/package.json +50 -0
- package/web/package.json +21 -0
- package/web/thrust_wasm.d.ts +136 -0
- package/web/thrust_wasm.js +1073 -0
- package/web/thrust_wasm_bg.wasm +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# thrust-wasm
|
|
2
|
+
|
|
3
|
+
`thrust-wasm` is the WebAssembly binding crate for `traffic-thrust`.
|
|
4
|
+
It provides browser/Node-friendly resolvers for FAA and EUROCONTROL data.
|
|
5
|
+
|
|
6
|
+
## What is exposed
|
|
7
|
+
|
|
8
|
+
- FAA NASR resolver from zipped cycle files (`NasrResolver`).
|
|
9
|
+
- FAA ArcGIS parsing helpers used by the JS adapter layer.
|
|
10
|
+
- EUROCONTROL AIXM resolver from folder-like zip payload maps.
|
|
11
|
+
- EUROCONTROL DDR resolver from either:
|
|
12
|
+
- folder-like payload maps (`fromDdrFolder`), or
|
|
13
|
+
- direct archive bytes (`fromDdrArchive`).
|
|
14
|
+
|
|
15
|
+
## Build locally
|
|
16
|
+
|
|
17
|
+
Build a single web target quickly:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
wasm-pack build crates/thrust-wasm --target web --dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Build publish-ready multi-target npm outputs (esm/web/nodejs):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd crates/thrust-wasm
|
|
27
|
+
just pkg
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Serve local assets:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python -m http.server 8000 -d crates/thrust-wasm
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Runtime guidance
|
|
37
|
+
|
|
38
|
+
- Prefer Node/server-side for full raw datasets (AIXM, DDR, full NASR).
|
|
39
|
+
- In browser docs/notebooks, use scoped subsets and lazy loading.
|
|
40
|
+
- For DDR folder payloads, expected keys are:
|
|
41
|
+
`navpoints.nnpt`, `routes.routes`, `airports.arp`,
|
|
42
|
+
`sectors.are`, `sectors.sls`, `free_route.are`,
|
|
43
|
+
`free_route.sls`, `free_route.frp`.
|
|
44
|
+
|
|
45
|
+
## Minimal usage
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
import init, { NasrResolver } from "./pkg/web/thrust_wasm.js";
|
|
49
|
+
|
|
50
|
+
await init();
|
|
51
|
+
|
|
52
|
+
const zip = await fetch("/path/to/28DaySubscription_Effective_2026-02-19.zip")
|
|
53
|
+
.then((r) => r.arrayBuffer());
|
|
54
|
+
|
|
55
|
+
const resolver = new NasrResolver(new Uint8Array(zip));
|
|
56
|
+
const airports = await resolver.airports();
|
|
57
|
+
console.log(airports.length);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
EUROCONTROL DDR from archive bytes:
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
const ddrZip = await fetch("/path/to/ENV_PostOPS_AIRAC_2111.zip")
|
|
64
|
+
.then((r) => r.arrayBuffer());
|
|
65
|
+
const ddr = EurocontrolResolver.fromDdrArchive(new Uint8Array(ddrZip));
|
|
66
|
+
console.log(ddr.resolve_airport("EHAM"));
|
|
67
|
+
```
|
package/esm/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "thrust-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "WASM bindings for traffic-thrust core parsers",
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/xoolive/thrust"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"thrust_wasm_bg.wasm",
|
|
13
|
+
"thrust_wasm.js",
|
|
14
|
+
"thrust_wasm_bg.js",
|
|
15
|
+
"thrust_wasm.d.ts"
|
|
16
|
+
],
|
|
17
|
+
"main": "thrust_wasm.js",
|
|
18
|
+
"types": "thrust_wasm.d.ts",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"./thrust_wasm.js",
|
|
21
|
+
"./snippets/*"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function airac_code_from_date(date: string): string;
|
|
4
|
+
export function airac_interval(airac_code: string): any;
|
|
5
|
+
export function effective_date_from_airac_code(airac_code: string): string;
|
|
6
|
+
export function run(): void;
|
|
7
|
+
export function wasm_build_profile(): string;
|
|
8
|
+
export class EurocontrolResolver {
|
|
9
|
+
free(): void;
|
|
10
|
+
[Symbol.dispose](): void;
|
|
11
|
+
resolve_fix(code: string): any;
|
|
12
|
+
resolve_airway(name: string): any;
|
|
13
|
+
resolve_navaid(code: string): any;
|
|
14
|
+
static fromDdrFolder(ddr_folder: any): EurocontrolResolver;
|
|
15
|
+
resolve_airport(code: string): any;
|
|
16
|
+
static fromDdrArchive(ddr_archive: Uint8Array): EurocontrolResolver;
|
|
17
|
+
constructor(aixm_folder: any);
|
|
18
|
+
fixes(): any;
|
|
19
|
+
airways(): any;
|
|
20
|
+
navaids(): any;
|
|
21
|
+
airports(): any;
|
|
22
|
+
}
|
|
23
|
+
export class FaaArcgisResolver {
|
|
24
|
+
free(): void;
|
|
25
|
+
[Symbol.dispose](): void;
|
|
26
|
+
resolve_fix(code: string): any;
|
|
27
|
+
resolve_airway(name: string): any;
|
|
28
|
+
resolve_navaid(code: string): any;
|
|
29
|
+
resolve_airport(code: string): any;
|
|
30
|
+
resolve_airspace(designator: string): any;
|
|
31
|
+
constructor(feature_collections_json: any);
|
|
32
|
+
fixes(): any;
|
|
33
|
+
airways(): any;
|
|
34
|
+
navaids(): any;
|
|
35
|
+
airports(): any;
|
|
36
|
+
airspaces(): any;
|
|
37
|
+
}
|
|
38
|
+
export class NasrResolver {
|
|
39
|
+
free(): void;
|
|
40
|
+
[Symbol.dispose](): void;
|
|
41
|
+
resolve_fix(code: string): any;
|
|
42
|
+
resolve_airway(name: string): any;
|
|
43
|
+
resolve_navaid(code: string): any;
|
|
44
|
+
resolve_airport(code: string): any;
|
|
45
|
+
resolve_airspace(designator: string): any;
|
|
46
|
+
constructor(zip_bytes: Uint8Array);
|
|
47
|
+
fixes(): any;
|
|
48
|
+
airways(): any;
|
|
49
|
+
navaids(): any;
|
|
50
|
+
airports(): any;
|
|
51
|
+
airspaces(): any;
|
|
52
|
+
}
|