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