@defold-typescript/types 0.52.0 → 0.53.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 (191) hide show
  1. package/api-signatures.json +2074 -1964
  2. package/examples/translations.json +15 -15
  3. package/generated/b2d.d.ts +39 -39
  4. package/generated/b2d_body.d.ts +11 -11
  5. package/generated/b2d_chain.d.ts +3 -3
  6. package/generated/b2d_fixture.d.ts +5 -5
  7. package/generated/b2d_joint.d.ts +29 -29
  8. package/generated/b2d_shape.d.ts +13 -13
  9. package/generated/b2d_world.d.ts +15 -15
  10. package/generated/buffer.d.ts +5 -6
  11. package/generated/bullet3d.d.ts +6 -6
  12. package/generated/bullet3d_collision_object.d.ts +9 -9
  13. package/generated/bullet3d_constraint.d.ts +78 -78
  14. package/generated/bullet3d_rigid_body.d.ts +3 -3
  15. package/generated/bullet3d_shape.d.ts +11 -11
  16. package/generated/bullet3d_world.d.ts +20 -20
  17. package/generated/camera.d.ts +4 -4
  18. package/generated/collectionfactory.d.ts +2 -3
  19. package/generated/collectionproxy.d.ts +5 -5
  20. package/generated/compute.d.ts +5 -5
  21. package/generated/crash.d.ts +7 -7
  22. package/generated/editor-vm/http.d.ts +13 -13
  23. package/generated/editor-vm/image.d.ts +4 -4
  24. package/generated/editor-vm/json.d.ts +1 -1
  25. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  26. package/generated/editor-vm/zip.d.ts +4 -4
  27. package/generated/editor.d.ts +183 -183
  28. package/generated/factory.d.ts +2 -3
  29. package/generated/font.d.ts +4 -4
  30. package/generated/go.d.ts +10 -12
  31. package/generated/graphics.d.ts +23 -26
  32. package/generated/gui.d.ts +44 -58
  33. package/generated/http.d.ts +2 -2
  34. package/generated/image.d.ts +12 -12
  35. package/generated/json.d.ts +4 -4
  36. package/generated/label.d.ts +5 -5
  37. package/generated/liveupdate.d.ts +3 -3
  38. package/generated/material.d.ts +48 -48
  39. package/generated/model.d.ts +46 -14
  40. package/generated/particlefx.d.ts +5 -5
  41. package/generated/physics.d.ts +19 -19
  42. package/generated/profiler.d.ts +3 -5
  43. package/generated/render-script-modules/b2d.d.ts +39 -39
  44. package/generated/render-script-modules/bullet3d.d.ts +5 -5
  45. package/generated/render-script-modules/collectionfactory.d.ts +1 -2
  46. package/generated/render-script-modules/collectionproxy.d.ts +3 -3
  47. package/generated/render-script-modules/factory.d.ts +1 -2
  48. package/generated/render-script-modules/go.d.ts +8 -10
  49. package/generated/render-script-modules/label.d.ts +2 -2
  50. package/generated/render-script-modules/model.d.ts +43 -11
  51. package/generated/render-script-modules/particlefx.d.ts +3 -3
  52. package/generated/render-script-modules/physics.d.ts +12 -12
  53. package/generated/render-script-modules/resource.d.ts +52 -53
  54. package/generated/render-script-modules/sound.d.ts +4 -4
  55. package/generated/render-script-modules/sprite.d.ts +2 -2
  56. package/generated/render-script-modules/tilemap.d.ts +2 -2
  57. package/generated/render.d.ts +44 -45
  58. package/generated/resource.d.ts +58 -59
  59. package/generated/socket.d.ts +18 -23
  60. package/generated/sound.d.ts +6 -6
  61. package/generated/sprite.d.ts +3 -3
  62. package/generated/sys.d.ts +20 -21
  63. package/generated/tilemap.d.ts +3 -3
  64. package/generated/timer.d.ts +3 -3
  65. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/go.d.ts +2 -2
  68. package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
  69. package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
  70. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  72. package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
  73. package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
  74. package/generated/versions/defold-1.12.4/render.d.ts +5 -5
  75. package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
  76. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  77. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  78. package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
  79. package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
  80. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  81. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  82. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  83. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  84. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  85. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  86. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  87. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  88. package/generated/versions/defold-1.13.0/go.d.ts +2 -2
  89. package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
  90. package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
  91. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  92. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  93. package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
  94. package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
  95. package/generated/versions/defold-1.13.0/render.d.ts +5 -5
  96. package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
  97. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  98. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  99. package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
  100. package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  102. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  103. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  104. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  105. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  106. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  107. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  108. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  109. package/generated/versions/defold-1.13.1/go.d.ts +2 -2
  110. package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
  111. package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
  112. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  113. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  114. package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
  115. package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
  116. package/generated/versions/defold-1.13.1/render.d.ts +5 -5
  117. package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
  118. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  119. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  120. package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
  121. package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
  122. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  123. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  124. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  125. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  126. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  127. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  128. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  129. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  130. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  131. package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
  132. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  133. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
  134. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
  135. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  136. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  137. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  138. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  139. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  140. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  141. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  142. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  143. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  144. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  145. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  146. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  147. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  148. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  149. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  150. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  151. package/generated/versions/defold-1.13.2/go.d.ts +10 -12
  152. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
  153. package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
  154. package/generated/versions/defold-1.13.2/http.d.ts +2 -2
  155. package/generated/versions/defold-1.13.2/image.d.ts +12 -12
  156. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  157. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  158. package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
  159. package/generated/versions/defold-1.13.2/material.d.ts +48 -48
  160. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  161. package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
  162. package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
  163. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  164. package/generated/versions/defold-1.13.2/render.d.ts +43 -44
  165. package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
  166. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  167. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  168. package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
  169. package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
  170. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  171. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  172. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
  173. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  174. package/generated/vmath.d.ts +0 -1
  175. package/generated/window.d.ts +8 -10
  176. package/identity-vocabulary.json +41 -34
  177. package/package.json +2 -1
  178. package/scripts/generate-api-availability.ts +9 -3
  179. package/scripts/shared-handle-methods.ts +3 -2
  180. package/src/api-doc.ts +8 -0
  181. package/src/api-identity.ts +32 -1
  182. package/src/component-properties.d.ts +8 -8
  183. package/src/core-types.ts +29 -13
  184. package/src/doc-corrections.ts +9 -0
  185. package/src/emit-dts.ts +664 -202
  186. package/src/engine-type-name.ts +33 -0
  187. package/src/go-overloads.d.ts +10 -10
  188. package/src/gui-overloads.d.ts +11 -11
  189. package/src/index.ts +1 -0
  190. package/src/lifecycle.ts +2 -2
  191. package/src/socket-types.d.ts +3 -3
