@sanox/sangine-core 0.4.0 → 0.4.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.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var E=(i,e,t)=>e in i?M(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var r=(i,e,t)=>E(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p="/static/sangine/wasm",W="c27a2565";class C{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 d=this.idle.pop();d?this.dispatch(d,e,t,s):this.queue.push({request:e,resolve:t,reject:s})})}dispatch(e,t,s,d){const c=g=>{s(g.data),m(),this.release(e)},o=g=>{d(g),m(),this.release(e)},m=()=>{e.removeEventListener("message",c),e.removeEventListener("error",o)};e.addEventListener("message",c,{once:!0}),e.addEventListener("error",o,{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)}broadcast(e){for(const t of this.workers)t.postMessage(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(`${p}/sangine/sangine.${W}.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 C(()=>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)}handleUserInteractionStarted(e){for(const t of this.callbackRegistry[e].userInteractionStarted)t()}handleSangineEvent(e,t){t==="ready"?this.windowCreatedPromiseResolveRegistry[e]():t==="userInteractionStarted"?this.handleUserInteractionStarted(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,s){if(!this.wasm)throw new Error("WASM not initialized");let d;const c=new Promise(m=>{d=m}),o=this.wasm.create_window(e,t,s);return this.windowCreatedPromiseResolveRegistry[o]=d,this.callbackRegistry[o]={actionChanged:[],routeUpdated:[],measurementCreated:[],assetsDownloading:[],userInteractionStarted:[]},this.userActionRegistry[o]="watching",this.windowCreatedPromiseRegistry[o]=c,o}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){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_sun_properties(e,t)}setAmbientLighting(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_ambient_lighting(e,t)}setLightingMode(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_lighting_mode(e,t)}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 k="a8b7eebd",U="5c359661",D=0;function v(i){let e=!1,t=null,s=null,d=!1,c=null;async function o(f,a){if(c){const w=`https://sangine-asset-cache/${f}`,u=await c.match(w);if(u)return u;const l=await fetch(a);return l.ok&&await c.put(w,l.clone()),l}return fetch(a)}async function m(){if(e)return;const a=await import(new URL(`${p}/sbo-decode/wasm_sbo_decode.${U}.js`,i.location.origin).href);await a.default(),t=a,e=!0}async function g(){if(d)return;const a=await import(new URL(`${p}/basis-decode/wasm_basis_decode.${k}.js`,i.location.origin).href);await a.default(),await a.init_basis(),s=a,d=!0}i.onmessage=async f=>{const{data:a}=f;if(!c&&typeof caches<"u"&&(c=await caches.open("sangine-assets-v1")),"texture-file"in a)try{const{pk:w,url:u,format:l,encoding:_}=a["texture-file"];if(_==="ktx2"){await g();const h=await o(w,u);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const b=await h.arrayBuffer(),y=new Uint8Array(b),n=s.transcode_basis(y,l);i.postMessage({success:!0,width:n.width,height:n.height,data:n.data.buffer,format:n.format},[n.data.buffer])}else{const h=await o(w,u);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const b=await h.blob(),y=await createImageBitmap(b),n=new OffscreenCanvas(y.width,y.height),R=n.getContext("2d");if(R===null)throw new Error("Couldnt create canvas");R.drawImage(y,0,0);const S=R.getImageData(0,0,n.width,n.height);i.postMessage({success:!0,width:n.width,height:n.height,data:S.data.buffer,format:D},[S.data.buffer])}}catch(w){i.postMessage({success:!1,error:w.message})}else if("model-part-mesh"in a){await m();const{pk:w,url:u}=a["model-part-mesh"],l=await o(w,u);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const _=await l.arrayBuffer(),A=new Uint8Array(_),h=t.decode_sbo(A);i.postMessage({success:!0,data:h.buffer},[h.buffer])}}}exports.RendererService=P;exports.registerDecodeWorker=v;
1
+ "use strict";var M=Object.defineProperty;var E=(i,e,t)=>e in i?M(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var r=(i,e,t)=>E(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p="/static/sangine/wasm",W="31a02d84";class C{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 d=this.idle.pop();d?this.dispatch(d,e,t,s):this.queue.push({request:e,resolve:t,reject:s})})}dispatch(e,t,s,d){const c=g=>{s(g.data),m(),this.release(e)},o=g=>{d(g),m(),this.release(e)},m=()=>{e.removeEventListener("message",c),e.removeEventListener("error",o)};e.addEventListener("message",c,{once:!0}),e.addEventListener("error",o,{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)}broadcast(e){for(const t of this.workers)t.postMessage(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(`${p}/sangine/sangine.${W}.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 C(()=>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)}handleUserInteractionStarted(e){for(const t of this.callbackRegistry[e].userInteractionStarted)t()}handleSangineEvent(e,t){t==="ready"?this.windowCreatedPromiseResolveRegistry[e]():t==="userInteractionStarted"?this.handleUserInteractionStarted(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,s){if(!this.wasm)throw new Error("WASM not initialized");let d;const c=new Promise(m=>{d=m}),o=this.wasm.create_window(e,t,s);return this.windowCreatedPromiseResolveRegistry[o]=d,this.callbackRegistry[o]={actionChanged:[],routeUpdated:[],measurementCreated:[],assetsDownloading:[],userInteractionStarted:[]},this.userActionRegistry[o]="watching",this.windowCreatedPromiseRegistry[o]=c,o}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){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_sun_properties(e,t)}setAmbientLighting(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_ambient_lighting(e,t)}setLightingMode(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_lighting_mode(e,t)}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 k="a8b7eebd",U="5c359661",D=0;function v(i){let e=!1,t=null,s=null,d=!1,c=null;async function o(f,a){if(c){const w=`https://sangine-asset-cache/${f}`,u=await c.match(w);if(u)return u;const l=await fetch(a);return l.ok&&await c.put(w,l.clone()),l}return fetch(a)}async function m(){if(e)return;const a=await import(new URL(`${p}/sbo-decode/wasm_sbo_decode.${U}.js`,i.location.origin).href);await a.default(),t=a,e=!0}async function g(){if(d)return;const a=await import(new URL(`${p}/basis-decode/wasm_basis_decode.${k}.js`,i.location.origin).href);await a.default(),await a.init_basis(),s=a,d=!0}i.onmessage=async f=>{const{data:a}=f;if(!c&&typeof caches<"u"&&(c=await caches.open("sangine-assets-v1")),"texture-file"in a)try{const{pk:w,url:u,format:l,encoding:_}=a["texture-file"];if(_==="ktx2"){await g();const h=await o(w,u);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const b=await h.arrayBuffer(),y=new Uint8Array(b),n=s.transcode_basis(y,l);i.postMessage({success:!0,width:n.width,height:n.height,data:n.data.buffer,format:n.format},[n.data.buffer])}else{const h=await o(w,u);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const b=await h.blob(),y=await createImageBitmap(b),n=new OffscreenCanvas(y.width,y.height),R=n.getContext("2d");if(R===null)throw new Error("Couldnt create canvas");R.drawImage(y,0,0);const S=R.getImageData(0,0,n.width,n.height);i.postMessage({success:!0,width:n.width,height:n.height,data:S.data.buffer,format:D},[S.data.buffer])}}catch(w){i.postMessage({success:!1,error:w.message})}else if("model-part-mesh"in a){await m();const{pk:w,url:u}=a["model-part-mesh"],l=await o(w,u);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const _=await l.arrayBuffer(),A=new Uint8Array(_),h=t.decode_sbo(A);i.postMessage({success:!0,data:h.buffer},[h.buffer])}}}exports.RendererService=P;exports.registerDecodeWorker=v;
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var E = Object.defineProperty;
2
2
  var M = (i, e, t) => e in i ? E(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var r = (i, e, t) => M(i, typeof e != "symbol" ? e + "" : e, t);
4
- const p = "/static/sangine/wasm", C = "c27a2565";
4
+ const p = "/static/sangine/wasm", C = "31a02d84";
5
5
  class W {
6
6
  constructor(e, t) {
7
7
  r(this, "workers");
@@ -2705,57 +2705,57 @@ function __wbg_get_imports() {
2705
2705
  arg0.writeTexture(arg1, arg2, arg3, arg4);
2706
2706
  }, arguments); },
2707
2707
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2708
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2708
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2709
2709
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b);
2710
2710
  return ret;
2711
2711
  },
2712
2712
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2713
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3922, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2713
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3925, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2714
2714
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd8590da73942d3e0);
2715
2715
  return ret;
2716
2716
  },
2717
2717
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2718
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 3845, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2718
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 3848, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2719
2719
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6ff3e7511bd758a3);
2720
2720
  return ret;
2721
2721
  },
2722
2722
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
2723
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2723
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2724
2724
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_3);
2725
2725
  return ret;
2726
2726
  },
2727
2727
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
2728
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2728
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2729
2729
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_4);
2730
2730
  return ret;
