@defold-typescript/types 0.26.0 → 0.27.0

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.
Files changed (70) hide show
  1. package/api-availability.json +307 -307
  2. package/api-signatures.json +1311 -0
  3. package/api-targets.json +342 -0
  4. package/examples/translations.json +1984 -0
  5. package/fixtures/messages_doc.json +880 -0
  6. package/generated/versions/defold-1.12.4/gui.d.ts +43 -43
  7. package/generated/versions/defold-1.12.4/liveupdate.d.ts +22 -22
  8. package/generated/versions/defold-1.12.4/physics.d.ts +78 -75
  9. package/generated/versions/defold-1.12.4/render.d.ts +75 -55
  10. package/generated/versions/defold-1.12.4/resource.d.ts +187 -175
  11. package/generated/versions/defold-1.13.0/b2d.d.ts +33 -0
  12. package/generated/versions/defold-1.13.0/b2d_body.d.ts +676 -0
  13. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +106 -0
  14. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +155 -0
  15. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +823 -0
  16. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +215 -0
  17. package/generated/versions/defold-1.13.0/b2d_world.d.ts +314 -0
  18. package/generated/versions/defold-1.13.0/buffer.d.ts +176 -0
  19. package/generated/versions/defold-1.13.0/camera.d.ts +302 -0
  20. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +146 -0
  21. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +71 -0
  22. package/generated/versions/defold-1.13.0/compute.d.ts +306 -0
  23. package/generated/versions/defold-1.13.0/crash.d.ts +143 -0
  24. package/generated/versions/defold-1.13.0/editor-vm/http.d.ts +56 -0
  25. package/generated/versions/defold-1.13.0/editor-vm/json.d.ts +10 -0
  26. package/generated/versions/defold-1.13.0/editor-vm/localization.d.ts +42 -0
  27. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +80 -0
  28. package/generated/versions/defold-1.13.0/editor-vm/zip.d.ts +10 -0
  29. package/generated/versions/defold-1.13.0/editor-vm/zlib.d.ts +24 -0
  30. package/generated/versions/defold-1.13.0/editor.d.ts +1092 -0
  31. package/generated/versions/defold-1.13.0/factory.d.ts +123 -0
  32. package/generated/versions/defold-1.13.0/font.d.ts +81 -0
  33. package/generated/versions/defold-1.13.0/go.d.ts +1054 -0
  34. package/generated/versions/defold-1.13.0/graphics.d.ts +321 -0
  35. package/generated/versions/defold-1.13.0/gui.d.ts +2370 -0
  36. package/generated/versions/defold-1.13.0/html5.d.ts +53 -0
  37. package/generated/versions/defold-1.13.0/http.d.ts +84 -0
  38. package/generated/versions/defold-1.13.0/iac.d.ts +18 -0
  39. package/generated/versions/defold-1.13.0/iap.d.ts +60 -0
  40. package/generated/versions/defold-1.13.0/image.d.ts +139 -0
  41. package/generated/versions/defold-1.13.0/index.d.ts +48 -0
  42. package/generated/versions/defold-1.13.0/json.d.ts +76 -0
  43. package/generated/versions/defold-1.13.0/kinds/editor-script.d.ts +13 -0
  44. package/generated/versions/defold-1.13.0/label.d.ts +94 -0
  45. package/generated/versions/defold-1.13.0/liveupdate.d.ts +140 -0
  46. package/generated/versions/defold-1.13.0/material.d.ts +444 -0
  47. package/generated/versions/defold-1.13.0/model.d.ts +246 -0
  48. package/generated/versions/defold-1.13.0/msg.d.ts +10 -0
  49. package/generated/versions/defold-1.13.0/particlefx.d.ts +166 -0
  50. package/generated/versions/defold-1.13.0/physics.d.ts +548 -0
  51. package/generated/versions/defold-1.13.0/profiler.d.ts +233 -0
  52. package/generated/versions/defold-1.13.0/push.d.ts +66 -0
  53. package/generated/versions/defold-1.13.0/render.d.ts +1185 -0
  54. package/generated/versions/defold-1.13.0/resource.d.ts +1530 -0
  55. package/generated/versions/defold-1.13.0/socket.d.ts +795 -0
  56. package/generated/versions/defold-1.13.0/sound.d.ts +291 -0
  57. package/generated/versions/defold-1.13.0/sprite.d.ts +157 -0
  58. package/generated/versions/defold-1.13.0/sys.d.ts +695 -0
  59. package/generated/versions/defold-1.13.0/tilemap.d.ts +195 -0
  60. package/generated/versions/defold-1.13.0/timer.d.ts +114 -0
  61. package/generated/versions/defold-1.13.0/types.d.ts +61 -0
  62. package/generated/versions/defold-1.13.0/vmath.d.ts +806 -0
  63. package/generated/versions/defold-1.13.0/webview.d.ts +68 -0
  64. package/generated/versions/defold-1.13.0/window.d.ts +198 -0
  65. package/generated/versions/defold-1.13.0/zlib.d.ts +40 -0
  66. package/index.d.ts +4 -84
  67. package/package.json +11 -3
  68. package/scripts/import-defold-release.ts +18 -1
  69. package/src/example-store.ts +5 -0
  70. package/scripts/lua-types-signature-index.ts +0 -151