@@ -80,19 +80,19 @@
80
80
  "bullet3d.constraint.create_generic_6dof_spring": [
81
81
  {
82
82
  "sourceHash": "208db6534df9ca4a",
83
- "ts": "// Create a spring that moves along its first linear axis:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/body_a#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/body_b#collisionobject\");\n let spring: bullet3d.constraint.btTypedConstraint | undefined;\n if (body_a !== undefined && body_b !== undefined) {\n spring = bullet3d.constraint.create_generic_6dof_spring(body_a, body_b, {\n frame_a_position: vmath.vector3(),\n frame_a_rotation: vmath.quat(),\n frame_b_position: vmath.vector3(),\n frame_b_rotation: vmath.quat(),\n });\n bullet3d.constraint.set_limit(spring, 1, -1, 1);\n bullet3d.constraint.enable_spring(spring, 1, true);\n bullet3d.constraint.set_spring_stiffness(spring, 1, 20);\n bullet3d.constraint.set_spring_damping(spring, 1, 0.5);\n bullet3d.constraint.set_spring_equilibrium_point(spring, 1, 0);\n }\n return { spring };\n },\n\n final(self) {\n if (self.spring !== undefined && bullet3d.constraint.is_valid(self.spring)) {\n bullet3d.constraint.destroy(self.spring);\n }\n },\n});"
83
+ "ts": "// Create a spring that moves along its first linear axis:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/body_a#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/body_b#collisionobject\");\n let spring: bullet3d.constraint.BtTypedConstraint | undefined;\n if (body_a !== undefined && body_b !== undefined) {\n spring = bullet3d.constraint.create_generic_6dof_spring(body_a, body_b, {\n frame_a_position: vmath.vector3(),\n frame_a_rotation: vmath.quat(),\n frame_b_position: vmath.vector3(),\n frame_b_rotation: vmath.quat(),\n });\n bullet3d.constraint.set_limit(spring, 1, -1, 1);\n bullet3d.constraint.enable_spring(spring, 1, true);\n bullet3d.constraint.set_spring_stiffness(spring, 1, 20);\n bullet3d.constraint.set_spring_damping(spring, 1, 0.5);\n bullet3d.constraint.set_spring_equilibrium_point(spring, 1, 0);\n }\n return { spring };\n },\n\n final(self) {\n if (self.spring !== undefined && bullet3d.constraint.is_valid(self.spring)) {\n bullet3d.constraint.destroy(self.spring);\n }\n },\n});"
84
84
  }
85
85
  ],
86
86
  "bullet3d.constraint.create_hinge": [
87
87
  {
88
88
  "sourceHash": "76ffd570e08f0b18",
89
- "ts": "// Create a motorized hinge with a 90-degree range:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/door#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/frame#collisionobject\");\n let hinge: bullet3d.constraint.btTypedConstraint | undefined;\n if (body_a !== undefined) {\n hinge = bullet3d.constraint.create_hinge(body_a, body_b, {\n frame_a_position: vmath.vector3(-0.5, 0, 0),\n frame_a_rotation: vmath.quat(),\n frame_b_position: vmath.vector3(0.5, 0, 0),\n frame_b_rotation: vmath.quat(),\n });\n bullet3d.constraint.set_hinge_limits(hinge, -math.pi / 4, math.pi / 4);\n bullet3d.constraint.set_hinge_motor(hinge, true, 1.5, 2.5);\n }\n return { hinge };\n },\n\n final(self) {\n if (self.hinge !== undefined && bullet3d.constraint.is_valid(self.hinge)) {\n bullet3d.constraint.destroy(self.hinge);\n }\n },\n});"
89
+ "ts": "// Create a motorized hinge with a 90-degree range:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/door#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/frame#collisionobject\");\n let hinge: bullet3d.constraint.BtTypedConstraint | undefined;\n if (body_a !== undefined) {\n hinge = bullet3d.constraint.create_hinge(body_a, body_b, {\n frame_a_position: vmath.vector3(-0.5, 0, 0),\n frame_a_rotation: vmath.quat(),\n frame_b_position: vmath.vector3(0.5, 0, 0),\n frame_b_rotation: vmath.quat(),\n });\n bullet3d.constraint.set_hinge_limits(hinge, -math.pi / 4, math.pi / 4);\n bullet3d.constraint.set_hinge_motor(hinge, true, 1.5, 2.5);\n }\n return { hinge };\n },\n\n final(self) {\n if (self.hinge !== undefined && bullet3d.constraint.is_valid(self.hinge)) {\n bullet3d.constraint.destroy(self.hinge);\n }\n },\n});"
90
90
  }
91
91
  ],
92
92
  "bullet3d.constraint.create_point_to_point": [
93
93
  {
94
94
  "sourceHash": "91bc34d28899d0c1",
95
- "ts": "// Join two bodies at matching local pivots and explicitly destroy the\n// constraint when the script is finalized:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/body_a#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/body_b#collisionobject\");\n let constraint: bullet3d.constraint.btTypedConstraint | undefined;\n if (body_a !== undefined) {\n constraint = bullet3d.constraint.create_point_to_point(body_a, body_b, {\n pivot_a: vmath.vector3(0.5, 0, 0),\n pivot_b: vmath.vector3(-0.5, 0, 0),\n });\n }\n return { constraint };\n },\n\n final(self) {\n if (self.constraint !== undefined && bullet3d.constraint.is_valid(self.constraint)) {\n bullet3d.constraint.destroy(self.constraint);\n }\n },\n});"
95
+ "ts": "// Join two bodies at matching local pivots and explicitly destroy the\n// constraint when the script is finalized:\nexport default defineScript({\n init() {\n const body_a = bullet3d.get_rigid_body(\"/body_a#collisionobject\");\n const body_b = bullet3d.get_rigid_body(\"/body_b#collisionobject\");\n let constraint: bullet3d.constraint.BtTypedConstraint | undefined;\n if (body_a !== undefined) {\n constraint = bullet3d.constraint.create_point_to_point(body_a, body_b, {\n pivot_a: vmath.vector3(0.5, 0, 0),\n pivot_b: vmath.vector3(-0.5, 0, 0),\n });\n }\n return { constraint };\n },\n\n final(self) {\n if (self.constraint !== undefined && bullet3d.constraint.is_valid(self.constraint)) {\n bullet3d.constraint.destroy(self.constraint);\n }\n },\n});"
96
96
  }
97
97
  ],