2731
2731
  },
2732
2732
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
2733
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2733
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2734
2734
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_5);
2735
2735
  return ret;
2736
2736
  },
2737
2737
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
2738
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2738
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2739
2739
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_6);
2740
2740
  return ret;
2741
2741
  },
2742
2742
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
2743
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2743
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2744
2744
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_7);
2745
2745
  return ret;
2746
2746
  },
2747
2747
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
2748
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2748
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2749
2749
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_8);
2750
2750
  return ret;
2751
2751
  },
2752
2752
  __wbindgen_cast_000000000000000a: function(arg0, arg1) {
2753
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 3838, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2753
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 3841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2754
2754
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h00cde4323839146b_9);
2755
2755
  return ret;
2756
2756
  },
2757
2757
  __wbindgen_cast_000000000000000b: function(arg0, arg1) {
2758
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3843, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2758
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3846, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2759
2759
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hdb7f99c0126c5c28);
2760
2760
  return ret;
2761
2761
  },
@@ -3324,7 +3324,7 @@ async function __wbg_init(module_or_path) {
3324
3324
  }
3325
3325
 
3326
3326
  if (module_or_path === undefined) {
3327
- module_or_path = new URL('sangine_bg.c27a2565.wasm', import.meta.url);
3327
+ module_or_path = new URL('sangine_bg.31a02d84.wasm', import.meta.url);
3328
3328
  }
