@balancy/wasm 1.0.23 → 1.0.25

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/Balancy.wasm CHANGED
Binary file
package/dist/index.cjs.js CHANGED
@@ -388,7 +388,7 @@ var Balancy = function() {
388
388
  "__Z30jsbalancyDataObjectViewPreloadNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE",
389
389
  "_balancySetUnzipCallback",
390
390
  "__Z23jsbalancyUnzipCompletedNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_",
391
- "__Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE",
391
+ "__Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE",
392
392
  "_balancySetDataRequestedCallback",
393
393
  "_balancyViewAllowOptimization",
394
394
  "_balancyConfigLaunch",
@@ -435,6 +435,9 @@ var Balancy = function() {
435
435
  "_balancyGetTimeOffset",
436
436
  "_balancySetTimeOffset",
437
437
  "__Z24jsbalancyGetParsedObjectPN7Balancy5Utils15JsonBasedObjectEb",
438
+ "_emscripten_websocket_on_connection_status",
439
+ "_emscripten_websocket_on_socketio_event",
440
+ "_emscripten_websocket_on_socketio_error",
438
441
  "_downloadSucceededBinary",
439
442
  "_fetchSucceededBinary",
440
443
  "_js_fetch",
@@ -515,9 +518,17 @@ var Balancy = function() {
515
518
  "_balancySoftPurchaseShopSlot",
516
519
  "_balancySoftPurchaseGameOffer",
517
520
  "_balancySoftPurchaseGameOfferGroup",
521
+ "__Z22_balancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvS5_EEE",
518
522
  "_balancyWebViewRequest",
519
523
  "_balancyGetProductsIdAndType",
520
524
  "_balancyGetParsedObject",
525
+ "_js_call_typescript_bridge_connect",
526
+ "_js_call_typescript_bridge_disconnect",
527
+ "_js_call_typescript_bridge_is_connected",
528
+ "_js_call_typescript_bridge_subscribe",
529
+ "_js_call_typescript_bridge_send_message",
530
+ "_js_call_typescript_bridge_send_ack",
531
+ "_js_initialize_typescript_bridge",
521
532
  "_main",
522
533
  "onRuntimeInitialized"
523
534
  ].forEach(function(prop) {
@@ -1320,6 +1331,276 @@ var Balancy = function() {
1320
1331
  invokeErrorCallback(-1, error.message, callbackPtr);
1321
1332
  });
1322
1333
  }
1334
+ function js_call_typescript_bridge_connect(connectionId, url, authData) {
1335
+ if (typeof Module !== "undefined" && Module.typescript_websocket_connect_request) {
1336
+ try {
1337
+ var urlStr = UTF8ToString(url);
1338
+ var authStr = UTF8ToString(authData);
1339
+ console.log("[C++ -> TS Bridge] Connect request", connectionId, urlStr);
1340
+ Module.typescript_websocket_connect_request(connectionId, urlStr, authStr);
1341
+ return true;
1342
+ } catch (error) {
1343
+ console.error("[ERROR] calling typescript_websocket_connect_request via Module:", error);
1344
+ }
1345
+ }
1346
+ if (typeof window !== "undefined" && window.Module && window.Module.typescript_websocket_connect_request) {
1347
+ try {
1348
+ var urlStr1 = UTF8ToString(url);
1349
+ var authStr1 = UTF8ToString(authData);
1350
+ console.log("[C++ -> TS Bridge] Connect request via window.Module", connectionId, urlStr1);
1351
+ window.Module.typescript_websocket_connect_request(connectionId, urlStr1, authStr1);
1352
+ return true;
1353
+ } catch (error) {
1354
+ console.error("[ERROR] calling typescript_websocket_connect_request via window.Module:", error);
1355
+ }
1356
+ }
1357
+ if (typeof globalThis !== "undefined" && globalThis.Module && globalThis.Module.typescript_websocket_connect_request) {
1358
+ try {
1359
+ var urlStr2 = UTF8ToString(url);
1360
+ var authStr2 = UTF8ToString(authData);
1361
+ console.log("[C++ -> TS Bridge] Connect request via globalThis.Module", connectionId, urlStr2);
1362
+ globalThis.Module.typescript_websocket_connect_request(connectionId, urlStr2, authStr2);
1363
+ return true;
1364
+ } catch (error) {
1365
+ console.error("[ERROR] calling typescript_websocket_connect_request via globalThis.Module:", error);
1366
+ }
1367
+ }
1368
+ console.error("[ERROR] TypeScript WebSocket Bridge connect method not found. Available contexts:", {
1369
+ Module: typeof Module !== "undefined" ? Object.keys(Module).filter(function(k) {
1370
+ return k.includes("websocket") || k.includes("typescript");
1371
+ }) : "undefined",
1372
+ windowModule: typeof window !== "undefined" && window.Module ? Object.keys(window.Module).filter(function(k) {
1373
+ return k.includes("websocket") || k.includes("typescript");
1374
+ }) : "undefined",
1375
+ globalThisModule: typeof globalThis !== "undefined" && globalThis.Module ? Object.keys(globalThis.Module).filter(function(k) {
1376
+ return k.includes("websocket") || k.includes("typescript");
1377
+ }) : "undefined"
1378
+ });
1379
+ return false;
1380
+ }
1381
+ function js_call_typescript_bridge_disconnect(connectionId) {
1382
+ var success = false;
1383
+ if (typeof Module !== "undefined" && Module.typescript_websocket_disconnect_request) {
1384
+ try {
1385
+ console.log("[C++ -> TS Bridge] Disconnect request", connectionId);
1386
+ Module.typescript_websocket_disconnect_request(connectionId);
1387
+ success = true;
1388
+ } catch (error) {
1389
+ console.error("[ERROR] calling typescript_websocket_disconnect_request via Module:", error);
1390
+ }
1391
+ }
1392
+ if (!success && typeof window !== "undefined" && window.Module && window.Module.typescript_websocket_disconnect_request) {
1393
+ try {
1394
+ console.log("[C++ -> TS Bridge] Disconnect request via window.Module", connectionId);
1395
+ window.Module.typescript_websocket_disconnect_request(connectionId);
1396
+ success = true;
1397
+ } catch (error) {
1398
+ console.error("[ERROR] calling typescript_websocket_disconnect_request via window.Module:", error);
1399
+ }
1400
+ }
1401
+ if (!success && typeof globalThis !== "undefined" && globalThis.Module && globalThis.Module.typescript_websocket_disconnect_request) {
1402
+ try {
1403
+ console.log("[C++ -> TS Bridge] Disconnect request via globalThis.Module", connectionId);
1404
+ globalThis.Module.typescript_websocket_disconnect_request(connectionId);
1405
+ success = true;
1406
+ } catch (error) {
1407
+ console.error("[ERROR] calling typescript_websocket_disconnect_request via globalThis.Module:", error);
1408
+ }
1409
+ }
1410
+ if (!success) {
1411
+ console.error("[ERROR] TypeScript WebSocket Bridge disconnect method not found");
1412
+ }
1413
+ }
1414
+ function js_call_typescript_bridge_subscribe(connectionId, eventName) {
1415
+ var success = false;
1416
+ if (typeof Module !== "undefined" && Module.typescript_websocket_subscribe_event) {
1417
+ try {
1418
+ var eventStr = UTF8ToString(eventName);
1419
+ console.log("[C++ -> TS Bridge] Subscribe event", connectionId, eventStr);
1420
+ Module.typescript_websocket_subscribe_event(connectionId, eventStr);
1421
+ success = true;
1422
+ } catch (error) {
1423
+ console.error("[ERROR] calling typescript_websocket_subscribe_event via Module:", error);
1424
+ }
1425
+ }
1426
+ if (!success && typeof window !== "undefined" && window.Module && window.Module.typescript_websocket_subscribe_event) {
1427
+ try {
1428
+ var eventStr1 = UTF8ToString(eventName);
1429
+ console.log("[C++ -> TS Bridge] Subscribe event via window.Module", connectionId, eventStr1);
1430
+ window.Module.typescript_websocket_subscribe_event(connectionId, eventStr1);
1431
+ success = true;
1432
+ } catch (error) {
1433
+ console.error("[ERROR] calling typescript_websocket_subscribe_event via window.Module:", error);
1434
+ }
1435
+ }
1436
+ if (!success && typeof globalThis !== "undefined" && globalThis.Module && globalThis.Module.typescript_websocket_subscribe_event) {
1437
+ try {
1438
+ var eventStr2 = UTF8ToString(eventName);
1439
+ console.log("[C++ -> TS Bridge] Subscribe event via globalThis.Module", connectionId, eventStr2);
1440
+ globalThis.Module.typescript_websocket_subscribe_event(connectionId, eventStr2);
1441
+ success = true;
1442
+ } catch (error) {
1443
+ console.error("[ERROR] calling typescript_websocket_subscribe_event via globalThis.Module:", error);
1444
+ }
1445
+ }
1446
+ if (!success) {
1447
+ console.error("[ERROR] TypeScript WebSocket Bridge subscribe method not found");
1448
+ }
1449
+ }
1450
+ function js_call_typescript_bridge_send_message(connectionId, eventName, data) {
1451
+ var success = false;
1452
+ if (typeof Module !== "undefined" && Module.typescript_websocket_send_message) {
1453
+ try {
1454
+ var eventStr = UTF8ToString(eventName);
1455
+ var dataStr = UTF8ToString(data);
1456
+ console.log("[C++ -> TS Bridge] Send message", connectionId, eventStr);
1457
+ Module.typescript_websocket_send_message(connectionId, eventStr, dataStr);
1458
+ success = true;
1459
+ } catch (error) {
1460
+ console.error("[ERROR] calling typescript_websocket_send_message via Module:", error);
1461
+ }
1462
+ }
1463
+ if (!success && typeof window !== "undefined" && window.Module && window.Module.typescript_websocket_send_message) {
1464
+ try {
1465
+ var eventStr1 = UTF8ToString(eventName);
1466
+ var dataStr1 = UTF8ToString(data);
1467
+ console.log("[C++ -> TS Bridge] Send message via window.Module", connectionId, eventStr1);
1468
+ window.Module.typescript_websocket_send_message(connectionId, eventStr1, dataStr1);
1469
+ success = true;
1470
+ } catch (error) {
1471
+ console.error("[ERROR] calling typescript_websocket_send_message via window.Module:", error);
1472
+ }
1473
+ }
1474
+ if (!success && typeof globalThis !== "undefined" && globalThis.Module && globalThis.Module.typescript_websocket_send_message) {
1475
+ try {
1476
+ var eventStr2 = UTF8ToString(eventName);
1477
+ var dataStr2 = UTF8ToString(data);
1478
+ console.log("[C++ -> TS Bridge] Send message via globalThis.Module", connectionId, eventStr2);
1479
+ globalThis.Module.typescript_websocket_send_message(connectionId, eventStr2, dataStr2);
1480
+ success = true;
1481
+ } catch (error) {
1482
+ console.error("[ERROR] calling typescript_websocket_send_message via globalThis.Module:", error);
1483
+ }
1484
+ }
1485
+ if (!success) {
1486
+ console.error("[ERROR] TypeScript WebSocket Bridge send message method not found");
1487
+ }
1488
+ }
1489
+ function js_call_typescript_bridge_send_ack(connectionId, ackId, responseData) {
1490
+ var success = false;
1491
+ if (typeof Module !== "undefined" && Module.typescript_websocket_send_ack) {
1492
+ try {
1493
+ var responseStr = UTF8ToString(responseData);
1494
+ console.log("[C++ -> TS Bridge] Send ack", connectionId, ackId);
1495
+ Module.typescript_websocket_send_ack(connectionId, ackId, responseStr);
1496
+ success = true;
1497
+ } catch (error) {
1498
+ console.error("[ERROR] calling typescript_websocket_send_ack via Module:", error);
1499
+ }
1500
+ }
1501
+ if (!success && typeof window !== "undefined" && window.Module && window.Module.typescript_websocket_send_ack) {
1502
+ try {
1503
+ var responseStr1 = UTF8ToString(responseData);
1504
+ console.log("[C++ -> TS Bridge] Send ack via window.Module", connectionId, ackId);
1505
+ window.Module.typescript_websocket_send_ack(connectionId, ackId, responseStr1);
1506
+ success = true;
1507
+ } catch (error) {
1508
+ console.error("[ERROR] calling typescript_websocket_send_ack via window.Module:", error);
1509
+ }
1510
+ }
1511
+ if (!success && typeof globalThis !== "undefined" && globalThis.Module && globalThis.Module.typescript_websocket_send_ack) {
1512
+ try {
1513
+ var responseStr2 = UTF8ToString(responseData);
1514
+ console.log("[C++ -> TS Bridge] Send ack via globalThis.Module", connectionId, ackId);
1515
+ globalThis.Module.typescript_websocket_send_ack(connectionId, ackId, responseStr2);
1516
+ success = true;
1517
+ } catch (error) {
1518
+ console.error("[ERROR] calling typescript_websocket_send_ack via globalThis.Module:", error);
1519
+ }
1520
+ }
1521
+ if (!success) {
1522
+ console.error("[ERROR] TypeScript WebSocket Bridge send ack method not found");
1523
+ }
1524
+ }
1525
+ function js_initialize_typescript_bridge() {
1526
+ console.log("[INIT] Initializing TypeScript WebSocket Bridge integration...");
1527
+ if (typeof window !== "undefined" && window.initializeTypeScriptWebSocketBridge) {
1528
+ try {
1529
+ window.initializeTypeScriptWebSocketBridge();
1530
+ console.log("[SUCCESS] TypeScript WebSocket Bridge initialized via window");
1531
+ } catch (error) {
1532
+ console.warn("[WARNING] Failed to initialize bridge via window:", error);
1533
+ }
1534
+ }
1535
+ if (typeof globalThis !== "undefined" && globalThis.initializeTypeScriptWebSocketBridge) {
1536
+ try {
1537
+ globalThis.initializeTypeScriptWebSocketBridge();
1538
+ console.log("[SUCCESS] TypeScript WebSocket Bridge initialized via globalThis");
1539
+ } catch (error) {
1540
+ console.warn("[WARNING] Failed to initialize bridge via globalThis:", error);
1541
+ }
1542
+ }
1543
+ var bridgeMethods = [
1544
+ "typescript_websocket_connect_request",
1545
+ "typescript_websocket_disconnect_request",
1546
+ "typescript_websocket_subscribe_event",
1547
+ "typescript_websocket_send_message",
1548
+ "typescript_websocket_send_ack"
1549
+ ];
1550
+ var bridgeFound = false;
1551
+ var contexts = [];
1552
+ if (typeof Module !== "undefined") {
1553
+ contexts.push({
1554
+ name: "Module",
1555
+ obj: Module
1556
+ });
1557
+ }
1558
+ if (typeof window !== "undefined" && window.Module) {
1559
+ contexts.push({
1560
+ name: "window.Module",
1561
+ obj: window.Module
1562
+ });
1563
+ }
1564
+ if (typeof globalThis !== "undefined" && globalThis.Module) {
1565
+ contexts.push({
1566
+ name: "globalThis.Module",
1567
+ obj: globalThis.Module
1568
+ });
1569
+ }
1570
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1571
+ try {
1572
+ var _loop = function() {
1573
+ var context = _step.value;
1574
+ var availableMethods = bridgeMethods.filter(function(method) {
1575
+ return typeof context.obj[method] === "function";
1576
+ });
1577
+ if (availableMethods.length > 0) {
1578
+ console.log("[SUCCESS] Bridge methods found in " + context.name + ": " + availableMethods.join(", "));
1579
+ bridgeFound = true;
1580
+ }
1581
+ };
1582
+ for(var _iterator = contexts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
1583
+ } catch (err) {
1584
+ _didIteratorError = true;
1585
+ _iteratorError = err;
1586
+ } finally{
1587
+ try {
1588
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1589
+ _iterator.return();
1590
+ }
1591
+ } finally{
1592
+ if (_didIteratorError) {
1593
+ throw _iteratorError;
1594
+ }
1595
+ }
1596
+ }
1597
+ if (!bridgeFound) {
1598
+ console.warn("[WARNING] No TypeScript WebSocket Bridge methods found in any context");
1599
+ console.log("Available in Module:", typeof Module !== "undefined" ? Object.keys(Module).filter(function(k) {
1600
+ return k.includes("websocket") || k.includes("typescript");
1601
+ }) : "undefined");
1602
+ }
1603
+ }
1323
1604
  var ExitStatus = function ExitStatus(status) {
1324
1605
  _class_call_check(this, ExitStatus);
1325
1606
  _define_property(this, "name", "ExitStatus");
@@ -7212,7 +7493,13 @@ var Balancy = function() {
7212
7493
  invoke_viiiiiiiiii: invoke_viiiiiiiiii,
7213
7494
  invoke_viiiiiiiiiiiiiii: invoke_viiiiiiiiiiiiiii,
7214
7495
  invoke_viijii: invoke_viijii,
7496
+ js_call_typescript_bridge_connect: js_call_typescript_bridge_connect,
7497
+ js_call_typescript_bridge_disconnect: js_call_typescript_bridge_disconnect,
7498
+ js_call_typescript_bridge_send_ack: js_call_typescript_bridge_send_ack,
7499
+ js_call_typescript_bridge_send_message: js_call_typescript_bridge_send_message,
7500
+ js_call_typescript_bridge_subscribe: js_call_typescript_bridge_subscribe,
7215
7501
  js_fetch: js_fetch,
7502
+ js_initialize_typescript_bridge: js_initialize_typescript_bridge,
7216
7503
  random_get: _random_get
7217
7504
  };
7218
7505
  var wasmExports;
@@ -7263,7 +7550,7 @@ var Balancy = function() {
7263
7550
  Module["__Z30jsbalancyDataObjectViewPreloadNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE"] = createExportWrapper("_Z30jsbalancyDataObjectViewPreloadNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE", 2);
7264
7551
  Module["_balancySetUnzipCallback"] = createExportWrapper("balancySetUnzipCallback", 1);
7265
7552
  Module["__Z23jsbalancyUnzipCompletedNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_"] = createExportWrapper("_Z23jsbalancyUnzipCompletedNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_", 2);
7266
- Module["__Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE"] = createExportWrapper("_Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE", 2);
7553
+ Module["__Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE"] = createExportWrapper("_Z23jsbalancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEN10emscripten3valE", 2);
7267
7554
  Module["_balancySetDataRequestedCallback"] = createExportWrapper("balancySetDataRequestedCallback", 1);
7268
7555
  Module["_balancyViewAllowOptimization"] = createExportWrapper("balancyViewAllowOptimization", 1);
7269
7556
  Module["_balancyConfigLaunch"] = createExportWrapper("balancyConfigLaunch", 1);
@@ -7310,6 +7597,9 @@ var Balancy = function() {
7310
7597
  Module["_balancyGetTimeOffset"] = createExportWrapper("balancyGetTimeOffset", 0);
7311
7598
  Module["_balancySetTimeOffset"] = createExportWrapper("balancySetTimeOffset", 1);
7312
7599
  Module["__Z24jsbalancyGetParsedObjectPN7Balancy5Utils15JsonBasedObjectEb"] = createExportWrapper("_Z24jsbalancyGetParsedObjectPN7Balancy5Utils15JsonBasedObjectEb", 3);
7600
+ Module["_emscripten_websocket_on_connection_status"] = createExportWrapper("emscripten_websocket_on_connection_status", 3);
7601
+ Module["_emscripten_websocket_on_socketio_event"] = createExportWrapper("emscripten_websocket_on_socketio_event", 5);
7602
+ Module["_emscripten_websocket_on_socketio_error"] = createExportWrapper("emscripten_websocket_on_socketio_error", 3);
7313
7603
  var _malloc = Module["_malloc"] = createExportWrapper("malloc", 1);
7314
7604
  var ___getTypeName = createExportWrapper("__getTypeName", 1);
7315
7605
  Module["_downloadSucceededBinary"] = createExportWrapper("downloadSucceededBinary", 3);
@@ -7392,6 +7682,7 @@ var Balancy = function() {
7392
7682
  Module["_balancySoftPurchaseShopSlot"] = createExportWrapper("balancySoftPurchaseShopSlot", 1);
7393
7683
  Module["_balancySoftPurchaseGameOffer"] = createExportWrapper("balancySoftPurchaseGameOffer", 1);
7394
7684
  Module["_balancySoftPurchaseGameOfferGroup"] = createExportWrapper("balancySoftPurchaseGameOfferGroup", 2);
7685
+ Module["__Z22_balancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvS5_EEE"] = createExportWrapper("_Z22_balancyWebViewRequestNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvS5_EEE", 2);
7395
7686
  Module["_balancyWebViewRequest"] = createExportWrapper("balancyWebViewRequest", 1);
7396
7687
  Module["_balancyGetProductsIdAndType"] = createExportWrapper("balancyGetProductsIdAndType", 1);
7397
7688
  Module["_balancyGetParsedObject"] = createExportWrapper("balancyGetParsedObject", 2);