98
98
  "bullet3d.get_gameobject_id": [
@@ -930,7 +930,7 @@
930
930
  },
931
931
  {
932
932
  "sourceHash": "877de2c1daa19e58",
933
- "ts": "export default defineScript({\n init() {\n const text = go.get<label.properties>()(\"#label\", \"text\");\n print(text);\n },\n});"
933
+ "ts": "export default defineScript({\n init() {\n const text = go.get<label.Properties>()(\"#label\", \"text\");\n print(text);\n },\n});"
934
934
  }
935
935
  ],
936
936
  "label.set_text": [
@@ -940,7 +940,7 @@
940
940
  },
941
941
  {
942
942
  "sourceHash": "2ac0aeb70ccdc6bf",
943
- "ts": "export default defineScript({\n init() {\n go.set<label.properties>()(\"#label\", \"text\", \"Hello World!\");\n },\n});"
943
+ "ts": "export default defineScript({\n init() {\n go.set<label.Properties>()(\"#label\", \"text\", \"Hello World!\");\n },\n});"
944
944
  }
945
945
  ],
946
946
  "liveupdate.add_mount": [
@@ -1687,7 +1687,7 @@
1687
1687
  },
1688
1688
  {
1689
1689
  "sourceHash": "66e3c1c627270938",
1690
- "ts": "// Create a texture resource asyncronously with a buffer and a callback\nfunction callback(self: unknown, request_id: number, result: resource.texture_creation_result) {\n // The resource has been updated with a new texture,\n // so we can update other systems with the new handle,\n // or update components to use the resource if we want\n const tinfo = resource.get_texture_info(result.path);\n msg.post(\"@render:\", \"set_backing_texture\", { handle: tinfo.handle });\n}\n\nexport default defineScript({\n init() {\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGBA;\n if (format === undefined) return;\n // Create a texture resource async\n const tparams = {\n width: 128,\n height: 128,\n type: graphics.TEXTURE_TYPE_2D,\n format,\n };\n\n // Create a new buffer with 4 components\n const tbuffer = buffer.create(tparams.width * tparams.height, [{ name: hash(\"rgba\"), type: buffer.VALUE_TYPE_UINT8, count: 4 }]);\n const tstream = buffer.get_stream(tbuffer, hash(\"rgba\"));\n\n // Fill the buffer stream with some float values\n for (let y = 0; y < tparams.width; y++) {\n for (let x = 0; x < tparams.height; x++) {\n const index = y * 128 * 4 + x * 4;\n tstream[index + 0] = 255;\n tstream[index + 1] = 0;\n tstream[index + 2] = 255;\n tstream[index + 3] = 255;\n }\n }\n // create the texture\n const [tpath, request_id] = resource.create_texture_async(\"/my_texture.texturec\", tparams, tbuffer, callback);\n // at this point you can use the resource as-is, but note that the texture will be a blank 1x1 texture\n // that will be removed once the new texture has been updated\n go.set(\"#model\", \"texture0\", tpath);\n },\n});"
1690
+ "ts": "// Create a texture resource asyncronously with a buffer and a callback\nfunction callback(self: unknown, request_id: number, result: resource.TextureCreationResult) {\n // The resource has been updated with a new texture,\n // so we can update other systems with the new handle,\n // or update components to use the resource if we want\n const tinfo = resource.get_texture_info(result.path);\n msg.post(\"@render:\", \"set_backing_texture\", { handle: tinfo.handle });\n}\n\nexport default defineScript({\n init() {\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGBA;\n if (format === undefined) return;\n // Create a texture resource async\n const tparams = {\n width: 128,\n height: 128,\n type: graphics.TEXTURE_TYPE_2D,\n format,\n };\n\n // Create a new buffer with 4 components\n const tbuffer = buffer.create(tparams.width * tparams.height, [{ name: hash(\"rgba\"), type: buffer.VALUE_TYPE_UINT8, count: 4 }]);\n const tstream = buffer.get_stream(tbuffer, hash(\"rgba\"));\n\n // Fill the buffer stream with some float values\n for (let y = 0; y < tparams.width; y++) {\n for (let x = 0; x < tparams.height; x++) {\n const index = y * 128 * 4 + x * 4;\n tstream[index + 0] = 255;\n tstream[index + 1] = 0;\n tstream[index + 2] = 255;\n tstream[index + 3] = 255;\n }\n }\n // create the texture\n const [tpath, request_id] = resource.create_texture_async(\"/my_texture.texturec\", tparams, tbuffer, callback);\n // at this point you can use the resource as-is, but note that the texture will be a blank 1x1 texture\n // that will be removed once the new texture has been updated\n go.set(\"#model\", \"texture0\", tpath);\n },\n});"
1691
1691
  }
1692
1692
  ],