3329
3329
  const imports = __wbg_get_imports();
3330
3330
 
@@ -44,6 +44,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
44
44
 
45
45
  export interface InitOutput {
46
46
  readonly memory: WebAssembly.Memory;
47
+ readonly run: () => void;
47
48
  readonly animate_to: (a: number, b: any) => [number, number];
48
49
  readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
49
50
  readonly create_window: (a: number, b: number, c: any, d: number) => [number, number, number];
@@ -61,7 +62,6 @@ export interface InitOutput {
61
62
  readonly set_sun_properties: (a: number, b: any) => [number, number];
62
63
  readonly set_window_action: (a: number, b: any) => [number, number];
63
64
  readonly set_window_scale: (a: number, b: number) => [number, number];
64
- readonly run: () => void;
65
65
  readonly wasm_bindgen__convert__closures_____invoke__hd8590da73942d3e0: (a: number, b: number, c: any) => [number, number];
66
66
  readonly wasm_bindgen__convert__closures_____invoke__h6ff3e7511bd758a3: (a: number, b: number, c: any, d: any) => void;
67
67
  readonly wasm_bindgen__convert__closures_____invoke__h00cde4323839146b: (a: number, b: number, c: any) => void;
@@ -1,6 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const run: () => void;
4
5
  export const animate_to: (a: number, b: any) => [number, number];
5
6
  export const animate_to_route: (a: number, b: number, c: number) => [number, number];
6
7
  export const create_window: (a: number, b: number, c: any, d: number) => [number, number, number];
@@ -18,7 +19,6 @@ export const set_route_visible: (a: number, b: number, c: number, d: number) =>
18
19
  export const set_sun_properties: (a: number, b: any) => [number, number];
19
20
  export const set_window_action: (a: number, b: any) => [number, number];
20
21
  export const set_window_scale: (a: number, b: number) => [number, number];
21
- export const run: () => void;
22
22
  export const wasm_bindgen__convert__closures_____invoke__hd8590da73942d3e0: (a: number, b: number, c: any) => [number, number];
23
23
  export const wasm_bindgen__convert__closures_____invoke__h6ff3e7511bd758a3: (a: number, b: number, c: any, d: any) => void;
24
24
  export const wasm_bindgen__convert__closures_____invoke__h00cde4323839146b: (a: number, b: number, c: any) => void;
@@ -1,2 +1,2 @@
1
- export declare const SANGINE_HASH = "c27a2565";
1
+ export declare const SANGINE_HASH = "31a02d84";
2
2
  //# sourceMappingURL=sangine.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanox/sangine-core",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Sangine core renderer runtime (WASM + workers)",
5
5
  "type": "module",
6
6
  "private": false,