@sanox/sangine-core 0.1.0 → 0.2.2
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/dist/gen-types.d.ts +29 -4
- package/dist/gen-types.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +94 -106
- package/dist/rendererService.d.ts +2 -2
- package/dist/rendererService.d.ts.map +1 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/wasm/sangine/sangine.d.ts +36 -19
- package/dist/wasm/sangine/sangine.js +51 -40
- package/dist/wasm/sangine/sangine_bg.wasm +0 -0
- package/dist/wasm/sangine/sangine_bg.wasm.d.ts +16 -16
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.wasm +0 -0
- package/dist/worker/decodeWorkerImpl.d.ts +4 -1
- package/dist/worker/decodeWorkerImpl.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/gen-types.d.ts
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run json-schema-to-typescript to regenerate this file.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* This interface was referenced by `Schema`'s JSON-Schema
|
|
8
|
+
* via the `definition` "DecodeTask".
|
|
9
|
+
*/
|
|
10
|
+
export type DecodeTask = {
|
|
11
|
+
"texture-file": {
|
|
12
|
+
pk: string;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
"model-part-mesh": {
|
|
16
|
+
pk: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
6
19
|
/**
|
|
7
20
|
* This interface was referenced by `Schema`'s JSON-Schema
|
|
8
21
|
* via the `definition` "LodEnum".
|
|
@@ -81,9 +94,14 @@ export interface Material {
|
|
|
81
94
|
* via the `definition` "Texture".
|
|
82
95
|
*/
|
|
83
96
|
export interface Texture {
|
|
84
|
-
downloadTemplate: string;
|
|
85
97
|
name: string;
|
|
86
|
-
|
|
98
|
+
resolutionFiles: {
|
|
99
|
+
/**
|
|
100
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
101
|
+
* via the `patternProperty` "^-?\d+$".
|
|
102
|
+
*/
|
|
103
|
+
[k: string]: string;
|
|
104
|
+
};
|
|
87
105
|
textureType?: TextureTypeEnum | null;
|
|
88
106
|
}
|
|
89
107
|
/**
|
|
@@ -110,9 +128,16 @@ export interface ModelCollection {
|
|
|
110
128
|
export interface ModelPart {
|
|
111
129
|
aabb: number[];
|
|
112
130
|
center: number[];
|
|
113
|
-
downloadTemplate: string;
|
|
114
131
|
id: string;
|
|
115
|
-
|
|
132
|
+
lodMeshes: {
|
|
133
|
+
high?: string;
|
|
134
|
+
low?: string;
|
|
135
|
+
medium?: string;
|
|
136
|
+
preview?: string;
|
|
137
|
+
"preview-low"?: string;
|
|
138
|
+
"very-high"?: string;
|
|
139
|
+
"very-low"?: string;
|
|
140
|
+
};
|
|
116
141
|
materials: string[];
|
|
117
142
|
}
|
|
118
143
|
/**
|
package/dist/gen-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen-types.d.ts","sourceRoot":"","sources":["../src/gen-types.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;AACvG;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9D;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AACxC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACvE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,OA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
"use strict";var f=Object.defineProperty;var y=(
|
|
1
|
+
"use strict";var f=Object.defineProperty;var y=(a,e,t)=>e in a?f(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>y(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g="/static/sangine/wasm";class _{constructor(e,t){r(this,"workers");r(this,"idle");r(this,"queue",[]);this.workers=Array.from({length:t},e),this.idle=[...this.workers]}run(e){return new Promise((t,s)=>{const o=this.idle.pop();o?this.dispatch(o,e,t,s):this.queue.push({request:e,resolve:t,reject:s})})}dispatch(e,t,s,o){const n=i=>{s(i.data),d(),this.release(e)},c=i=>{o(i),d(),this.release(e)},d=()=>{e.removeEventListener("message",n),e.removeEventListener("error",c)};e.addEventListener("message",n,{once:!0}),e.addEventListener("error",c,{once:!0}),e.postMessage(t)}release(e){const t=this.queue.shift();t?this.dispatch(e,t.request,t.resolve,t.reject):this.idle.push(e)}terminate(){for(const e of this.workers)e.terminate()}}class p{constructor(e){r(this,"wasm",null);r(this,"callbackRegistry",{});r(this,"userActionRegistry",{});r(this,"windowCreatedPromiseRegistry",{});r(this,"windowCreatedPromiseResolveRegistry",{});r(this,"_inited",!1);r(this,"decodePool");r(this,"_readyPromise");r(this,"_resolveReady");r(this,"_rejectReady");this.config=e,this._readyPromise=new Promise((t,s)=>{this._resolveReady=t,this._rejectReady=s}),this.config=e}async init(){if(!(typeof window>"u")){if(this._inited)return this._readyPromise;try{const t=await import(new URL(`${g}/sangine/sangine.js`,window.location.origin).toString());await t.default(),this.wasm=t,this._inited=!0;const s=this.config.numWorkers??(navigator.hardwareConcurrency||2)-1;this.decodePool=new _(()=>this.config.createDecodeWorker(),Math.max(s,1)),this.wasm.register_asset_decoder(this.decodeAsset.bind(this)),this.wasm.register_event_listener(this.handleSangineEvent.bind(this)),this._resolveReady()}catch(e){throw this._rejectReady(e),e}return this._readyPromise}}ready(){return this._readyPromise}get inited(){return this._inited}getWasm(){if(!this.wasm)throw new Error("RendererService not initialized");return this.wasm}handleActionChanged(e,t){this.userActionRegistry[e]=t;for(const s of this.callbackRegistry[e].actionChanged)s(t)}handleMeasurementCreated(e,t){for(const s of this.callbackRegistry[e].measurementCreated)s(t)}handleRouteUpdated(e,t){for(const s of this.callbackRegistry[e].routeUpdated)s(t)}handleSangineEvent(e,t){t==="ready"?this.windowCreatedPromiseResolveRegistry[e]():"actionChanged"in t?this.handleActionChanged(e,t.actionChanged.action):"measurementCreated"in t?this.handleMeasurementCreated(e,t.measurementCreated.measurement):"routeUnderConstructionUpdated"in t&&this.handleRouteUpdated(e,t.routeUnderConstructionUpdated.route)}createWindow(e,t){if(!this.wasm)throw new Error("WASM not initialized");let s;const o=new Promise(c=>{s=c}),n=this.wasm.create_window(e,t);return this.windowCreatedPromiseResolveRegistry[n]=s,this.callbackRegistry[n]={actionChanged:[],routeUpdated:[],measurementCreated:[]},this.userActionRegistry[n]="watching",this.windowCreatedPromiseRegistry[n]=o,n}readUserAction(e){return this.userActionRegistry[e]}windowReady(e){return this.windowCreatedPromiseRegistry[e]}registerCallback(e,t,s){this.callbackRegistry[e][t].push(s)}setWindowAction(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_window_action(e,t)}destroyWindow(e){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.destroy_window(e),delete this.callbackRegistry[e],delete this.userActionRegistry[e]}setRouteHighlight(e,t,s){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_route_highlight(e,t,s)}setRouteVisible(e,t,s){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_route_visible(e,t,s)}animateToRoute(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.animate_to_route(e,t)}setSunProperties(e,t,s,o,n,c,d){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_sun_properties(e,t,s,o,n,c,d)}setNorthCorrection(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_north_correction(e,t)}setGpuMemoryBudgetMb(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_gpu_memory_budget_mb(e,t)}setRenderQuality(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_render_quality(e,t)}readCameraPos(e){if(!this.wasm)throw new Error("WASM not initialized");return this.wasm.read_camera_pos(e)}animateTo(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.animate_to(e,t)}setScale(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_window_scale(e,t)}async decodeAsset(e){if(!this.decodePool)throw new Error("Renderer not initialized");return this.decodePool.run(e)}destroy(){var e;(e=this.decodePool)==null||e.terminate()}}function R(a,e){let t=!1,s=null,o=null;async function n(c,d){const i=`https://sangine-asset-cache/${c}`,w=await o.match(i);if(w)return w;const l=await d(),h=await fetch(l);return h.ok&&await o.put(i,h.clone()),h}a.onmessage=async c=>{if(!t){const w=await import(new URL(`${g}/sbo-decode/wasm_sbo_decode.js`,a.location.origin).href);await w.default(),s=w,t=!0}o||(o=await caches.open("sangine-assets-v1"));const{data:d}=c;if("texture-file"in d)try{const i=await n(d["texture-file"].pk,()=>e(d));if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const w=await i.blob(),l=await createImageBitmap(w),h=new OffscreenCanvas(l.width,l.height),m=h.getContext("2d");if(m===null)throw new Error("Couldnt create canvas");m.drawImage(l,0,0);const u=m.getImageData(0,0,h.width,h.height);a.postMessage({success:!0,width:h.width,height:h.height,data:u.data.buffer},[u.data.buffer])}catch(i){a.postMessage({success:!1,error:i.message})}else if("model-part-mesh"in d){const i=await n(d["model-part-mesh"].pk,()=>e(d));if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const w=await i.arrayBuffer(),l=new Uint8Array(w),h=s.decode_sbo(l);a.postMessage({success:!0,data:h.buffer},[h.buffer])}}}exports.RendererService=p;exports.registerDecodeWorker=R;
|
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var y = (
|
|
3
|
-
var
|
|
2
|
+
var y = (a, e, t) => e in a ? f(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var r = (a, e, t) => y(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
const g = "/static/sangine/wasm";
|
|
5
5
|
class _ {
|
|
6
6
|
constructor(e, t) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
r(this, "workers");
|
|
8
|
+
r(this, "idle");
|
|
9
|
+
r(this, "queue", []);
|
|
10
10
|
this.workers = Array.from({ length: t }, e), this.idle = [...this.workers];
|
|
11
11
|
}
|
|
12
12
|
run(e) {
|
|
13
|
-
return new Promise((t,
|
|
14
|
-
const
|
|
15
|
-
|
|
13
|
+
return new Promise((t, s) => {
|
|
14
|
+
const o = this.idle.pop();
|
|
15
|
+
o ? this.dispatch(o, e, t, s) : this.queue.push({ request: e, resolve: t, reject: s });
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
dispatch(e, t,
|
|
19
|
-
const
|
|
20
|
-
i
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
e.removeEventListener("message",
|
|
18
|
+
dispatch(e, t, s, o) {
|
|
19
|
+
const n = (i) => {
|
|
20
|
+
s(i.data), d(), this.release(e);
|
|
21
|
+
}, c = (i) => {
|
|
22
|
+
o(i), d(), this.release(e);
|
|
23
|
+
}, d = () => {
|
|
24
|
+
e.removeEventListener("message", n), e.removeEventListener("error", c);
|
|
25
25
|
};
|
|
26
|
-
e.addEventListener("message",
|
|
26
|
+
e.addEventListener("message", n, { once: !0 }), e.addEventListener("error", c, { once: !0 }), e.postMessage(t);
|
|
27
27
|
}
|
|
28
28
|
release(e) {
|
|
29
29
|
const t = this.queue.shift();
|
|
@@ -34,20 +34,20 @@ class _ {
|
|
|
34
34
|
e.terminate();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class R {
|
|
38
38
|
constructor(e) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.config = e, this._readyPromise = new Promise((t,
|
|
50
|
-
this._resolveReady = t, this._rejectReady =
|
|
39
|
+
r(this, "wasm", null);
|
|
40
|
+
r(this, "callbackRegistry", {});
|
|
41
|
+
r(this, "userActionRegistry", {});
|
|
42
|
+
r(this, "windowCreatedPromiseRegistry", {});
|
|
43
|
+
r(this, "windowCreatedPromiseResolveRegistry", {});
|
|
44
|
+
r(this, "_inited", !1);
|
|
45
|
+
r(this, "decodePool");
|
|
46
|
+
r(this, "_readyPromise");
|
|
47
|
+
r(this, "_resolveReady");
|
|
48
|
+
r(this, "_rejectReady");
|
|
49
|
+
this.config = e, this._readyPromise = new Promise((t, s) => {
|
|
50
|
+
this._resolveReady = t, this._rejectReady = s;
|
|
51
51
|
}), this.config = e;
|
|
52
52
|
}
|
|
53
53
|
async init() {
|
|
@@ -59,10 +59,10 @@ class p {
|
|
|
59
59
|
window.location.origin
|
|
60
60
|
).toString());
|
|
61
61
|
await t.default(), this.wasm = t, this._inited = !0;
|
|
62
|
-
const
|
|
62
|
+
const s = this.config.numWorkers ?? (navigator.hardwareConcurrency || 2) - 1;
|
|
63
63
|
this.decodePool = new _(
|
|
64
64
|
() => this.config.createDecodeWorker(),
|
|
65
|
-
Math.max(
|
|
65
|
+
Math.max(s, 1)
|
|
66
66
|
), this.wasm.register_asset_decoder(this.decodeAsset.bind(this)), this.wasm.register_event_listener(this.handleSangineEvent.bind(this)), this._resolveReady();
|
|
67
67
|
} catch (e) {
|
|
68
68
|
throw this._rejectReady(e), e;
|
|
@@ -83,31 +83,31 @@ class p {
|
|
|
83
83
|
}
|
|
84
84
|
handleActionChanged(e, t) {
|
|
85
85
|
this.userActionRegistry[e] = t;
|
|
86
|
-
for (const
|
|
87
|
-
|
|
86
|
+
for (const s of this.callbackRegistry[e].actionChanged)
|
|
87
|
+
s(t);
|
|
88
88
|
}
|
|
89
89
|
handleMeasurementCreated(e, t) {
|
|
90
|
-
for (const
|
|
91
|
-
|
|
90
|
+
for (const s of this.callbackRegistry[e].measurementCreated)
|
|
91
|
+
s(t);
|
|
92
92
|
}
|
|
93
93
|
handleRouteUpdated(e, t) {
|
|
94
|
-
for (const
|
|
95
|
-
|
|
94
|
+
for (const s of this.callbackRegistry[e].routeUpdated)
|
|
95
|
+
s(t);
|
|
96
96
|
}
|
|
97
97
|
handleSangineEvent(e, t) {
|
|
98
98
|
t === "ready" ? this.windowCreatedPromiseResolveRegistry[e]() : "actionChanged" in t ? this.handleActionChanged(e, t.actionChanged.action) : "measurementCreated" in t ? this.handleMeasurementCreated(e, t.measurementCreated.measurement) : "routeUnderConstructionUpdated" in t && this.handleRouteUpdated(e, t.routeUnderConstructionUpdated.route);
|
|
99
99
|
}
|
|
100
100
|
createWindow(e, t) {
|
|
101
101
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
}),
|
|
106
|
-
return this.windowCreatedPromiseResolveRegistry[
|
|
102
|
+
let s;
|
|
103
|
+
const o = new Promise((c) => {
|
|
104
|
+
s = c;
|
|
105
|
+
}), n = this.wasm.create_window(e, t);
|
|
106
|
+
return this.windowCreatedPromiseResolveRegistry[n] = s, this.callbackRegistry[n] = {
|
|
107
107
|
actionChanged: [],
|
|
108
108
|
routeUpdated: [],
|
|
109
109
|
measurementCreated: []
|
|
110
|
-
}, this.userActionRegistry[
|
|
110
|
+
}, this.userActionRegistry[n] = "watching", this.windowCreatedPromiseRegistry[n] = o, n;
|
|
111
111
|
}
|
|
112
112
|
readUserAction(e) {
|
|
113
113
|
return this.userActionRegistry[e];
|
|
@@ -115,8 +115,8 @@ class p {
|
|
|
115
115
|
windowReady(e) {
|
|
116
116
|
return this.windowCreatedPromiseRegistry[e];
|
|
117
117
|
}
|
|
118
|
-
registerCallback(e, t,
|
|
119
|
-
this.callbackRegistry[e][t].push(
|
|
118
|
+
registerCallback(e, t, s) {
|
|
119
|
+
this.callbackRegistry[e][t].push(s);
|
|
120
120
|
}
|
|
121
121
|
setWindowAction(e, t) {
|
|
122
122
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
@@ -126,28 +126,28 @@ class p {
|
|
|
126
126
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
127
127
|
this.wasm.destroy_window(e), delete this.callbackRegistry[e], delete this.userActionRegistry[e];
|
|
128
128
|
}
|
|
129
|
-
setRouteHighlight(e, t,
|
|
129
|
+
setRouteHighlight(e, t, s) {
|
|
130
130
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
131
|
-
this.wasm.set_route_highlight(e, t,
|
|
131
|
+
this.wasm.set_route_highlight(e, t, s);
|
|
132
132
|
}
|
|
133
|
-
setRouteVisible(e, t,
|
|
133
|
+
setRouteVisible(e, t, s) {
|
|
134
134
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
135
|
-
this.wasm.set_route_visible(e, t,
|
|
135
|
+
this.wasm.set_route_visible(e, t, s);
|
|
136
136
|
}
|
|
137
137
|
animateToRoute(e, t) {
|
|
138
138
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
139
139
|
this.wasm.animate_to_route(e, t);
|
|
140
140
|
}
|
|
141
|
-
setSunProperties(e, t,
|
|
141
|
+
setSunProperties(e, t, s, o, n, c, d) {
|
|
142
142
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
143
143
|
this.wasm.set_sun_properties(
|
|
144
144
|
e,
|
|
145
145
|
t,
|
|
146
|
-
|
|
147
|
-
n,
|
|
146
|
+
s,
|
|
148
147
|
o,
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
n,
|
|
149
|
+
c,
|
|
150
|
+
d
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
setNorthCorrection(e, t) {
|
|
@@ -174,83 +174,71 @@ class p {
|
|
|
174
174
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
175
175
|
this.wasm.set_window_scale(e, t);
|
|
176
176
|
}
|
|
177
|
-
async decodeAsset(e
|
|
177
|
+
async decodeAsset(e) {
|
|
178
178
|
if (!this.decodePool) throw new Error("Renderer not initialized");
|
|
179
|
-
return this.decodePool.run(
|
|
179
|
+
return this.decodePool.run(e);
|
|
180
180
|
}
|
|
181
181
|
destroy() {
|
|
182
182
|
var e;
|
|
183
183
|
(e = this.decodePool) == null || e.terminate();
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const t = l.encode(s);
|
|
198
|
-
return e.set(t), {
|
|
199
|
-
read: s.length,
|
|
200
|
-
written: t.length
|
|
201
|
-
};
|
|
202
|
-
});
|
|
203
|
-
function A(s) {
|
|
204
|
-
let e = !1, t = null;
|
|
205
|
-
s.onmessage = async (i) => {
|
|
206
|
-
if (!e) {
|
|
207
|
-
const r = await import(new URL(
|
|
186
|
+
function b(a, e) {
|
|
187
|
+
let t = !1, s = null, o = null;
|
|
188
|
+
async function n(c, d) {
|
|
189
|
+
const i = `https://sangine-asset-cache/${c}`, w = await o.match(i);
|
|
190
|
+
if (w) return w;
|
|
191
|
+
const l = await d(), h = await fetch(l);
|
|
192
|
+
return h.ok && await o.put(i, h.clone()), h;
|
|
193
|
+
}
|
|
194
|
+
a.onmessage = async (c) => {
|
|
195
|
+
if (!t) {
|
|
196
|
+
const w = await import(new URL(
|
|
208
197
|
`${g}/sbo-decode/wasm_sbo_decode.js`,
|
|
209
|
-
|
|
198
|
+
a.location.origin
|
|
210
199
|
).href);
|
|
211
|
-
await
|
|
200
|
+
await w.default(), s = w, t = !0;
|
|
212
201
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
202
|
+
o || (o = await caches.open("sangine-assets-v1"));
|
|
203
|
+
const { data: d } = c;
|
|
204
|
+
if ("texture-file" in d)
|
|
216
205
|
try {
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
219
|
-
throw new Error(`HTTP error! status: ${
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
206
|
+
const i = await n(d["texture-file"].pk, () => e(d));
|
|
207
|
+
if (!i.ok)
|
|
208
|
+
throw new Error(`HTTP error! status: ${i.status}`);
|
|
209
|
+
const w = await i.blob(), l = await createImageBitmap(w), h = new OffscreenCanvas(l.width, l.height), m = h.getContext("2d");
|
|
210
|
+
if (m === null)
|
|
222
211
|
throw new Error("Couldnt create canvas");
|
|
223
|
-
|
|
224
|
-
const u =
|
|
225
|
-
|
|
212
|
+
m.drawImage(l, 0, 0);
|
|
213
|
+
const u = m.getImageData(0, 0, h.width, h.height);
|
|
214
|
+
a.postMessage(
|
|
226
215
|
{
|
|
227
216
|
success: !0,
|
|
228
|
-
width:
|
|
229
|
-
height:
|
|
217
|
+
width: h.width,
|
|
218
|
+
height: h.height,
|
|
230
219
|
data: u.data.buffer
|
|
231
220
|
},
|
|
232
221
|
[u.data.buffer]
|
|
233
222
|
);
|
|
234
|
-
} catch (
|
|
235
|
-
|
|
223
|
+
} catch (i) {
|
|
224
|
+
a.postMessage({ success: !1, error: i.message });
|
|
236
225
|
}
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
240
|
-
throw new Error(`HTTP error! status: ${
|
|
241
|
-
const
|
|
242
|
-
|
|
226
|
+
else if ("model-part-mesh" in d) {
|
|
227
|
+
const i = await n(d["model-part-mesh"].pk, () => e(d));
|
|
228
|
+
if (!i.ok)
|
|
229
|
+
throw new Error(`HTTP error! status: ${i.status}`);
|
|
230
|
+
const w = await i.arrayBuffer(), l = new Uint8Array(w), h = s.decode_sbo(l);
|
|
231
|
+
a.postMessage(
|
|
243
232
|
{
|
|
244
233
|
success: !0,
|
|
245
|
-
data:
|
|
234
|
+
data: h.buffer
|
|
246
235
|
},
|
|
247
|
-
[
|
|
236
|
+
[h.buffer]
|
|
248
237
|
);
|
|
249
238
|
}
|
|
250
239
|
};
|
|
251
240
|
}
|
|
252
241
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
A as registerDecodeWorker
|
|
242
|
+
R as RendererService,
|
|
243
|
+
b as registerDecodeWorker
|
|
256
244
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CameraPos,
|
|
1
|
+
import type { CameraPos, DecodeTask, Measurement, RendererAssetQuality, RendererConfig, Route, SangineEvent, Scene, UserAction } from './types.js';
|
|
2
2
|
import type * as SangineModule from './wasm-types/sangine';
|
|
3
3
|
type ActionChangedCallback = (action: UserAction) => void;
|
|
4
4
|
type RouteUpdatedCallback = (route: Route) => void;
|
|
@@ -45,7 +45,7 @@ export declare class RendererService {
|
|
|
45
45
|
readCameraPos(windowId: number): CameraPos;
|
|
46
46
|
animateTo(windowId: number, position: CameraPos): void;
|
|
47
47
|
setScale(windowId: number, scale: number): void;
|
|
48
|
-
decodeAsset(
|
|
48
|
+
decodeAsset(task: DecodeTask): Promise<ArrayBuffer>;
|
|
49
49
|
destroy(): void;
|
|
50
50
|
}
|
|
51
51
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendererService.d.ts","sourceRoot":"","sources":["../src/rendererService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"rendererService.d.ts","sourceRoot":"","sources":["../src/rendererService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,KAAK,EACL,YAAY,EACZ,KAAK,EACL,UAAU,EACX,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAA;AAI1D,KAAK,qBA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Kind } from './wasm-types/sangine';
|
|
2
1
|
export * from './gen-types';
|
|
3
|
-
export { DecodeKind } from './wasm-types/sangine';
|
|
4
|
-
export interface DecodeTask {
|
|
5
|
-
kind: DecodeKind;
|
|
6
|
-
url: string;
|
|
7
|
-
}
|
|
8
2
|
export interface RendererConfig {
|
|
9
3
|
createDecodeWorker(): Worker;
|
|
10
4
|
numWorkers?: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,MAAM,WAAW,cAAc;IAC7B,kBAAkB,IAAI,MAAM,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Chroma subsampling format
|
|
6
|
+
*/
|
|
7
|
+
export enum ChromaSampling {
|
|
8
|
+
/**
|
|
9
|
+
* Both vertically and horizontally subsampled.
|
|
10
|
+
*/
|
|
11
|
+
Cs420 = 0,
|
|
12
|
+
/**
|
|
13
|
+
* Horizontally subsampled.
|
|
14
|
+
*/
|
|
15
|
+
Cs422 = 1,
|
|
16
|
+
/**
|
|
17
|
+
* Not subsampled.
|
|
18
|
+
*/
|
|
19
|
+
Cs444 = 2,
|
|
20
|
+
/**
|
|
21
|
+
* Monochrome.
|
|
22
|
+
*/
|
|
23
|
+
Cs400 = 3,
|
|
7
24
|
}
|
|
8
25
|
|
|
9
26
|
export function animate_to(window_id: number, camera_target: any): void;
|
|
@@ -45,28 +62,28 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
45
62
|
|
|
46
63
|
export interface InitOutput {
|
|
47
64
|
readonly memory: WebAssembly.Memory;
|
|
48
|
-
readonly animate_to: (a: number, b: any) => [number, number];
|
|
49
|
-
readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
50
|
-
readonly create_window: (a: number, b: number, c: any) => number;
|
|
51
|
-
readonly destroy_window: (a: number) => [number, number];
|
|
52
|
-
readonly read_camera_pos: (a: number) => [number, number, number];
|
|
53
|
-
readonly register_asset_decoder: (a: any) => void;
|
|
54
65
|
readonly register_event_listener: (a: any) => void;
|
|
66
|
+
readonly register_asset_decoder: (a: any) => void;
|
|
67
|
+
readonly set_render_quality: (a: number, b: any) => [number, number];
|
|
55
68
|
readonly set_gpu_memory_budget_mb: (a: number, b: number) => [number, number];
|
|
56
69
|
readonly set_north_correction: (a: number, b: number) => [number, number];
|
|
57
|
-
readonly set_render_quality: (a: number, b: any) => [number, number];
|
|
58
|
-
readonly set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
59
|
-
readonly set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
60
70
|
readonly set_sun_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
61
|
-
readonly set_window_action: (a: number, b: any) => [number, number];
|
|
62
71
|
readonly set_window_scale: (a: number, b: number) => [number, number];
|
|
72
|
+
readonly read_camera_pos: (a: number) => [number, number, number];
|
|
73
|
+
readonly animate_to: (a: number, b: any) => [number, number];
|
|
74
|
+
readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
75
|
+
readonly set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
76
|
+
readonly set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
77
|
+
readonly destroy_window: (a: number) => [number, number];
|
|
78
|
+
readonly set_window_action: (a: number, b: any) => [number, number];
|
|
79
|
+
readonly create_window: (a: number, b: number, c: any) => number;
|
|
63
80
|
readonly run: () => void;
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
67
|
-
readonly
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
81
|
+
readonly wasm_bindgen__closure__destroy__h17333457aae2b090: (a: number, b: number) => void;
|
|
82
|
+
readonly wasm_bindgen__closure__destroy__hf05ec8f078dda008: (a: number, b: number) => void;
|
|
83
|
+
readonly wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848: (a: number, b: number, c: any, d: any) => void;
|
|
84
|
+
readonly wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2: (a: number, b: number, c: any) => void;
|
|
85
|
+
readonly wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb: (a: number, b: number, c: any) => void;
|
|
86
|
+
readonly wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a: (a: number, b: number) => void;
|
|
70
87
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
71
88
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
72
89
|
readonly __externref_table_alloc: () => number;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
/* @ts-self-types="./sangine.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Chroma subsampling format
|
|
5
|
+
* @enum {0 | 1 | 2 | 3}
|
|
5
6
|
*/
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export const ChromaSampling = Object.freeze({
|
|
8
|
+
/**
|
|
9
|
+
* Both vertically and horizontally subsampled.
|
|
10
|
+
*/
|
|
11
|
+
Cs420: 0, "0": "Cs420",
|
|
12
|
+
/**
|
|
13
|
+
* Horizontally subsampled.
|
|
14
|
+
*/
|
|
15
|
+
Cs422: 1, "1": "Cs422",
|
|
16
|
+
/**
|
|
17
|
+
* Not subsampled.
|
|
18
|
+
*/
|
|
19
|
+
Cs444: 2, "2": "Cs444",
|
|
20
|
+
/**
|
|
21
|
+
* Monochrome.
|
|
22
|
+
*/
|
|
23
|
+
Cs400: 3, "3": "Cs400",
|
|
9
24
|
});
|
|
10
25
|
|
|
11
26
|
/**
|
|
@@ -194,10 +209,6 @@ function __wbg_get_imports() {
|
|
|
194
209
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
195
210
|
return ret;
|
|
196
211
|
},
|
|
197
|
-
__wbg_Number_04624de7d0e8332d: function(arg0) {
|
|
198
|
-
const ret = Number(arg0);
|
|
199
|
-
return ret;
|
|
200
|
-
},
|
|
201
212
|
__wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
|
|
202
213
|
const ret = String(arg1);
|
|
203
214
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -454,6 +465,10 @@ function __wbg_get_imports() {
|
|
|
454
465
|
const ret = arg0.call(arg1);
|
|
455
466
|
return ret;
|
|
456
467
|
}, arguments); },
|
|
468
|
+
__wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
|
|
469
|
+
const ret = arg0.call(arg1, arg2);
|
|
470
|
+
return ret;
|
|
471
|
+
}, arguments); },
|
|
457
472
|
__wbg_call_812d25f1510c13c8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
458
473
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
459
474
|
return ret;
|
|
@@ -1212,10 +1227,6 @@ function __wbg_get_imports() {
|
|
|
1212
1227
|
const ret = arg0.isIntersecting;
|
|
1213
1228
|
return ret;
|
|
1214
1229
|
},
|
|
1215
|
-
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
1216
|
-
const ret = Number.isSafeInteger(arg0);
|
|
1217
|
-
return ret;
|
|
1218
|
-
},
|
|
1219
1230
|
__wbg_is_f29129f676e5410c: function(arg0, arg1) {
|
|
1220
1231
|
const ret = Object.is(arg0, arg1);
|
|
1221
1232
|
return ret;
|
|
@@ -2607,53 +2618,53 @@ function __wbg_get_imports() {
|
|
|
2607
2618
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
2608
2619
|
}, arguments); },
|
|
2609
2620
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2610
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2611
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2621
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 3776, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2622
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848);
|
|
2612
2623
|
return ret;
|
|
2613
2624
|
},
|
|
2614
2625
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2615
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2616
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2626
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2627
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2617
2628
|
return ret;
|
|
2618
2629
|
},
|
|
2619
2630
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2620
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2621
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2631
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Event")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2632
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2622
2633
|
return ret;
|
|
2623
2634
|
},
|
|
2624
2635
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2625
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2626
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2636
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2637
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2627
2638
|
return ret;
|
|
2628
2639
|
},
|
|
2629
2640
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2630
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2631
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2641
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2642
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2632
2643
|
return ret;
|
|
2633
2644
|
},
|
|
2634
2645
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2635
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2636
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2646
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2647
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2637
2648
|
return ret;
|
|
2638
2649
|
},
|
|
2639
2650
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
2640
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2641
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2651
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2652
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2642
2653
|
return ret;
|
|
2643
2654
|
},
|
|
2644
2655
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2645
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2646
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2656
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2657
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2647
2658
|
return ret;
|
|
2648
2659
|
},
|
|
2649
2660
|
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
2650
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2651
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2661
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [], shim_idx: 3774, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2662
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a);
|
|
2652
2663
|
return ret;
|
|
2653
2664
|
},
|
|
2654
2665
|
__wbindgen_cast_000000000000000a: function(arg0, arg1) {
|
|
2655
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2656
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2666
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3827, function: Function { arguments: [Externref], shim_idx: 3828, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2667
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf05ec8f078dda008, wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb);
|
|
2657
2668
|
return ret;
|
|
2658
2669
|
},
|
|
2659
2670
|
__wbindgen_cast_000000000000000b: function(arg0) {
|
|
@@ -2717,20 +2728,20 @@ function __wbg_get_imports() {
|
|
|
2717
2728
|
};
|
|
2718
2729
|
}
|
|
2719
2730
|
|
|
2720
|
-
function
|
|
2721
|
-
wasm.
|
|
2731
|
+
function wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1) {
|
|
2732
|
+
wasm.wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1);
|
|
2722
2733
|
}
|
|
2723
2734
|
|
|
2724
|
-
function
|
|
2725
|
-
wasm.
|
|
2735
|
+
function wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2) {
|
|
2736
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2);
|
|
2726
2737
|
}
|
|
2727
2738
|
|
|
2728
|
-
function
|
|
2729
|
-
wasm.
|
|
2739
|
+
function wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2) {
|
|
2740
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2);
|
|
2730
2741
|
}
|
|
2731
2742
|
|
|
2732
|
-
function
|
|
2733
|
-
wasm.
|
|
2743
|
+
function wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848(arg0, arg1, arg2, arg3) {
|
|
2744
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848(arg0, arg1, arg2, arg3);
|
|
2734
2745
|
}
|
|
2735
2746
|
|
|
2736
2747
|
|
|
Binary file
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const animate_to: (a: number, b: any) => [number, number];
|
|
5
|
-
export const animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
6
|
-
export const create_window: (a: number, b: number, c: any) => number;
|
|
7
|
-
export const destroy_window: (a: number) => [number, number];
|
|
8
|
-
export const read_camera_pos: (a: number) => [number, number, number];
|
|
9
|
-
export const register_asset_decoder: (a: any) => void;
|
|
10
4
|
export const register_event_listener: (a: any) => void;
|
|
5
|
+
export const register_asset_decoder: (a: any) => void;
|
|
6
|
+
export const set_render_quality: (a: number, b: any) => [number, number];
|
|
11
7
|
export const set_gpu_memory_budget_mb: (a: number, b: number) => [number, number];
|
|
12
8
|
export const set_north_correction: (a: number, b: number) => [number, number];
|
|
13
|
-
export const set_render_quality: (a: number, b: any) => [number, number];
|
|
14
|
-
export const set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
|
-
export const set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
9
|
export const set_sun_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
17
|
-
export const set_window_action: (a: number, b: any) => [number, number];
|
|
18
10
|
export const set_window_scale: (a: number, b: number) => [number, number];
|
|
11
|
+
export const read_camera_pos: (a: number) => [number, number, number];
|
|
12
|
+
export const animate_to: (a: number, b: any) => [number, number];
|
|
13
|
+
export const animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
14
|
+
export const set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
|
+
export const set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
|
+
export const destroy_window: (a: number) => [number, number];
|
|
17
|
+
export const set_window_action: (a: number, b: any) => [number, number];
|
|
18
|
+
export const create_window: (a: number, b: number, c: any) => number;
|
|
19
19
|
export const run: () => void;
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
20
|
+
export const wasm_bindgen__closure__destroy__h17333457aae2b090: (a: number, b: number) => void;
|
|
21
|
+
export const wasm_bindgen__closure__destroy__hf05ec8f078dda008: (a: number, b: number) => void;
|
|
22
|
+
export const wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848: (a: number, b: number, c: any, d: any) => void;
|
|
23
|
+
export const wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2: (a: number, b: number, c: any) => void;
|
|
24
|
+
export const wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb: (a: number, b: number, c: any) => void;
|
|
25
|
+
export const wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a: (a: number, b: number) => void;
|
|
26
26
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __externref_table_alloc: () => number;
|
|
Binary file
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type DecodeTask } from '../types';
|
|
2
|
+
type UrlResolver = (task: DecodeTask) => Promise<string>;
|
|
3
|
+
export declare function registerDecodeWorker(self: DedicatedWorkerGlobalScope, urlResolver: UrlResolver): void;
|
|
4
|
+
export {};
|
|
2
5
|
//# sourceMappingURL=decodeWorkerImpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,WAAW,QA2F9F"}
|