1693
1693
  "resource.font": [
@@ -1703,7 +1703,7 @@
1703
1703
  "resource.get_buffer": [
1704
1704
  {
1705
1705
  "sourceHash": "ed7d361c7f5d2e35",
1706
- "ts": "// How to get the data from a buffer\nexport default defineScript({\n init() {\n const res_path = go.get<mesh.properties>()(\"#mesh\", \"vertices\");\n const buf = resource.get_buffer(res_path);\n const stream_positions = buffer.get_stream(buf, \"position\");\n\n for (let i = 0; i < stream_positions.length(); i++) {\n print(i, stream_positions[i]);\n }\n },\n});"
1706
+ "ts": "// How to get the data from a buffer\nexport default defineScript({\n init() {\n const res_path = go.get<mesh.Properties>()(\"#mesh\", \"vertices\");\n const buf = resource.get_buffer(res_path);\n const stream_positions = buffer.get_stream(buf, \"position\");\n\n for (let i = 0; i < stream_positions.length(); i++) {\n print(i, stream_positions[i]);\n }\n },\n});"
1707
1707
  }
1708
1708
  ],
1709
1709
  "resource.get_render_target_info": [
@@ -1719,7 +1719,7 @@
1719
1719
  "resource.get_text_metrics": [
1720
1720
  {
1721
1721
  "sourceHash": "d63156dd59513358",
1722
- "ts": "export default defineScript({\n init() {\n const font = go.get<label.properties>()(\"#label\", \"font\");\n const metrics = resource.get_text_metrics(font, \"The quick brown fox\\n jumps over the lazy dog\");\n pprint(metrics);\n },\n});"
1722
+ "ts": "export default defineScript({\n init() {\n const font = go.get<label.Properties>()(\"#label\", \"font\");\n const metrics = resource.get_text_metrics(font, \"The quick brown fox\\n jumps over the lazy dog\");\n pprint(metrics);\n },\n});"
1723
1723
  }
1724
1724
  ],
1725
1725
  "resource.get_texture_info": [
@@ -1761,7 +1761,7 @@
1761
1761
  "resource.set": [
1762
1762
  {
1763
1763
  "sourceHash": "fd3445f93ecdd85e",
1764
- "ts": "// Assuming the folder \"/res\" is added to the project custom resources:\n// load a texture resource and set it on a sprite\nconst buffer = resource.load(\"/res/new.texturec\");\nresource.set(go.get<sprite.properties>()(\"#sprite\", \"texture0\"), buffer);"
1764
+ "ts": "// Assuming the folder \"/res\" is added to the project custom resources:\n// load a texture resource and set it on a sprite\nconst buffer = resource.load(\"/res/new.texturec\");\nresource.set(go.get<sprite.Properties>()(\"#sprite\", \"texture0\"), buffer);"
1765
1765
  }
1766
1766
  ],
1767
1767
  "resource.set_atlas": [
@@ -1777,21 +1777,21 @@
1777
1777
  "resource.set_buffer": [
1778
1778
  {
1779
1779
  "sourceHash": "a52fd8ac7453f601",
1780
- "ts": "// How to set the data from a buffer\nfunction fill_stream(stream: { [index: number]: number }, verts: number[]) {\n verts.forEach((value, key) => {\n stream[key] = value;\n });\n}\n\nexport default defineScript({\n init() {\n const res_path = go.get<mesh.properties>()(\"#mesh\", \"vertices\");\n\n const positions = [\n 1, -1, 0,\n 1, 1, 0,\n -1, -1, 0,\n ];\n\n const num_verts = positions.length / 3;\n\n // create a new buffer\n let buf = buffer.create(num_verts, [{ name: hash(\"position\"), type: buffer.VALUE_TYPE_FLOAT32, count: 3 }]);\n\n buf = resource.get_buffer(res_path);\n const stream_positions = buffer.get_stream(buf, \"position\");\n\n fill_stream(stream_positions, positions);\n\n resource.set_buffer(res_path, buf);\n },\n});"
1780
+ "ts": "// How to set the data from a buffer\nfunction fill_stream(stream: { [index: number]: number }, verts: number[]) {\n verts.forEach((value, key) => {\n stream[key] = value;\n });\n}\n\nexport default defineScript({\n init() {\n const res_path = go.get<mesh.Properties>()(\"#mesh\", \"vertices\");\n\n const positions = [\n 1, -1, 0,\n 1, 1, 0,\n -1, -1, 0,\n ];\n\n const num_verts = positions.length / 3;\n\n // create a new buffer\n let buf = buffer.create(num_verts, [{ name: hash(\"position\"), type: buffer.VALUE_TYPE_FLOAT32, count: 3 }]);\n\n buf = resource.get_buffer(res_path);\n const stream_positions = buffer.get_stream(buf, \"position\");\n\n fill_stream(stream_positions, positions);\n\n resource.set_buffer(res_path, buf);\n },\n});"
1781
1781
  }
1782
1782
  ],
1783
1783
  "resource.set_texture": [
1784
1784
  {
1785
1785
  "sourceHash": "fe312c35ef2ab0f4",
1786
- "ts": "// How to set all pixels of an atlas\nexport default defineScript({\n init() {\n const height = 128;\n const width = 128;\n const buf = buffer.create(width * height, [{ name: hash(\"rgb\"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);\n const stream = buffer.get_stream(buf, hash(\"rgb\"));\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const index = y * width * 3 + x * 3;\n stream[index + 0] = 0xff;\n stream[index + 1] = 0x80;\n stream[index + 2] = 0x10;\n }\n }\n\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format !== undefined) {\n const resource_path = go.get<model.properties>()(\"#model\", \"texture0\");\n const args = { width, height, type: graphics.TEXTURE_TYPE_2D, format, num_mip_maps: 1 };\n resource.set_texture(resource_path, args, buf);\n }\n return { buffer: buf, stream };\n },\n});"
1786
+ "ts": "// How to set all pixels of an atlas\nexport default defineScript({\n init() {\n const height = 128;\n const width = 128;\n const buf = buffer.create(width * height, [{ name: hash(\"rgb\"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);\n const stream = buffer.get_stream(buf, hash(\"rgb\"));\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const index = y * width * 3 + x * 3;\n stream[index + 0] = 0xff;\n stream[index + 1] = 0x80;\n stream[index + 2] = 0x10;\n }\n }\n\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format !== undefined) {\n const resource_path = go.get<model.Properties>()(\"#model\", \"texture0\");\n const args = { width, height, type: graphics.TEXTURE_TYPE_2D, format, num_mip_maps: 1 };\n resource.set_texture(resource_path, args, buf);\n }\n return { buffer: buf, stream };\n },\n});"
1787
1787
  },
1788
1788
  {
1789
1789
  "sourceHash": "b4098f0f37b9c1d0",
1790
- "ts": "// How to update a specific region of an atlas by using the x,y values. Assumes the already set atlas is a 128x128 texture.\nexport default defineScript({\n init() {\n const x = 16;\n const y = 16;\n const height = 128 - x * 2;\n const width = 128 - y * 2;\n const buf = buffer.create(width * height, [{ name: hash(\"rgb\"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);\n const stream = buffer.get_stream(buf, hash(\"rgb\"));\n\n for (let row = 0; row < height; row++) {\n for (let col = 0; col < width; col++) {\n const index = row * width * 3 + col * 3;\n stream[index + 0] = 0xff;\n stream[index + 1] = 0x80;\n stream[index + 2] = 0x10;\n }\n }\n\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format !== undefined) {\n const resource_path = go.get<model.properties>()(\"#model\", \"texture0\");\n const args = { width, height, x, y, type: graphics.TEXTURE_TYPE_2D, format, num_mip_maps: 1 };\n resource.set_texture(resource_path, args, buf);\n }\n return { buffer: buf, stream };\n },\n});"
1790
+ "ts": "// How to update a specific region of an atlas by using the x,y values. Assumes the already set atlas is a 128x128 texture.\nexport default defineScript({\n init() {\n const x = 16;\n const y = 16;\n const height = 128 - x * 2;\n const width = 128 - y * 2;\n const buf = buffer.create(width * height, [{ name: hash(\"rgb\"), type: buffer.VALUE_TYPE_UINT8, count: 3 }]);\n const stream = buffer.get_stream(buf, hash(\"rgb\"));\n\n for (let row = 0; row < height; row++) {\n for (let col = 0; col < width; col++) {\n const index = row * width * 3 + col * 3;\n stream[index + 0] = 0xff;\n stream[index + 1] = 0x80;\n stream[index + 2] = 0x10;\n }\n }\n\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format !== undefined) {\n const resource_path = go.get<model.Properties>()(\"#model\", \"texture0\");\n const args = { width, height, x, y, type: graphics.TEXTURE_TYPE_2D, format, num_mip_maps: 1 };\n resource.set_texture(resource_path, args, buf);\n }\n return { buffer: buf, stream };\n },\n});"
1791
1791
  },
1792
1792
  {
1793
1793
  "sourceHash": "02d7f2ec29971bf1",
1794
- "ts": "// Update a texture from a buffer resource\nexport default defineScript({\n // Never call `go.property` yourself: the transpiler emits the chunk-scope\n // registration from this field, and only this field types the property onto `self`.\n properties: { my_buffer: resource.buffer(\"/my_default_buffer.buffer\") },\n\n init(self) {\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format === undefined) return;\n const resource_path = go.get<model.properties>()(\"#model\", \"texture0\");\n // the \"my_buffer\" resource is expected to hold 128 * 128 * 3 bytes!\n const args = {\n width: 128,\n height: 128,\n type: graphics.TEXTURE_TYPE_2D,\n format,\n };\n // Note that the extra resource.get_buffer call is a requirement here\n // since the \"self.my_buffer\" is just pointing to a buffer resource path\n // and not an actual buffer object or buffer resource.\n resource.set_texture(resource_path, args, resource.get_buffer(self.my_buffer));\n },\n});"
1794
+ "ts": "// Update a texture from a buffer resource\nexport default defineScript({\n // Never call `go.property` yourself: the transpiler emits the chunk-scope\n // registration from this field, and only this field types the property onto `self`.\n properties: { my_buffer: resource.buffer(\"/my_default_buffer.buffer\") },\n\n init(self) {\n // the engine registers a texture format only when the driver supports it\n const format = graphics.TEXTURE_FORMAT_RGB;\n if (format === undefined) return;\n const resource_path = go.get<model.Properties>()(\"#model\", \"texture0\");\n // the \"my_buffer\" resource is expected to hold 128 * 128 * 3 bytes!\n const args = {\n width: 128,\n height: 128,\n type: graphics.TEXTURE_TYPE_2D,\n format,\n };\n // Note that the extra resource.get_buffer call is a requirement here\n // since the \"self.my_buffer\" is just pointing to a buffer resource path\n // and not an actual buffer object or buffer resource.\n resource.set_texture(resource_path, args, resource.get_buffer(self.my_buffer));\n },\n});"
1795
1795
  },
1796
1796
  {
1797
1797
  "sourceHash": "15829bfe1b186bc3",
@@ -2117,11 +2117,11 @@
2117
2117
  },
2118
2118
  {
2119
2119
  "sourceHash": "7f66d3285b20ff78",
2120
- "ts": "// Load binary data from a custom project resource and update a texture resource:\nfunction my_callback(self: unknown, request_id: number, result: sys.load_buffer_result) {\n const format = graphics.TEXTURE_FORMAT_RGBA;\n if (result.status === sys.REQUEST_STATUS_FINISHED && result.buffer !== undefined && format !== undefined) {\n resource.set_texture(\"/my_texture\", { type: graphics.TEXTURE_TYPE_2D, width: 128, height: 128, format }, result.buffer);\n }\n}\n\nconst my_request = sys.load_buffer_async(\"/assets/my_level_data.bin\", my_callback);"
2120
+ "ts": "// Load binary data from a custom project resource and update a texture resource:\nfunction my_callback(self: unknown, request_id: number, result: sys.LoadBufferResult) {\n const format = graphics.TEXTURE_FORMAT_RGBA;\n if (result.status === sys.REQUEST_STATUS_FINISHED && result.buffer !== undefined && format !== undefined) {\n resource.set_texture(\"/my_texture\", { type: graphics.TEXTURE_TYPE_2D, width: 128, height: 128, format }, result.buffer);\n }\n}\n\nconst my_request = sys.load_buffer_async(\"/assets/my_level_data.bin\", my_callback);"
2121
2121
  },
2122
2122
  {
2123
2123
  "sourceHash": "9be4f92f718990af",
2124
- "ts": "// Load binary data from non-custom resource files on disk:\nfunction my_callback(self: unknown, request_id: number, result: sys.load_buffer_result) {\n const { first_request, second_request } = self as { first_request: number; second_request: number };\n if (result.status !== sys.REQUEST_STATUS_FINISHED) {\n // uh oh! File could not be found, do something graceful\n } else if (request_id === first_request) {\n // result.buffer contains data from my_level_asset.bin\n } else if (request_id === second_request) {\n // result.buffer contains data from 'my_level.bin'\n }\n}\n\nexport default defineScript({\n init() {\n return {\n first_request: sys.load_buffer_async(\"folder_next_to_binary/my_level_asset.bin\", my_callback),\n second_request: sys.load_buffer_async(\"/some_absolute_path/my_level.bin\", my_callback),\n };\n },\n});"
2124
+ "ts": "// Load binary data from non-custom resource files on disk:\nfunction my_callback(self: unknown, request_id: number, result: sys.LoadBufferResult) {\n const { first_request, second_request } = self as { first_request: number; second_request: number };\n if (result.status !== sys.REQUEST_STATUS_FINISHED) {\n // uh oh! File could not be found, do something graceful\n } else if (request_id === first_request) {\n // result.buffer contains data from my_level_asset.bin\n } else if (request_id === second_request) {\n // result.buffer contains data from 'my_level.bin'\n }\n}\n\nexport default defineScript({\n init() {\n return {\n first_request: sys.load_buffer_async(\"folder_next_to_binary/my_level_asset.bin\", my_callback),\n second_request: sys.load_buffer_async(\"/some_absolute_path/my_level.bin\", my_callback),\n };\n },\n});"
2125
2125
  }
2126
2126
  ],
2127
2127
  "sys.load_resource": [
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * Box2D axis-aligned bounding box
11
11
  */
12
- interface aabb {
12
+ interface Aabb {
13
13
  /**
14
14
  * Lower bound.
15
15
  */
@@ -19,12 +19,12 @@ declare global {
19
19
  */
20
20
  upper: Vector3;
21
21
  }
22
- type b2Body = Opaque<"b2Body">;
23
- type b2World = Opaque<"b2World">;
22
+ type B2Body = Opaque<"b2Body">;
23
+ type B2World = Opaque<"b2World">;
24
24
  /**
25
25
  * Box2D 3.x chain definition
26
26
  */
27
- interface chain_definition {
27
+ interface ChainDefinition {
28
28
  /**
29
29
  * Chain vertices.
30
30
  */
@@ -56,7 +56,7 @@ declare global {
56
56
  /**
57
57
  * Collision filter fields to override.
58
58
  */
59
- filter?: b2d.filter_options;
59
+ filter?: b2d.FilterOptions;
60
60
  /**
61
61
  * Whether to enable sensor events.
62
62
  */
@@ -65,7 +65,7 @@ declare global {
65
65
  /**
66
66
  * Box2D chain geometry
67
67
  */
68
- interface chain_geometry {
68
+ interface ChainGeometry {
69
69
  /**
70
70
  * Whether the chain is closed.
71
71
  */
@@ -90,15 +90,15 @@ declare global {
90
90
  /**
91
91
  * Box2D contact data
92
92
  */
93
- interface contact_data {
93
+ interface ContactData {
94
94
  /**
95
95
  * First contact shape.
96
96
  */
97
- shape_a: b2d.shape_info;
97
+ shape_a: b2d.ShapeInfo;
98
98
  /**
99
99
  * Second contact shape.
100
100
  */
101
- shape_b: b2d.shape_info;
101
+ shape_b: b2d.ShapeInfo;
102
102
  /**
103
103
  * Contact normal.
104
104
  */
@@ -114,12 +114,12 @@ declare global {
114
114
  /**
115
115
  * Contact manifold points.
116
116
  */
117
- points: b2d.contact_point[];
117
+ points: b2d.ContactPoint[];
118
118
  }
119
119
  /**
120
120
  * Box2D contact manifold point
121
121
  */
122
- interface contact_point {
122
+ interface ContactPoint {
123
123
  /**
124
124
  * World contact point.
125
125
  */
@@ -164,7 +164,7 @@ declare global {
164
164
  /**
165
165
  * Box2D explosion definition
166
166
  */
167
- interface explosion_definition {
167
+ interface ExplosionDefinition {
168
168
  /**
169
169
  * Explosion center.
170
170
  */
@@ -189,7 +189,7 @@ declare global {
189
189
  /**
190
190
  * Box2D collision filter
191
191
  */
192
- interface filter {
192
+ interface Filter {
193
193
  /**
194
194
  * Collision category bits.
195
195
  */
@@ -206,7 +206,7 @@ declare global {
206
206
  /**
207
207
  * Partial Box2D collision filter
208
208
  */
209
- interface filter_options {
209
+ interface FilterOptions {
210
210
  /**
211
211
  * Collision category bits.
212
212
  */
@@ -223,15 +223,15 @@ declare global {
223
223
  /**
224
224
  * Box2D 2.x cast hit
225
225
  */
226
- interface fixture_cast_hit {
226
+ interface FixtureCastHit {
227
227
  /**
228
228
  * Hit fixture.
229
229
  */
230
- fixture: b2d.fixture_info;
230
+ fixture: b2d.FixtureInfo;
231
231
  /**
232
232
  * Hit fixture child shape.
233
233
  */
234
- shape: b2d.fixture_info;
234
+ shape: b2d.FixtureInfo;
235
235
  /**
236
236
  * Hit point.
237
237
  */
@@ -256,11 +256,11 @@ declare global {
256
256
  /**
257
257
  * Box2D 2.x fixture definition
258
258
  */
259
- interface fixture_definition {
259
+ interface FixtureDefinition {
260
260
  /**
261
261
  * Shape definition.
262
262
  */
263
- shape: b2d.shape.definition;
263
+ shape: b2d.shape.Definition;
264
264
  /**
265
265
  * Fixture friction.
266
266
  */
@@ -284,12 +284,12 @@ declare global {
284
284
  /**
285
285
  * Collision filter.
286
286
  */
287
- filter?: b2d.filter;
287
+ filter?: b2d.Filter;
288
288
  }
289
289
  /**
290
290
  * Box2D 2.x fixture information
291
291
  */
292
- interface fixture_info {
292
+ interface FixtureInfo {
293
293
  /**
294
294
  * Owning body, when returned from a world query.
295
295
  */
@@ -305,7 +305,7 @@ declare global {
305
305
  /**
306
306
  * Shape type.
307
307
  */
308
- type: b2d.shape.SHAPE_TYPE;
308
+ type: b2d.shape.ShapeType;
309
309
  /**
310
310
  * Whether the fixture is a sensor.
311
311
  */
@@ -330,7 +330,7 @@ declare global {
330
330
  /**
331
331
  * Mass properties for a Box2D body or shape.
332
332
  */
333
- interface mass_data {
333
+ interface MassData {
334
334
  /**
335
335
  * Body mass, usually in kilograms.
336
336
  */
@@ -347,7 +347,7 @@ declare global {
347
347
  /**
348
348
  * Box2D mover capsule
349
349
  */
350
- interface mover_capsule {
350
+ interface MoverCapsule {
351
351
  /**
352
352
  * First capsule center.
353
353
  */
@@ -364,11 +364,11 @@ declare global {
364
364
  /**
365
365
  * Box2D mover collision plane
366
366
  */
367
- interface mover_plane {
367
+ interface MoverPlane {
368
368
  /**
369
369
  * Colliding shape.
370
370
  */
371
- shape: b2d.shape_info;
371
+ shape: b2d.ShapeInfo;
372
372
  /**
373
373
  * Plane normal.
374
374
  */
@@ -385,7 +385,7 @@ declare global {
385
385
  /**
386
386
  * Box2D world-query filter
387
387
  */
388
- interface query_filter {
388
+ interface QueryFilter {
389
389
  /**
390
390
  * Optional collision category bits.
391
391
  */
@@ -402,11 +402,11 @@ declare global {
402
402
  /**
403
403
  * Box2D 3.x cast hit
404
404
  */
405
- interface shape_cast_hit {
405
+ interface ShapeCastHit {
406
406
  /**
407
407
  * Hit shape.
408
408
  */
409
- shape: b2d.shape_info;
409
+ shape: b2d.ShapeInfo;
410
410
  /**
411
411
  * Hit point.
412
412
  */
@@ -431,7 +431,7 @@ declare global {
431
431
  /**
432
432
  * Direct Box2D shape cast result
433
433
  */
434
- interface shape_cast_output {
434
+ interface ShapeCastOutput {
435
435
  /**
436
436
  * Hit point.
437
437
  */
@@ -449,11 +449,11 @@ declare global {
449
449
  */
450
450
  iterations: number;
451
451
  }
452
- type shape_create_definition = { shape: b2d.shape.definition; density?: number; friction?: number; restitution?: number; material?: number; sensor?: boolean; is_sensor?: boolean; filter?: b2d.filter } | { type: b2d.shape.SHAPE_TYPE; radius?: number; center?: Vector3; center1?: Vector3; center2?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; hx?: number; hy?: number; angle?: number; vertices?: Vector3[]; density?: number; friction?: number; restitution?: number; material?: number; sensor?: boolean; is_sensor?: boolean; filter?: b2d.filter };
452
+ type ShapeCreateDefinition = { shape: b2d.shape.Definition; density?: number; friction?: number; restitution?: number; material?: number; sensor?: boolean; is_sensor?: boolean; filter?: b2d.Filter } | { type: b2d.shape.ShapeType; radius?: number; center?: Vector3; center1?: Vector3; center2?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; hx?: number; hy?: number; angle?: number; vertices?: Vector3[]; density?: number; friction?: number; restitution?: number; material?: number; sensor?: boolean; is_sensor?: boolean; filter?: b2d.Filter };
453
453
  /**
454
454
  * Box2D 3.x shape information
455
455
  */
456
- interface shape_info {
456
+ interface ShapeInfo {
457
457
  /**
458
458
  * Shape index on the body.
459
459
  */
@@ -465,7 +465,7 @@ declare global {
465
465
  /**
466
466
  * Shape type.
467
467
  */
468
- type: b2d.shape.SHAPE_TYPE;
468
+ type: b2d.shape.ShapeType;
469
469
  /**
470
470
  * Whether the shape is a sensor.
471
471
  */
@@ -498,7 +498,7 @@ declare global {
498
498
  /**
499
499
  * World transform for a Box2D body.
500
500
  */
501
- interface transform {
501
+ interface Transform {
502
502
  /**
503
503
  * World position of the body origin.
504
504
  */
@@ -511,7 +511,7 @@ declare global {
511
511
  /**
512
512
  * Box2D broad-phase query statistics
513
513
  */
514
- interface tree_stats {
514
+ interface TreeStats {
515
515
  /**
516
516
  * Number of tree nodes visited.
517
517
  */
@@ -524,7 +524,7 @@ declare global {
524
524
  /**
525
525
  * Box2D version information
526
526
  */
527
- interface version_info {
527
+ interface VersionInfo {
528
528
  /**
529
529
  * Full Box2D version string.
530
530
  */
@@ -545,7 +545,7 @@ declare global {
545
545
  /**
546
546
  * Box2D world counters
547
547
  */
548
- interface world_counters {
548
+ interface WorldCounters {
549
549
  /**
550
550
  * Number of bodies.
551
551
  */
@@ -594,7 +594,7 @@ declare global {
594
594
  /**
595
595
  * Box2D world profiling data
596
596
  */
597
- interface world_profile {
597
+ interface WorldProfile {
598
598
  /**
599
599
  * Total step time.
600
600
  */
@@ -711,7 +711,7 @@ declare global {
711
711
  *
712
712
  * @returns version information
713
713
  */
714
- function get_version(): b2d.version_info;
714
+ function get_version(): b2d.VersionInfo;
715
715
  /**
716
716
  * Get the Box2D world from the current collection
717
717
  *
@@ -6,8 +6,8 @@ declare global {
6
6
  * Functions for interacting with Box2D bodies.
7
7
  */
8
8
  namespace b2d.body {
9
- type b2Body = Opaque<"b2Body">;
10
- type b2World = Opaque<"b2World">;
9
+ type B2Body = Opaque<"b2Body">;
10
+ type B2World = Opaque<"b2World">;
11
11
  type B2 = typeof b2d.body.B2_DYNAMIC_BODY | typeof b2d.body.B2_KINEMATIC_BODY | typeof b2d.body.B2_STATIC_BODY;
12
12
  /**
13
13
  * Dynamic body
@@ -77,7 +77,7 @@ declare global {
77
77
  * @param body - body
78
78
  * @returns body bounds
79
79
  */
80
- function compute_aabb(body: Opaque<"b2Body">): b2d.aabb;
80
+ function compute_aabb(body: Opaque<"b2Body">): b2d.Aabb;
81
81
  /**
82
82
  * Chains are one-sided connected segments with optional ghost vertices at
83
83
  * the ends of open chains. Ghost vertices are creation-time chain data only and
@@ -96,7 +96,7 @@ declare global {
96
96
  * }
97
97
  * ```
98
98
  */
99
- function create_chain(body: Opaque<"b2Body">, definition: b2d.chain_definition): LuaMultiReturn<[Opaque<"b2Chain">, b2d.shape_info[]]>;
99
+ function create_chain(body: Opaque<"b2Body">, definition: b2d.ChainDefinition): LuaMultiReturn<[Opaque<"b2Chain">, b2d.ShapeInfo[]]>;
100
100
  /**
101
101
  * Creates a fixture and attach it to this body. Use this function if you need
102
102
  * to set some fixture parameters, like friction. Otherwise you can create the
@@ -118,7 +118,7 @@ declare global {
118
118
  * }
119
119
  * ```
120
120
  */
121
- function create_fixture(body: Opaque<"b2Body">, definition: { shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }; friction?: number; restitution?: number; density?: number; sensor?: boolean; is_sensor?: boolean; filter?: { category_bits: number; mask_bits: number; group_index: number } }): b2d.fixture_info;
121
+ function create_fixture(body: Opaque<"b2Body">, definition: { shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }; friction?: number; restitution?: number; density?: number; sensor?: boolean; is_sensor?: boolean; filter?: { category_bits: number; mask_bits: number; group_index: number } }): b2d.FixtureInfo;
122
122
  /**
123
123
  * Creates a shape and attaches it to this body.
124
124
  * If the density is non-zero, this function automatically updates the mass of the body.
@@ -201,14 +201,14 @@ declare global {
201
201
  * @param body - body
202
202
  * @returns array of contact tables
203
203
  */
204
- function get_contact_data(body: Opaque<"b2Body">): b2d.contact_data[];
204
+ function get_contact_data(body: Opaque<"b2Body">): b2d.ContactData[];
205
205
  /**
206
206
  * Get the fixtures attached to this body.
207
207
  *
208
208
  * @param body - body
209
209
  * @returns the attached fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
210
210
  */
211
- function get_fixtures(body: Opaque<"b2Body">): b2d.fixture_info[];
211
+ function get_fixtures(body: Opaque<"b2Body">): b2d.FixtureInfo[];
212
212
  /**
213
213
  * Get the total force currently applied on this object
214
214
  *
@@ -309,7 +309,7 @@ declare global {
309
309
  * @param body - body
310
310
  * @returns the mass data
311
311
  */
312
- function get_mass_data(body: Opaque<"b2Body">): b2d.mass_data;
312
+ function get_mass_data(body: Opaque<"b2Body">): b2d.MassData;
313
313
  /**
314
314
  * Get the body name.
315
315
  *
@@ -344,7 +344,7 @@ declare global {
344
344
  * @param body - body
345
345
  * @returns attached shapes
346
346
  */
347
- function get_shapes(body: Opaque<"b2Body">): b2d.shape_info[];
347
+ function get_shapes(body: Opaque<"b2Body">): b2d.ShapeInfo[];
348
348
  /**
349
349
  * Get the sleep velocity threshold.
350
350
  *
@@ -358,7 +358,7 @@ declare global {
358
358
  * @param body - body
359
359
  * @returns the body transform
360
360
  */
361
- function get_transform(body: Opaque<"b2Body">): b2d.transform;
361
+ function get_transform(body: Opaque<"b2Body">): b2d.Transform;
362
362
  /**
363
363
  * Get the type of this body.
364
364
  *
@@ -539,7 +539,7 @@ declare global {
539
539
  * @param body - body
540
540
  * @param data - the mass data
541
541
  */
542
- function set_mass_data(body: Opaque<"b2Body">, data: b2d.mass_data): void;
542
+ function set_mass_data(body: Opaque<"b2Body">, data: b2d.MassData): void;
543
543
  /**
544
544
  * Set the body name.
545
545
  *
@@ -7,7 +7,7 @@ declare global {
7
7
  * shapes, so it is represented by a separate `b2Chain` handle.
8
8
  */
9
9
  namespace b2d.chain {
10
- type b2Chain = Opaque<"b2Chain">;
10
+ type B2Chain = Opaque<"b2Chain">;
11
11
  /**
12
12
  * Destroying a chain removes all segment shapes owned by the chain. Destroying
13
13
  * any segment shape through `b2d.body.destroy_shape` also destroys its parent chain.
@@ -35,7 +35,7 @@ declare global {
35
35
  * @param chain - chain
36
36
  * @returns chain geometry
37
37
  */
38
- function get_geometry(chain: Opaque<"b2Chain">): b2d.chain_geometry;
38
+ function get_geometry(chain: Opaque<"b2Chain">): b2d.ChainGeometry;
39
39
  /**
40
40
  * Get chain material id.
41
41
  *
@@ -63,7 +63,7 @@ declare global {
63
63
  * @param chain - chain
64
64
  * @returns chain segment shapes
65
65
  */
66
- function get_segments(chain: Opaque<"b2Chain">): b2d.shape_info[];
66
+ function get_segments(chain: Opaque<"b2Chain">): b2d.ShapeInfo[];
67
67
  /**
68
68
  * Get the world owning a chain.
69
69
  *
@@ -15,7 +15,7 @@ declare global {
15
15
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
16
16
  * @returns the fixture AABB
17
17
  */
18
- function get_aabb(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.aabb;
18
+ function get_aabb(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.Aabb;
19
19
  /**
20
20
  * Get fixture density.
21
21
  *
@@ -32,7 +32,7 @@ declare global {
32
32
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
33
33
  * @returns the filter data
34
34
  */
35
- function get_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.filter;
35
+ function get_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.Filter;
36
36
  /**
37
37
  * Get fixture friction.
38
38
  *
@@ -54,14 +54,14 @@ declare global {
54
54
  * @param fixture_index - 1-based fixture index from b2d.body.get_fixtures. **⚠️ 1-based; passed to Defold unchanged.**
55
55
  * @returns the shape definition, suitable for reuse in b2d.body.create_fixture
56
56
  */
57
- function get_shape(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.definition;
57
+ function get_shape(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.Definition;
58
58
  /**
59
59
  * Get the fixture type.
60
60
  *
61
61
  * @param body - body
62
62
  * @param fixture_index - 1-based fixture index from b2d.body.get_fixtures. **⚠️ 1-based; passed to Defold unchanged.**
63
63
  */
64
- function get_type(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.SHAPE_TYPE;
64
+ function get_type(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.ShapeType;
65
65
  /**
66
66
  * Check if a fixture is a sensor.
67
67
  *
@@ -94,7 +94,7 @@ declare global {
94
94
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
95
95
  * @param filter - the filter data
96
96
  */
97
- function set_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number, filter: b2d.filter): void;
97
+ function set_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number, filter: b2d.Filter): void;
98
98
  /**
99
99
  * Set fixture friction.
100
100
  *