@sanox/sangine-core 0.2.4 → 0.2.6
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 +4 -0
- package/dist/gen-types.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +58 -45
- package/dist/rendererService.d.ts +5 -0
- package/dist/rendererService.d.ts.map +1 -1
- package/dist/wasm/sangine/{sangine.52e59288.js → sangine.2f6d6a9d.js} +52 -29
- package/dist/wasm/sangine/sangine.d.ts +38 -16
- package/dist/wasm/sangine/{sangine_bg.52e59288.wasm → sangine_bg.2f6d6a9d.wasm} +0 -0
- package/dist/wasm/sangine/sangine_bg.wasm.d.ts +16 -16
- package/dist/wasm/sbo-decode/{wasm_sbo_decode.95e75786.js → wasm_sbo_decode.fa5ceba1.js} +1 -1
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.fa5ceba1.wasm +0 -0
- package/dist/wasm-hashes/sangine.d.ts +1 -1
- package/dist/wasm-hashes/sbo-decode.d.ts +1 -1
- package/dist/worker/decodeWorkerImpl.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.95e75786.wasm +0 -0
package/dist/gen-types.d.ts
CHANGED
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,UAAU,GAClB;IACE,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,GACD;IACE,iBAAiB,EAAE;QACjB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AACN;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS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ACH,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;CAClB;AACD;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var y=(
|
|
1
|
+
"use strict";var f=Object.defineProperty;var y=(n,e,t)=>e in n?f(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>y(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g="/static/sangine/wasm",_="2f6d6a9d";class R{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 a=this.idle.pop();a?this.dispatch(a,e,t,s):this.queue.push({request:e,resolve:t,reject:s})})}dispatch(e,t,s,a){const d=i=>{s(i.data),o(),this.release(e)},c=i=>{a(i),o(),this.release(e)},o=()=>{e.removeEventListener("message",d),e.removeEventListener("error",c)};e.addEventListener("message",d,{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,"assetsDownloadingRegistry",{});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 R(()=>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)}handleAssetsDownloading(e,t){this.assetsDownloadingRegistry[e]=t;for(const s of this.callbackRegistry[e].assetsDownloading)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):"assetsDownloading"in t&&this.handleAssetsDownloading(e,t.assetsDownloading.downloading)}createWindow(e,t){if(!this.wasm)throw new Error("WASM not initialized");let s;const a=new Promise(c=>{s=c}),d=this.wasm.create_window(e,t);return this.windowCreatedPromiseResolveRegistry[d]=s,this.callbackRegistry[d]={actionChanged:[],routeUpdated:[],measurementCreated:[],assetsDownloading:[]},this.userActionRegistry[d]="watching",this.windowCreatedPromiseRegistry[d]=a,d}getAssetsDownloading(e){return this.assetsDownloadingRegistry[e]||!1}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,a,d,c,o){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_sun_properties(e,t,s,a,d,c,o)}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()}}const b="fa5ceba1";function A(n,e){let t=!1,s=null,a=null;async function d(c,o){if(a){const i=`https://sangine-asset-cache/${c}`,w=await a.match(i);if(w)return w;const l=await o(),h=await fetch(l);return h.ok&&await a.put(i,h.clone()),h}return fetch(await o())}n.onmessage=async c=>{if(!t){const w=await import(new URL(`${g}/sbo-decode/wasm_sbo_decode.${b}.js`,n.location.origin).href);await w.default(),s=w,t=!0}!a&&typeof caches<"u"&&(a=await caches.open("sangine-assets-v1"));const{data:o}=c;if("texture-file"in o)try{const i=await d(o["texture-file"].pk,()=>e(o));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);n.postMessage({success:!0,width:h.width,height:h.height,data:u.data.buffer},[u.data.buffer])}catch(i){n.postMessage({success:!1,error:i.message})}else if("model-part-mesh"in o){const i=await d(o["model-part-mesh"].pk,()=>e(o));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);n.postMessage({success:!0,data:h.buffer},[h.buffer])}}}exports.RendererService=p;exports.registerDecodeWorker=A;
|
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var y = (
|
|
3
|
-
var r = (
|
|
4
|
-
const g = "/static/sangine/wasm", _ = "
|
|
5
|
-
class
|
|
2
|
+
var y = (n, e, t) => e in n ? f(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var r = (n, e, t) => y(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const g = "/static/sangine/wasm", _ = "2f6d6a9d";
|
|
5
|
+
class R {
|
|
6
6
|
constructor(e, t) {
|
|
7
7
|
r(this, "workers");
|
|
8
8
|
r(this, "idle");
|
|
@@ -11,19 +11,19 @@ class p {
|
|
|
11
11
|
}
|
|
12
12
|
run(e) {
|
|
13
13
|
return new Promise((t, s) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const a = this.idle.pop();
|
|
15
|
+
a ? this.dispatch(a, e, t, s) : this.queue.push({ request: e, resolve: t, reject: s });
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
dispatch(e, t, s,
|
|
19
|
-
const
|
|
20
|
-
s(i.data),
|
|
18
|
+
dispatch(e, t, s, a) {
|
|
19
|
+
const d = (i) => {
|
|
20
|
+
s(i.data), o(), this.release(e);
|
|
21
21
|
}, c = (i) => {
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
e.removeEventListener("message",
|
|
22
|
+
a(i), o(), this.release(e);
|
|
23
|
+
}, o = () => {
|
|
24
|
+
e.removeEventListener("message", d), e.removeEventListener("error", c);
|
|
25
25
|
};
|
|
26
|
-
e.addEventListener("message",
|
|
26
|
+
e.addEventListener("message", d, { once: !0 }), e.addEventListener("error", c, { once: !0 }), e.postMessage(t);
|
|
27
27
|
}
|
|
28
28
|
release(e) {
|
|
29
29
|
const t = this.queue.shift();
|
|
@@ -39,6 +39,7 @@ class b {
|
|
|
39
39
|
r(this, "wasm", null);
|
|
40
40
|
r(this, "callbackRegistry", {});
|
|
41
41
|
r(this, "userActionRegistry", {});
|
|
42
|
+
r(this, "assetsDownloadingRegistry", {});
|
|
42
43
|
r(this, "windowCreatedPromiseRegistry", {});
|
|
43
44
|
r(this, "windowCreatedPromiseResolveRegistry", {});
|
|
44
45
|
r(this, "_inited", !1);
|
|
@@ -60,7 +61,7 @@ class b {
|
|
|
60
61
|
).toString());
|
|
61
62
|
await t.default(), this.wasm = t, this._inited = !0;
|
|
62
63
|
const s = this.config.numWorkers ?? (navigator.hardwareConcurrency || 2) - 1;
|
|
63
|
-
this.decodePool = new
|
|
64
|
+
this.decodePool = new R(
|
|
64
65
|
() => this.config.createDecodeWorker(),
|
|
65
66
|
Math.max(s, 1)
|
|
66
67
|
), this.wasm.register_asset_decoder(this.decodeAsset.bind(this)), this.wasm.register_event_listener(this.handleSangineEvent.bind(this)), this._resolveReady();
|
|
@@ -94,20 +95,29 @@ class b {
|
|
|
94
95
|
for (const s of this.callbackRegistry[e].routeUpdated)
|
|
95
96
|
s(t);
|
|
96
97
|
}
|
|
98
|
+
handleAssetsDownloading(e, t) {
|
|
99
|
+
this.assetsDownloadingRegistry[e] = t;
|
|
100
|
+
for (const s of this.callbackRegistry[e].assetsDownloading)
|
|
101
|
+
s(t);
|
|
102
|
+
}
|
|
97
103
|
handleSangineEvent(e, t) {
|
|
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
|
|
104
|
+
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) : "assetsDownloading" in t && this.handleAssetsDownloading(e, t.assetsDownloading.downloading);
|
|
99
105
|
}
|
|
100
106
|
createWindow(e, t) {
|
|
101
107
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
102
108
|
let s;
|
|
103
|
-
const
|
|
109
|
+
const a = new Promise((c) => {
|
|
104
110
|
s = c;
|
|
105
|
-
}),
|
|
106
|
-
return this.windowCreatedPromiseResolveRegistry[
|
|
111
|
+
}), d = this.wasm.create_window(e, t);
|
|
112
|
+
return this.windowCreatedPromiseResolveRegistry[d] = s, this.callbackRegistry[d] = {
|
|
107
113
|
actionChanged: [],
|
|
108
114
|
routeUpdated: [],
|
|
109
|
-
measurementCreated: []
|
|
110
|
-
|
|
115
|
+
measurementCreated: [],
|
|
116
|
+
assetsDownloading: []
|
|
117
|
+
}, this.userActionRegistry[d] = "watching", this.windowCreatedPromiseRegistry[d] = a, d;
|
|
118
|
+
}
|
|
119
|
+
getAssetsDownloading(e) {
|
|
120
|
+
return this.assetsDownloadingRegistry[e] || !1;
|
|
111
121
|
}
|
|
112
122
|
readUserAction(e) {
|
|
113
123
|
return this.userActionRegistry[e];
|
|
@@ -138,16 +148,16 @@ class b {
|
|
|
138
148
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
139
149
|
this.wasm.animate_to_route(e, t);
|
|
140
150
|
}
|
|
141
|
-
setSunProperties(e, t, s,
|
|
151
|
+
setSunProperties(e, t, s, a, d, c, o) {
|
|
142
152
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
143
153
|
this.wasm.set_sun_properties(
|
|
144
154
|
e,
|
|
145
155
|
t,
|
|
146
156
|
s,
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
a,
|
|
158
|
+
d,
|
|
149
159
|
c,
|
|
150
|
-
|
|
160
|
+
o
|
|
151
161
|
);
|
|
152
162
|
}
|
|
153
163
|
setNorthCorrection(e, t) {
|
|
@@ -183,28 +193,31 @@ class b {
|
|
|
183
193
|
(e = this.decodePool) == null || e.terminate();
|
|
184
194
|
}
|
|
185
195
|
}
|
|
186
|
-
const
|
|
187
|
-
function E(
|
|
188
|
-
let t = !1, s = null,
|
|
189
|
-
async function
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
const p = "fa5ceba1";
|
|
197
|
+
function E(n, e) {
|
|
198
|
+
let t = !1, s = null, a = null;
|
|
199
|
+
async function d(c, o) {
|
|
200
|
+
if (a) {
|
|
201
|
+
const i = `https://sangine-asset-cache/${c}`, w = await a.match(i);
|
|
202
|
+
if (w) return w;
|
|
203
|
+
const l = await o(), h = await fetch(l);
|
|
204
|
+
return h.ok && await a.put(i, h.clone()), h;
|
|
205
|
+
}
|
|
206
|
+
return fetch(await o());
|
|
207
|
+
}
|
|
208
|
+
n.onmessage = async (c) => {
|
|
196
209
|
if (!t) {
|
|
197
210
|
const w = await import(new URL(
|
|
198
|
-
`${g}/sbo-decode/wasm_sbo_decode.${
|
|
199
|
-
|
|
211
|
+
`${g}/sbo-decode/wasm_sbo_decode.${p}.js`,
|
|
212
|
+
n.location.origin
|
|
200
213
|
).href);
|
|
201
214
|
await w.default(), s = w, t = !0;
|
|
202
215
|
}
|
|
203
|
-
|
|
204
|
-
const { data:
|
|
205
|
-
if ("texture-file" in
|
|
216
|
+
!a && typeof caches < "u" && (a = await caches.open("sangine-assets-v1"));
|
|
217
|
+
const { data: o } = c;
|
|
218
|
+
if ("texture-file" in o)
|
|
206
219
|
try {
|
|
207
|
-
const i = await
|
|
220
|
+
const i = await d(o["texture-file"].pk, () => e(o));
|
|
208
221
|
if (!i.ok)
|
|
209
222
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
210
223
|
const w = await i.blob(), l = await createImageBitmap(w), h = new OffscreenCanvas(l.width, l.height), m = h.getContext("2d");
|
|
@@ -212,7 +225,7 @@ function E(a, e) {
|
|
|
212
225
|
throw new Error("Couldnt create canvas");
|
|
213
226
|
m.drawImage(l, 0, 0);
|
|
214
227
|
const u = m.getImageData(0, 0, h.width, h.height);
|
|
215
|
-
|
|
228
|
+
n.postMessage(
|
|
216
229
|
{
|
|
217
230
|
success: !0,
|
|
218
231
|
width: h.width,
|
|
@@ -222,14 +235,14 @@ function E(a, e) {
|
|
|
222
235
|
[u.data.buffer]
|
|
223
236
|
);
|
|
224
237
|
} catch (i) {
|
|
225
|
-
|
|
238
|
+
n.postMessage({ success: !1, error: i.message });
|
|
226
239
|
}
|
|
227
|
-
else if ("model-part-mesh" in
|
|
228
|
-
const i = await
|
|
240
|
+
else if ("model-part-mesh" in o) {
|
|
241
|
+
const i = await d(o["model-part-mesh"].pk, () => e(o));
|
|
229
242
|
if (!i.ok)
|
|
230
243
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
231
244
|
const w = await i.arrayBuffer(), l = new Uint8Array(w), h = s.decode_sbo(l);
|
|
232
|
-
|
|
245
|
+
n.postMessage(
|
|
233
246
|
{
|
|
234
247
|
success: !0,
|
|
235
248
|
data: h.buffer
|
|
@@ -3,16 +3,19 @@ import type * as SangineModule from './wasm-types/sangine';
|
|
|
3
3
|
type ActionChangedCallback = (action: UserAction) => void;
|
|
4
4
|
type RouteUpdatedCallback = (route: Route) => void;
|
|
5
5
|
type MeasurementCreatedCallback = (measurement: Measurement) => void;
|
|
6
|
+
type AssetsDownloadingCallback = (downloading: boolean) => void;
|
|
6
7
|
interface CallbackMap {
|
|
7
8
|
actionChanged: ActionChangedCallback;
|
|
8
9
|
routeUpdated: RouteUpdatedCallback;
|
|
9
10
|
measurementCreated: MeasurementCreatedCallback;
|
|
11
|
+
assetsDownloading: AssetsDownloadingCallback;
|
|
10
12
|
}
|
|
11
13
|
export declare class RendererService {
|
|
12
14
|
private config;
|
|
13
15
|
private wasm;
|
|
14
16
|
private callbackRegistry;
|
|
15
17
|
private userActionRegistry;
|
|
18
|
+
private assetsDownloadingRegistry;
|
|
16
19
|
private windowCreatedPromiseRegistry;
|
|
17
20
|
private windowCreatedPromiseResolveRegistry;
|
|
18
21
|
private _inited;
|
|
@@ -28,8 +31,10 @@ export declare class RendererService {
|
|
|
28
31
|
handleActionChanged(windowId: number, action: UserAction): void;
|
|
29
32
|
handleMeasurementCreated(windowId: number, measurement: Measurement): void;
|
|
30
33
|
handleRouteUpdated(windowId: number, route: Route): void;
|
|
34
|
+
handleAssetsDownloading(windowId: number, downloading: boolean): void;
|
|
31
35
|
handleSangineEvent(windowId: number, event: SangineEvent): void;
|
|
32
36
|
createWindow(containerId: string, scene: Scene): number;
|
|
37
|
+
getAssetsDownloading(containerId: number): boolean;
|
|
33
38
|
readUserAction(windowId: number): UserAction;
|
|
34
39
|
windowReady(windowId: number): Promise<void>;
|
|
35
40
|
registerCallback<K extends keyof CallbackMap>(windowId: number, event: K, callback: CallbackMap[K]): void;
|
|
@@ -1 +1 @@
|
|
|
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;AAEnB,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAA;AAI1D,KAAK,qBAAqB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;AACzD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAClD,KAAK,0BAA0B,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;
|
|
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;AAEnB,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAA;AAI1D,KAAK,qBAAqB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;AACzD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAClD,KAAK,0BAA0B,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;AACpE,KAAK,yBAAyB,GAAG,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;AAE/D,UAAU,WAAW;IACnB,aAAa,EAAE,qBAAqB,CAAA;IACpC,YAAY,EAAE,oBAAoB,CAAA;IAClC,kBAAkB,EAAE,0BAA0B,CAAA;IAC9C,iBAAiB,EAAE,yBAAyB,CAAA;CAC7C;AAMD,qBAAa,eAAe;IAcd,OAAO,CAAC,MAAM;IAb1B,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,gBAAgB,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AAE,MAAM;IAO9B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAKtE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAKlE,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAKhD,gBAAgB,CACd,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM;IAcnB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;IAK5D,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAKvD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAKhE,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAK1C,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS;IAK/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKlC,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAKzD,OAAO;CAGR"}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
/* @ts-self-types="./sangine.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Chroma subsampling format
|
|
5
|
+
* @enum {0 | 1 | 2 | 3}
|
|
6
|
+
*/
|
|
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",
|
|
24
|
+
});
|
|
25
|
+
|
|
3
26
|
/**
|
|
4
27
|
* @param {number} window_id
|
|
5
28
|
* @param {any} camera_target
|
|
@@ -2595,53 +2618,53 @@ function __wbg_get_imports() {
|
|
|
2595
2618
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
2596
2619
|
}, arguments); },
|
|
2597
2620
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2598
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2599
|
-
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);
|
|
2600
2623
|
return ret;
|
|
2601
2624
|
},
|
|
2602
2625
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2603
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2604
|
-
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);
|
|
2605
2628
|
return ret;
|
|
2606
2629
|
},
|
|
2607
2630
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2608
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2609
|
-
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);
|
|
2610
2633
|
return ret;
|
|
2611
2634
|
},
|
|
2612
2635
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2613
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2614
|
-
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);
|
|
2615
2638
|
return ret;
|
|
2616
2639
|
},
|
|
2617
2640
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2618
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2619
|
-
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);
|
|
2620
2643
|
return ret;
|
|
2621
2644
|
},
|
|
2622
2645
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2623
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2624
|
-
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);
|
|
2625
2648
|
return ret;
|
|
2626
2649
|
},
|
|
2627
2650
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
2628
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2629
|
-
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);
|
|
2630
2653
|
return ret;
|
|
2631
2654
|
},
|
|
2632
2655
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2633
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2634
|
-
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);
|
|
2635
2658
|
return ret;
|
|
2636
2659
|
},
|
|
2637
2660
|
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
2638
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2639
|
-
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);
|
|
2640
2663
|
return ret;
|
|
2641
2664
|
},
|
|
2642
2665
|
__wbindgen_cast_000000000000000a: function(arg0, arg1) {
|
|
2643
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2644
|
-
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);
|
|
2645
2668
|
return ret;
|
|
2646
2669
|
},
|
|
2647
2670
|
__wbindgen_cast_000000000000000b: function(arg0) {
|
|
@@ -2705,20 +2728,20 @@ function __wbg_get_imports() {
|
|
|
2705
2728
|
};
|
|
2706
2729
|
}
|
|
2707
2730
|
|
|
2708
|
-
function
|
|
2709
|
-
wasm.
|
|
2731
|
+
function wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1) {
|
|
2732
|
+
wasm.wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1);
|
|
2710
2733
|
}
|
|
2711
2734
|
|
|
2712
|
-
function
|
|
2713
|
-
wasm.
|
|
2735
|
+
function wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2) {
|
|
2736
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2);
|
|
2714
2737
|
}
|
|
2715
2738
|
|
|
2716
|
-
function
|
|
2717
|
-
wasm.
|
|
2739
|
+
function wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2) {
|
|
2740
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2);
|
|
2718
2741
|
}
|
|
2719
2742
|
|
|
2720
|
-
function
|
|
2721
|
-
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);
|
|
2722
2745
|
}
|
|
2723
2746
|
|
|
2724
2747
|
|
|
@@ -3178,7 +3201,7 @@ async function __wbg_init(module_or_path) {
|
|
|
3178
3201
|
}
|
|
3179
3202
|
|
|
3180
3203
|
if (module_or_path === undefined) {
|
|
3181
|
-
module_or_path = new URL('sangine_bg.
|
|
3204
|
+
module_or_path = new URL('sangine_bg.2f6d6a9d.wasm', import.meta.url);
|
|
3182
3205
|
}
|
|
3183
3206
|
const imports = __wbg_get_imports();
|
|
3184
3207
|
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
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,
|
|
24
|
+
}
|
|
25
|
+
|
|
4
26
|
export function animate_to(window_id: number, camera_target: any): void;
|
|
5
27
|
|
|
6
28
|
export function animate_to_route(window_id: number, route_id: string): void;
|
|
@@ -40,28 +62,28 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
40
62
|
|
|
41
63
|
export interface InitOutput {
|
|
42
64
|
readonly memory: WebAssembly.Memory;
|
|
43
|
-
readonly animate_to: (a: number, b: any) => [number, number];
|
|
44
|
-
readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
45
|
-
readonly create_window: (a: number, b: number, c: any) => number;
|
|
46
|
-
readonly destroy_window: (a: number) => [number, number];
|
|
47
|
-
readonly read_camera_pos: (a: number) => [number, number, number];
|
|
48
|
-
readonly register_asset_decoder: (a: any) => void;
|
|
49
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];
|
|
50
68
|
readonly set_gpu_memory_budget_mb: (a: number, b: number) => [number, number];
|
|
51
69
|
readonly set_north_correction: (a: number, b: number) => [number, number];
|
|
52
|
-
readonly set_render_quality: (a: number, b: any) => [number, number];
|
|
53
|
-
readonly set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
54
|
-
readonly set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
55
70
|
readonly set_sun_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
56
|
-
readonly set_window_action: (a: number, b: any) => [number, number];
|
|
57
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;
|
|
58
80
|
readonly run: () => void;
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
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;
|
|
65
87
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
66
88
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
67
89
|
readonly __externref_table_alloc: () => number;
|
|
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;
|
|
@@ -169,7 +169,7 @@ async function __wbg_init(module_or_path) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
if (module_or_path === undefined) {
|
|
172
|
-
module_or_path = new URL('wasm_sbo_decode_bg.
|
|
172
|
+
module_or_path = new URL('wasm_sbo_decode_bg.fa5ceba1.wasm', import.meta.url);
|
|
173
173
|
}
|
|
174
174
|
const imports = __wbg_get_imports();
|
|
175
175
|
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SANGINE_HASH = "
|
|
1
|
+
export declare const SANGINE_HASH = "2f6d6a9d";
|
|
2
2
|
//# sourceMappingURL=sangine.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SBO_DECODE_HASH = "
|
|
1
|
+
export declare const SBO_DECODE_HASH = "fa5ceba1";
|
|
2
2
|
//# sourceMappingURL=sbo-decode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAK1C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAK1C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,WAAW,QA8F9F"}
|
package/package.json
CHANGED
|
Binary file
|