@@ -450,77 +450,80 @@ declare global {
450
450
  * -- Device and graphics adapter support 3D textures
451
451
  * end
452
452
  * @example
453
- * ```lua
454
- * How to create an 128x128 RGBA texture resource and assign it to a model
455
- * function init(self)
456
- * local tparams = {
457
- * width = 128,
458
- * height = 128,
459
- * type = graphics.TEXTURE_TYPE_2D,
460
- * format = graphics.TEXTURE_FORMAT_RGBA,
461
- * }
462
- * local my_texture_id = resource.create_texture("/my_custom_texture.texturec", tparams)
463
- * go.set("#model", "texture0", my_texture_id)
464
- * end
465
- * ```How to create an 128x128 floating point texture (RGBA32F) resource from a buffer object
453
+ * ```ts
454
+ * // How to create an 128x128 RGBA texture resource and assign it to a model
455
+ * export default defineScript({
456
+ * init() {
457
+ * const tparams = {
458
+ * width: 128,
459
+ * height: 128,
460
+ * type: graphics.TEXTURE_TYPE_2D,
461
+ * format: graphics.TEXTURE_FORMAT_RGBA,
462
+ * };
463
+ * const my_texture_id = resource.create_texture("/my_custom_texture.texturec", tparams);
464
+ * go.set("#model", "texture0", my_texture_id);
465
+ * },
466
+ * });
466
467
  *
467
- * ```lua
468
- * function init(self)
469
- * -- Create a new buffer with 4 components and FLOAT32 type
470
- * local tbuffer = buffer.create(128 * 128, { {name=hash("rgba"), type=buffer.VALUE_TYPE_FLOAT32, count=4} } )
471
- * local tstream = buffer.get_stream(tbuffer, hash("rgba"))
472
- *
473
- * -- Fill the buffer stream with some float values
474
- * for y=1,128 do
475
- * for x=1,128 do
476
- * local index = (y-1) * 128 * 4 + (x-1) * 4 + 1
477
- * tstream[index + 0] = 999.0
478
- * tstream[index + 1] = -1.0
479
- * tstream[index + 2] = 0.5
480
- * tstream[index + 3] = 1.0
481
- * end
482
- * end
483
- *
484
- * -- Create a 2D Texture with a RGBA23F format
485
- * local tparams = {
486
- * width = 128,
487
- * height = 128,
488
- * type = graphics.TEXTURE_TYPE_2D,
489
- * format = graphics.TEXTURE_FORMAT_RGBA32F,
490
- * }
491
- *
492
- * -- Note that we pass the buffer as the last argument here!
493
- * local my_texture_id = resource.create_texture("/my_custom_texture.texturec", tparams, tbuffer)
494
- *
495
- * -- assign the texture to a model
496
- * go.set("#model", "texture0", my_texture_id)
497
- * end
498
- * ```How to create a 32x32x32 floating point 3D texture that can be used to generate volumetric data in a compute shader
468
+ * // How to create an 128x128 floating point texture (RGBA32F) resource from a buffer object
469
+ * export default defineScript({
470
+ * init() {
471
+ * // Create a new buffer with 4 components and FLOAT32 type
472
+ * const tbuffer = buffer.create(128 * 128, [{ name: hash("rgba"), type: buffer.VALUE_TYPE_FLOAT32, count: 4 }]);
473
+ * const tstream = buffer.get_stream(tbuffer, hash("rgba"));
499
474
  *
500
- * ```lua
501
- * function init(self)
502
- * local t_volume = resource.create_texture("/my_backing_texture.texturec", {
503
- * type = graphics.TEXTURE_TYPE_IMAGE_3D,
504
- * width = 32,
505
- * height = 32,
506
- * depth = 32,
507
- * format = resource.TEXTURE_FORMAT_RGBA32F,
508
- * flags = resource.TEXTURE_USAGE_FLAG_STORAGE + resource.TEXTURE_USAGE_FLAG_SAMPLE,
509
- * })
510
- *
511
- * -- pass the backing texture to the render script
512
- * msg.post("@render:", "add_textures", { t_volume })
513
- * end
514
- * ```How to create 512x512 texture array with 5 pages.
475
+ * // Fill the buffer stream with some float values
476
+ * for (let y = 0; y < 128; y++) {
477
+ * for (let x = 0; x < 128; x++) {
478
+ * const index = y * 128 * 4 + x * 4;
479
+ * tstream[index + 0] = 999.0;
480
+ * tstream[index + 1] = -1.0;
481
+ * tstream[index + 2] = 0.5;
482
+ * tstream[index + 3] = 1.0;
483
+ * }
484
+ * }
515
485
  *
516
- * ```lua
517
- * local new_tex = resource.create_texture("/runtime/example_array.texturec", {
518
- * type = graphics.TEXTURE_TYPE_2D_ARRAY,
519
- * width = 512,
520
- * height = 512,
521
- * page_count = 5,
522
- * format = graphics.TEXTURE_FORMAT_RGB,
523
- * })
486
+ * // Create a 2D Texture with a RGBA23F format
487
+ * const tparams = {
488
+ * width: 128,
489
+ * height: 128,
490
+ * type: graphics.TEXTURE_TYPE_2D,
491
+ * format: graphics.TEXTURE_FORMAT_RGBA32F,
492
+ * };
493
+ *
494
+ * // Note that we pass the buffer as the last argument here!
495
+ * const my_texture_id = resource.create_texture("/my_custom_texture.texturec", tparams, tbuffer);
496
+ *
497
+ * // assign the texture to a model
498
+ * go.set("#model", "texture0", my_texture_id);
499
+ * },
500
+ * });
501
+ *
502
+ * // How to create a 32x32x32 floating point 3D texture that can be used to generate volumetric data in a compute shader
503
+ * export default defineScript({
504
+ * init() {
505
+ * const t_volume = resource.create_texture("/my_backing_texture.texturec", {
506
+ * type: graphics.TEXTURE_TYPE_IMAGE_3D,
507
+ * width: 32,
508
+ * height: 32,
509
+ * depth: 32,
510
+ * format: resource.TEXTURE_FORMAT_RGBA32F,
511
+ * flags: resource.TEXTURE_USAGE_FLAG_STORAGE + resource.TEXTURE_USAGE_FLAG_SAMPLE,
512
+ * });
513
+ *
514
+ * // pass the backing texture to the render script
515
+ * msg.post("@render:", "add_textures", [t_volume]);
516
+ * },
517
+ * });
518
+ *
519
+ * // How to create 512x512 texture array with 5 pages.
520
+ * const new_tex = resource.create_texture("/runtime/example_array.texturec", {
521
+ * type: graphics.TEXTURE_TYPE_2D_ARRAY,
522
+ * width: 512,
523
+ * height: 512,
524
+ * page_count: 5,
525
+ * format: graphics.TEXTURE_FORMAT_RGB,
526
+ * });
524
527
  * ```
525
528
  */
526
529
  function create_texture(path: string, table: { type?: number; width?: number; height?: number; depth?: number; format?: number; flags?: number; max_mipmaps?: number; compression_type?: number }, buffer: Opaque<"buffer">): Hash;
@@ -1348,119 +1351,128 @@ declare global {
1348
1351
  * -- Device and graphics adapter support 3D textures
1349
1352
  * end
1350
1353
  * @example
1351
- * ```lua
1352
- * How to set all pixels of an atlas
1353
- * function init(self)
1354
- * self.height = 128
1355
- * self.width = 128
1356
- * self.buffer = buffer.create(self.width * self.height, { {name=hash("rgb"), type=buffer.VALUE_TYPE_UINT8, count=3} } )
1357
- * self.stream = buffer.get_stream(self.buffer, hash("rgb"))
1358
- *
1359
- * for y=1,self.height do
1360
- * for x=1,self.width do
1361
- * local index = (y-1) * self.width * 3 + (x-1) * 3 + 1
1362
- * self.stream[index + 0] = 0xff
1363
- * self.stream[index + 1] = 0x80
1364
- * self.stream[index + 2] = 0x10
1365
- * end
1366
- * end
1367
- *
1368
- * local resource_path = go.get("#model", "texture0")
1369
- * local args = { width=self.width, height=self.height, type=graphics.TEXTURE_TYPE_2D, format=graphics.TEXTURE_FORMAT_RGB, num_mip_maps=1 }
1370
- * resource.set_texture( resource_path, args, self.buffer )
1371
- * end
1372
- * ```How to update a specific region of an atlas by using the x,y values. Assumes the already set atlas is a 128x128 texture.
1354
+ * ```ts
1355
+ * // How to set all pixels of an atlas
1356
+ * export default defineScript({
1357
+ * init(self) {
1358
+ * self.height = 128;
1359
+ * self.width = 128;
1360
+ * self.buffer = buffer.create(self.width * self.height, [{ name: hash("rgb"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);
1361
+ * self.stream = buffer.get_stream(self.buffer, hash("rgb"));
1362
+ *
1363
+ * for (let y = 0; y < self.height; y++) {
1364
+ * for (let x = 0; x < self.width; x++) {
1365
+ * const index = y * self.width * 3 + x * 3;
1366
+ * self.stream[index + 0] = 0xff;
1367
+ * self.stream[index + 1] = 0x80;
1368
+ * self.stream[index + 2] = 0x10;
1369
+ * }
1370
+ * }
1373
1371
  *
1374
- * ```lua
1375
- * function init(self)
1376
- * self.x = 16
1377
- * self.y = 16
1378
- * self.height = 128 - self.x * 2
1379
- * self.width = 128 - self.y * 2
1380
- * self.buffer = buffer.create(self.width * self.height, { {name=hash("rgb"), type=buffer.VALUE_TYPE_UINT8, count=3} } )
1381
- * self.stream = buffer.get_stream(self.buffer, hash("rgb"))
1382
- *
1383
- * for y=1,self.height do
1384
- * for x=1,self.width do
1385
- * local index = (y-1) * self.width * 3 + (x-1) * 3 + 1
1386
- * self.stream[index + 0] = 0xff
1387
- * self.stream[index + 1] = 0x80
1388
- * self.stream[index + 2] = 0x10
1389
- * end
1390
- * end
1391
- *
1392
- * local resource_path = go.get("#model", "texture0")
1393
- * local args = { width=self.width, height=self.height, x=self.x, y=self.y, type=graphics.TEXTURE_TYPE_2D, format=graphics.TEXTURE_FORMAT_RGB, num_mip_maps=1 }
1394
- * resource.set_texture(resource_path, args, self.buffer )
1395
- * end
1396
- * ```Update a texture from a buffer resource
1397
- * ```lua
1398
- * go.property("my_buffer", resource.buffer("/my_default_buffer.buffer"))
1399
- *
1400
- * function init(self)
1401
- * local resource_path = go.get("#model", "texture0")
1402
- * -- the "my_buffer" resource is expected to hold 128 * 128 * 3 bytes!
1403
- * local args = {
1404
- * width = 128,
1405
- * height = 128,
1406
- * type = graphics.TEXTURE_TYPE_2D,
1407
- * format = graphics.TEXTURE_FORMAT_RGB
1408
- * }
1409
- * -- Note that the extra resource.get_buffer call is a requirement here
1410
- * -- since the "self.my_buffer" is just pointing to a buffer resource path
1411
- * -- and not an actual buffer object or buffer resource.
1412
- * resource.set_texture(resource_path, args, resource.get_buffer(self.my_buffer))
1413
- * end
1414
- * ```Update an existing 3D texture from a lua buffer
1372
+ * const resource_path = go.get("#model", "texture0");
1373
+ * const args = { width: self.width, height: self.height, type: graphics.TEXTURE_TYPE_2D, format: graphics.TEXTURE_FORMAT_RGB, num_mip_maps: 1 };
1374
+ * resource.set_texture(resource_path, args, self.buffer);
1375
+ * },
1376
+ * });
1415
1377
  *
1416
- * ```lua
1378
+ * // How to update a specific region of an atlas by using the x,y values. Assumes the already set atlas is a 128x128 texture.
1379
+ * export default defineScript({
1380
+ * init(self) {
1381
+ * self.x = 16;
1382
+ * self.y = 16;
1383
+ * self.height = 128 - self.x * 2;
1384
+ * self.width = 128 - self.y * 2;
1385
+ * self.buffer = buffer.create(self.width * self.height, [{ name: hash("rgb"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);
1386
+ * self.stream = buffer.get_stream(self.buffer, hash("rgb"));
1387
+ *
1388
+ * for (let y = 0; y < self.height; y++) {
1389
+ * for (let x = 0; x < self.width; x++) {
1390
+ * const index = y * self.width * 3 + x * 3;
1391
+ * self.stream[index + 0] = 0xff;
1392
+ * self.stream[index + 1] = 0x80;
1393
+ * self.stream[index + 2] = 0x10;
1394
+ * }
1395
+ * }
1396
+ *
1397
+ * const resource_path = go.get("#model", "texture0");
1398
+ * const args = { width: self.width, height: self.height, x: self.x, y: self.y, type: graphics.TEXTURE_TYPE_2D, format: graphics.TEXTURE_FORMAT_RGB, num_mip_maps: 1 };
1399
+ * resource.set_texture(resource_path, args, self.buffer);
1400
+ * },
1401
+ * });
1402
+ *
1403
+ * // Update a texture from a buffer resource
1404
+ * go.property("my_buffer", resource.buffer("/my_default_buffer.buffer"));
1417
1405
  *
1418
- * function init(self)
1419
- * -- create a buffer that can hold the data of a 8x8x8 texture
1420
- * local tbuffer = buffer.create(8 * 8 * 8, { {name=hash("rgba"), type=buffer.VALUE_TYPE_FLOAT32, count=4} } )
1421
- * local tstream = buffer.get_stream(tbuffer, hash("rgba"))
1422
- *
1423
- * -- populate the buffer with some data
1424
- * local index = 1
1425
- * for z=1,8 do
1426
- * for y=1,8 do
1427
- * for x=1,8 do
1428
- * tstream[index + 0] = x
1429
- * tstream[index + 1] = y
1430
- * tstream[index + 2] = z
1431
- * tstream[index + 3] = 1.0
1432
- * index = index + 4
1433
- * end
1434
- * end
1435
- * end
1436
- *
1437
- * local t_args = {
1438
- * type = graphics.TEXTURE_TYPE_IMAGE_3D,
1439
- * width = 8,
1440
- * height = 8,
1441
- * depth = 8,
1442
- * format = resource.TEXTURE_FORMAT_RGBA32F
1406
+ * export default defineScript({
1407
+ * init(self) {
1408
+ * const resource_path = go.get("#model", "texture0");
1409
+ * // the "my_buffer" resource is expected to hold 128 * 128 * 3 bytes!
1410
+ * const args = {
1411
+ * width: 128,
1412
+ * height: 128,
1413
+ * type: graphics.TEXTURE_TYPE_2D,
1414
+ * format: graphics.TEXTURE_FORMAT_RGB,
1415
+ * };
1416
+ * // Note that the extra resource.get_buffer call is a requirement here
1417
+ * // since the "self.my_buffer" is just pointing to a buffer resource path
1418
+ * // and not an actual buffer object or buffer resource.
1419
+ * resource.set_texture(resource_path, args, resource.get_buffer(self.my_buffer));
1420
+ * },
1421
+ * });
1422
+ *
1423
+ * // Update an existing 3D texture from a buffer
1424
+ * export default defineScript({
1425
+ * init() {
1426
+ * // create a buffer that can hold the data of a 8x8x8 texture
1427
+ * const tbuffer = buffer.create(8 * 8 * 8, [{ name: hash("rgba"), type: buffer.VALUE_TYPE_FLOAT32, count: 4 }]);
1428
+ * const tstream = buffer.get_stream(tbuffer, hash("rgba"));
1429
+ *
1430
+ * // populate the buffer with some data
1431
+ * let index = 0;
1432
+ * for (let z = 0; z < 8; z++) {
1433
+ * for (let y = 0; y < 8; y++) {
1434
+ * for (let x = 0; x < 8; x++) {
1435
+ * tstream[index + 0] = x;
1436
+ * tstream[index + 1] = y;
1437
+ * tstream[index + 2] = z;
1438
+ * tstream[index + 3] = 1.0;
1439
+ * index = index + 4;
1440
+ * }
1441
+ * }
1443
1442
  * }
1444
1443
  *
1445
- * -- This expects that the texture resource "/my_3d_texture.texturec" already exists
1446
- * -- and is a 3D texture resource. To create a dynamic 3D texture resource
1447
- * -- use the "resource.create_texture" function.
1448
- * resource.set_texture("/my_3d_texture.texturec", t_args, tbuffer)
1449
- * endUpdate texture 2nd array page with loaded texture from png
1444
+ * const t_args = {
1445
+ * type: graphics.TEXTURE_TYPE_IMAGE_3D,
1446
+ * width: 8,
1447
+ * height: 8,
1448
+ * depth: 8,
1449
+ * format: resource.TEXTURE_FORMAT_RGBA32F,
1450
+ * };
1451
+ *
1452
+ * // This expects that the texture resource "/my_3d_texture.texturec" already exists
1453
+ * // and is a 3D texture resource. To create a dynamic 3D texture resource
1454
+ * // use the "resource.create_texture" function.
1455
+ * resource.set_texture("/my_3d_texture.texturec", t_args, tbuffer);
1456
+ * },
1457
+ * });
1450
1458
  *
1451
- * ```lua
1452
- * -- new_tex is resource handle of texture which was created via resource.create_resource
1453
- * local tex_path = "/bundle_resources/page_02.png"
1454
- * local data = sys.load_resource(tex_path)
1455
- * local buf = image.load_buffer(data)
1456
- * resource.set_texture(new_tex, {
1457
- * type = graphics.TEXTURE_TYPE_2D_ARRAY,
1458
- * width = buf.width,
1459
- * height = buf.height,
1460
- * page = 1,
1461
- * format = graphics.TEXTURE_FORMAT_RGB
1462
- * }, buf.buffer)
1463
- * go.set("#mesh", "texture0", new_tex)
1459
+ * // Update texture 2nd array page with loaded texture from png
1460
+ * // new_tex is resource handle of texture which was created via resource.create_resource
1461
+ * const tex_path = "/bundle_resources/page_02.png";
1462
+ * const [data] = sys.load_resource(tex_path);
1463
+ * const buf = image.load_buffer(data);
1464
+ * resource.set_texture(
1465
+ * new_tex,
1466
+ * {
1467
+ * type: graphics.TEXTURE_TYPE_2D_ARRAY,
1468
+ * width: buf.width,
1469
+ * height: buf.height,
1470
+ * page: 1,
1471
+ * format: graphics.TEXTURE_FORMAT_RGB,
1472
+ * },
1473
+ * buf.buffer,
1474
+ * );
1475
+ * go.set("#mesh", "texture0", new_tex);
1464
1476
  * ```
1465
1477
  */
1466
1478
  function set_texture(path: Hash | string, table: { type?: number; width?: number; height?: number; format?: number; x?: number; y?: number; z?: number; page?: number; mipmap?: number; compression_type?: number }, buffer: Opaque<"buffer">): void;
@@ -0,0 +1,33 @@
1
+ /** @noSelfInFile */
2
+ import type { Hash, Opaque, Url } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Functions for interacting with Box2D.
7
+ */
8
+ namespace b2d {
9
+ type b2Body = Opaque<"b2Body">;
10
+ type b2World = Opaque<"b2World">;
11
+ /**
12
+ * Get the Box2D body from a collision object
13
+ *
14
+ * @param url - the url to the game object collision component
15
+ * @returns the body if successful. Otherwise `nil`.
16
+ */
17
+ function get_body(url: string | Hash | Url): Opaque<"b2Body">;
18
+ /**
19
+ * Get the Box2D version information for the active backend.
20
+ *
21
+ * @returns version info with fields `version`, `major`, `middle`, and `minor`
22
+ */
23
+ function get_version(): { version: number; major: number; middle: number; minor: number };
24
+ /**
25
+ * Get the Box2D world from the current collection
26
+ *
27
+ * @returns the world if successful. Otherwise `nil`.
28
+ */
29
+ function get_world(): Opaque<"b2World">;
30
+ }
31
+ }
32
+
33
+ export {};