@defold-typescript/types 0.51.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 (228) hide show
  1. package/api-availability.json +4 -58
  2. package/api-signatures.json +2804 -3172
  3. package/api-targets.json +15 -5
  4. package/examples/translations.json +19 -71
  5. package/generated/b2d.d.ts +39 -39
  6. package/generated/b2d_body.d.ts +11 -11
  7. package/generated/b2d_chain.d.ts +3 -3
  8. package/generated/b2d_fixture.d.ts +5 -5
  9. package/generated/b2d_joint.d.ts +29 -29
  10. package/generated/b2d_shape.d.ts +13 -13
  11. package/generated/b2d_world.d.ts +15 -15
  12. package/generated/buffer.d.ts +10 -11
  13. package/generated/bullet3d.d.ts +6 -6
  14. package/generated/bullet3d_collision_object.d.ts +10 -10
  15. package/generated/bullet3d_constraint.d.ts +173 -71
  16. package/generated/bullet3d_rigid_body.d.ts +3 -3
  17. package/generated/bullet3d_shape.d.ts +11 -11
  18. package/generated/bullet3d_world.d.ts +20 -20
  19. package/generated/camera.d.ts +4 -4
  20. package/generated/collectionfactory.d.ts +2 -3
  21. package/generated/collectionproxy.d.ts +5 -5
  22. package/generated/compute.d.ts +5 -5
  23. package/generated/crash.d.ts +7 -7
  24. package/generated/editor-vm/http.d.ts +13 -13
  25. package/generated/editor-vm/image.d.ts +4 -4
  26. package/generated/editor-vm/json.d.ts +1 -1
  27. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  28. package/generated/editor-vm/zip.d.ts +4 -4
  29. package/generated/editor.d.ts +183 -183
  30. package/generated/factory.d.ts +2 -3
  31. package/generated/font.d.ts +4 -4
  32. package/generated/go.d.ts +122 -230
  33. package/generated/graphics.d.ts +23 -25
  34. package/generated/gui.d.ts +186 -423
  35. package/generated/http.d.ts +3 -3
  36. package/generated/image.d.ts +63 -11
  37. package/generated/json.d.ts +4 -4
  38. package/generated/kinds/gui-script.d.ts +2 -0
  39. package/generated/kinds/render-script.d.ts +14 -15
  40. package/generated/label.d.ts +5 -5
  41. package/generated/liveupdate.d.ts +7 -3
  42. package/generated/material.d.ts +49 -49
  43. package/generated/model.d.ts +46 -14
  44. package/generated/particlefx.d.ts +24 -5
  45. package/generated/physics.d.ts +64 -20
  46. package/generated/profiler.d.ts +3 -5
  47. package/generated/render-script-modules/b2d.d.ts +711 -0
  48. package/generated/render-script-modules/bullet3d.d.ts +73 -0
  49. package/generated/render-script-modules/collectionfactory.d.ts +24 -0
  50. package/generated/render-script-modules/collectionproxy.d.ts +39 -0
  51. package/generated/render-script-modules/factory.d.ts +24 -0
  52. package/generated/render-script-modules/go.d.ts +434 -0
  53. package/generated/render-script-modules/label.d.ts +105 -0
  54. package/generated/render-script-modules/model.d.ts +121 -0
  55. package/generated/render-script-modules/particlefx.d.ts +59 -0
  56. package/generated/render-script-modules/physics.d.ts +333 -0
  57. package/generated/render-script-modules/resource.d.ts +1232 -0
  58. package/generated/render-script-modules/sound.d.ts +227 -0
  59. package/generated/render-script-modules/sprite.d.ts +68 -0
  60. package/generated/render-script-modules/tilemap.d.ts +43 -0
  61. package/generated/render.d.ts +172 -47
  62. package/generated/resource.d.ts +81 -61
  63. package/generated/socket.d.ts +18 -23
  64. package/generated/sound.d.ts +6 -6
  65. package/generated/sprite.d.ts +51 -3
  66. package/generated/sys.d.ts +87 -24
  67. package/generated/tilemap.d.ts +3 -3
  68. package/generated/timer.d.ts +3 -3
  69. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  70. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  71. package/generated/versions/defold-1.12.4/buffer.d.ts +8 -8
  72. package/generated/versions/defold-1.12.4/go.d.ts +117 -345
  73. package/generated/versions/defold-1.12.4/graphics.d.ts +2 -1
  74. package/generated/versions/defold-1.12.4/gui.d.ts +169 -532
  75. package/generated/versions/defold-1.12.4/http.d.ts +2 -2
  76. package/generated/versions/defold-1.12.4/image.d.ts +82 -2
  77. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  78. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  79. package/generated/versions/defold-1.12.4/liveupdate.d.ts +4 -0
  80. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  81. package/generated/versions/defold-1.12.4/particlefx.d.ts +23 -2
  82. package/generated/versions/defold-1.12.4/physics.d.ts +46 -2
  83. package/generated/versions/defold-1.12.4/render.d.ts +83 -7
  84. package/generated/versions/defold-1.12.4/resource.d.ts +50 -17
  85. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  86. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  87. package/generated/versions/defold-1.12.4/sprite.d.ts +59 -2
  88. package/generated/versions/defold-1.12.4/sys.d.ts +103 -8
  89. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  90. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -24
  91. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  92. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  93. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  94. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  95. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  96. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  97. package/generated/versions/defold-1.13.0/buffer.d.ts +8 -8
  98. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  99. package/generated/versions/defold-1.13.0/go.d.ts +117 -372
  100. package/generated/versions/defold-1.13.0/graphics.d.ts +2 -1
  101. package/generated/versions/defold-1.13.0/gui.d.ts +169 -532
  102. package/generated/versions/defold-1.13.0/http.d.ts +2 -2
  103. package/generated/versions/defold-1.13.0/image.d.ts +82 -2
  104. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  105. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  106. package/generated/versions/defold-1.13.0/liveupdate.d.ts +4 -0
  107. package/generated/versions/defold-1.13.0/material.d.ts +3 -1
  108. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  109. package/generated/versions/defold-1.13.0/particlefx.d.ts +23 -2
  110. package/generated/versions/defold-1.13.0/physics.d.ts +46 -2
  111. package/generated/versions/defold-1.13.0/render.d.ts +147 -9
  112. package/generated/versions/defold-1.13.0/resource.d.ts +50 -17
  113. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  114. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  115. package/generated/versions/defold-1.13.0/sprite.d.ts +59 -2
  116. package/generated/versions/defold-1.13.0/sys.d.ts +103 -8
  117. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  118. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -24
  119. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  120. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  121. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  122. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  123. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  124. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  125. package/generated/versions/defold-1.13.1/buffer.d.ts +8 -8
  126. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  127. package/generated/versions/defold-1.13.1/go.d.ts +117 -372
  128. package/generated/versions/defold-1.13.1/graphics.d.ts +2 -1
  129. package/generated/versions/defold-1.13.1/gui.d.ts +169 -548
  130. package/generated/versions/defold-1.13.1/http.d.ts +2 -2
  131. package/generated/versions/defold-1.13.1/image.d.ts +82 -2
  132. package/generated/versions/defold-1.13.1/index.d.ts +2 -0
  133. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  134. package/generated/versions/defold-1.13.1/liveupdate.d.ts +4 -0
  135. package/generated/versions/defold-1.13.1/material.d.ts +3 -1
  136. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  137. package/generated/versions/defold-1.13.1/particlefx.d.ts +23 -2
  138. package/generated/versions/defold-1.13.1/physics.d.ts +46 -2
  139. package/generated/versions/defold-1.13.1/render.d.ts +147 -9
  140. package/generated/versions/defold-1.13.1/resource.d.ts +50 -17
  141. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  142. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  143. package/generated/versions/defold-1.13.1/sprite.d.ts +59 -2
  144. package/generated/versions/defold-1.13.1/sys.d.ts +103 -8
  145. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  146. package/generated/versions/defold-1.13.1/vmath.d.ts +0 -24
  147. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  148. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  149. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  150. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  151. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  152. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  153. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  154. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  155. package/generated/versions/defold-1.13.2/buffer.d.ts +10 -11
  156. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  157. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +10 -10
  158. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +173 -71
  159. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  160. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  161. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  162. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  163. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  164. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  165. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  166. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  167. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  168. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  169. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  170. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  171. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  172. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  173. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  174. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  175. package/generated/versions/defold-1.13.2/go.d.ts +122 -230
  176. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -24
  177. package/generated/versions/defold-1.13.2/gui.d.ts +186 -423
  178. package/generated/versions/defold-1.13.2/http.d.ts +3 -3
  179. package/generated/versions/defold-1.13.2/image.d.ts +63 -11
  180. package/generated/versions/defold-1.13.2/index.d.ts +2 -0
  181. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  182. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  183. package/generated/versions/defold-1.13.2/liveupdate.d.ts +7 -3
  184. package/generated/versions/defold-1.13.2/material.d.ts +49 -49
  185. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  186. package/generated/versions/defold-1.13.2/particlefx.d.ts +24 -5
  187. package/generated/versions/defold-1.13.2/physics.d.ts +64 -20
  188. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  189. package/generated/versions/defold-1.13.2/render.d.ts +161 -46
  190. package/generated/versions/defold-1.13.2/resource.d.ts +81 -61
  191. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  192. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  193. package/generated/versions/defold-1.13.2/sprite.d.ts +51 -3
  194. package/generated/versions/defold-1.13.2/sys.d.ts +87 -24
  195. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  196. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  197. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -25
  198. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  199. package/generated/vmath.d.ts +0 -25
  200. package/generated/window.d.ts +8 -10
  201. package/identity-vocabulary.json +86 -34
  202. package/index.d.ts +2 -0
  203. package/package.json +3 -1
  204. package/scripts/generate-api-availability.ts +10 -24
  205. package/scripts/generate-api-signatures.ts +75 -14
  206. package/scripts/materialize-version.ts +48 -7
  207. package/scripts/regen.ts +214 -19
  208. package/scripts/shared-handle-methods.ts +3 -2
  209. package/scripts/signature-store-fs.ts +1 -0
  210. package/scripts/target-version.ts +26 -0
  211. package/src/api-doc.ts +34 -0
  212. package/src/api-identity.ts +32 -1
  213. package/src/component-properties.d.ts +96 -7
  214. package/src/core-types.ts +71 -28
  215. package/src/doc-corrections.ts +62 -5
  216. package/src/emit-dts.ts +1423 -401
  217. package/src/engine-globals.d.ts +5 -1
  218. package/src/engine-type-name.ts +33 -0
  219. package/src/go-overloads.d.ts +74 -19
  220. package/src/gui-overloads.d.ts +489 -0
  221. package/src/gui-texture-removal.d.ts +41 -0
  222. package/src/index.ts +3 -0
  223. package/src/lifecycle.ts +32 -23
  224. package/src/msg-overloads.d.ts +25 -13
  225. package/src/signature-store.ts +50 -0
  226. package/src/socket-types.d.ts +3 -3
  227. package/src/timers.d.ts +2 -1
  228. package/src/vmath-overloads.d.ts +26 -0
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * Axis-aligned bounding box
11
11
  */
12
- interface aabb {
12
+ interface Aabb {
13
13
  /**
14
14
  * minimum local-space bounds
15
15
  */
@@ -22,7 +22,7 @@ declare global {
22
22
  /**
23
23
  * Model animation playback properties
24
24
  */
25
- interface play_properties {
25
+ interface PlayProperties {
26
26
  /**
27
27
  * duration of a linear blend from the current animation
28
28
  */
@@ -53,7 +53,7 @@ declare global {
53
53
  * model.get_aabb("#empty"); // => { min = vmath.vector3(0, 0, 0), max = vmath.vector3(0, 0, 0) }
54
54
  * ```
55
55
  */
56
- function get_aabb(url: string | Hash | Url): model.aabb;
56
+ function get_aabb(url: string | Hash | Url): model.Aabb;
57
57
  /**
58
58
  * Returns a table of numbers with one entry per morph target on the first mesh of the model that has morph targets.
59
59
  * Values reflect the rig state at call time (after animation, and any active script override from model.set_blend_weights).
@@ -106,7 +106,7 @@ declare global {
106
106
  * model.get_mesh_aabb("#model"); // => { hash("Sword") = { min = vmath.vector3(-0.5, -0.5, 0), max = vmath.vector3(0.5, 0.5, 0) }, hash("Shield") = { min = vmath.vector3(-0.5, -0.5, -0.5), max = vmath.vector3(0.5, 0.5, 0.5) } }
107
107
  * ```
108
108
  */
109
- function get_mesh_aabb(url: string | Hash | Url): LuaTable<Hash, model.aabb>;
109
+ function get_mesh_aabb(url: string | Hash | Url): LuaTable<Hash, model.Aabb>;
110
110
  /**
111
111
  * Get the enabled state of a mesh
112
112
  *
@@ -183,7 +183,7 @@ declare global {
183
183
  * });
184
184
  * ```
185
185
  */
186
- function play_anim(url: string | Hash | Url, anim_id: string | Hash, playback: go.PLAYBACK, play_properties?: model.play_properties, complete_function?: (self: unknown, message_id: Hash, message: BuiltinMessages["model_animation_done"]) => void): void;
186
+ function play_anim(url: string | Hash | Url, anim_id: string | Hash, playback: go.Playback, play_properties?: model.PlayProperties, complete_function?: (self: unknown, message_id: Hash, message: BuiltinMessages["model_animation_done"]) => void): void;
187
187
  /**
188
188
  * Resets a shader constant for a model component.
189
189
  * The constant must be defined in the material assigned to the model.
@@ -233,7 +233,7 @@ declare global {
233
233
  * ```
234
234
  */
235
235
  function set_mesh_enabled(url: string | Hash | Url, mesh_id: string | Hash, enabled: boolean): void;
236
- interface properties {
236
+ interface Properties {
237
237
  /**
238
238
  * The current animation set on the component. The type of the property is hash.
239
239
  */
@@ -248,37 +248,69 @@ declare global {
248
248
  */
249
249
  playback_rate: number;
250
250
  /**
251
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
251
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
252
252
  */
253
253
  texture0: Hash;
254
254
  /**
255
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
255
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
256
256
  */
257
257
  texture1: Hash;
258
258
  /**
259
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
259
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
260
260
  */
261
261
  texture2: Hash;
262
262
  /**
263
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
263
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
264
264
  */
265
265
  texture3: Hash;
266
266
  /**
267
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
267
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
268
268
  */
269
269
  texture4: Hash;
270
270
  /**
271
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
271
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
272
272
  */
273
273
  texture5: Hash;
274
274
  /**
275
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
275
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
276
276
  */
277
277
  texture6: Hash;
278
278
  /**
279
- * The texture hash id of the model. Used for getting/setting model texture for unit 0-7
279
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
280
280
  */
281
281
  texture7: Hash;
282
+ /**
283
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
284
+ */
285
+ texture8: Hash;
286
+ /**
287
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
288
+ */
289
+ texture9: Hash;
290
+ /**
291
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
292
+ */
293
+ texture10: Hash;
294
+ /**
295
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
296
+ */
297
+ texture11: Hash;
298
+ /**
299
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
300
+ */
301
+ texture12: Hash;
302
+ /**
303
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
304
+ */
305
+ texture13: Hash;
306
+ /**
307
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
308
+ */
309
+ texture14: Hash;
310
+ /**
311
+ * The texture hash id of the model, read and written on the texture unit the key's number names (`texture3` is unit 3).
312
+ */
313
+ texture15: Hash;
282
314
  }
283
315
  }
284
316
  }
@@ -10,13 +10,13 @@ declare global {
10
10
  /**
11
11
  * Options used when stopping particle effects.
12
12
  */
13
- interface stop_options {
13
+ interface StopOptions {
14
14
  /**
15
15
  * Instantly clear spawned particles.
16
16
  */
17
17
  clear?: boolean;
18
18
  }
19
- type EMITTER_STATE = typeof particlefx.EMITTER_STATE_POSTSPAWN | typeof particlefx.EMITTER_STATE_PRESPAWN | typeof particlefx.EMITTER_STATE_SLEEPING | typeof particlefx.EMITTER_STATE_SPAWNING;
19
+ type EmitterState = typeof particlefx.EMITTER_STATE_POSTSPAWN | typeof particlefx.EMITTER_STATE_PRESPAWN | typeof particlefx.EMITTER_STATE_SLEEPING | typeof particlefx.EMITTER_STATE_SPAWNING;
20
20
  /**
21
21
  * postspawn state The emitter is not spawning any particles, but has particles that are still alive.
22
22
  */
@@ -57,7 +57,7 @@ declare global {
57
57
  * });
58
58
  * ```
59
59
  */
60
- function play(url: string | Hash | Url, emitter_state_function?: (self: unknown, id: Hash, emitter: Hash, state: particlefx.EMITTER_STATE) => void): void;
60
+ function play(url: string | Hash | Url, emitter_state_function?: (self: unknown, id: Hash, emitter: Hash, state: particlefx.EmitterState) => void): void;
61
61
  /**
62
62
  * Resets a shader constant for a particle FX component emitter.
63
63
  * The constant must be defined in the material assigned to the emitter.
@@ -128,8 +128,27 @@ declare global {
128
128
  * });
129
129
  * ```
130
130
  */
131
- function stop(url: string | Hash | Url, options?: particlefx.stop_options): void;
132
- interface properties {
131
+ function stop(url: string | Hash | Url): void;
132
+ /**
133
+ * Stops a particle FX component from playing.
134
+ * Stopping a particle FX does not remove already spawned particles.
135
+ * Which particle FX to stop is identified by the URL.
136
+ *
137
+ * @param url - the particle fx that should stop playing
138
+ * @param options - options used when stopping the particle fx
139
+ * @example
140
+ * ```ts
141
+ * // How to stop a particle fx when a game object is deleted and immediately also
142
+ * // clear any spawned particles:
143
+ * export default defineScript({
144
+ * final(self) {
145
+ * particlefx.stop("#particlefx", { clear: true });
146
+ * },
147
+ * });
148
+ * ```
149
+ */
150
+ function stop(url: string | Hash | Url, options: particlefx.StopOptions): void;
151
+ interface Properties {
133
152
  /**
134
153
  * The animation used during rendering by an emitter in a particle FX component.
135
154
  * The property type is a hash and refers to a valid animation in an atlas or a tile source resource.
@@ -6,11 +6,11 @@ declare global {
6
6
  * Collision object physics API documentation
7
7
  */
8
8
  namespace physics {
9
- type event = BuiltinMessages["contact_point_event"] & { type: Hash<"contact_point_event"> } | BuiltinMessages["collision_event"] & { type: Hash<"collision_event"> } | BuiltinMessages["trigger_event"] & { type: Hash<"trigger_event"> } | BuiltinMessages["ray_cast_response"] & { type: Hash<"ray_cast_response"> } | BuiltinMessages["ray_cast_missed"] & { type: Hash<"ray_cast_missed"> };
9
+ type Event = BuiltinMessages["contact_point_event"] & { type: Hash<"contact_point_event"> } | BuiltinMessages["collision_event"] & { type: Hash<"collision_event"> } | BuiltinMessages["trigger_event"] & { type: Hash<"trigger_event"> } | BuiltinMessages["ray_cast_response"] & { type: Hash<"ray_cast_response"> } | BuiltinMessages["ray_cast_missed"] & { type: Hash<"ray_cast_missed"> };
10
10
  /**
11
11
  * The available fields depend on the joint type.
12
12
  */
13
- interface joint_properties {
13
+ interface JointProperties {
14
14
  /**
15
15
  * whether the connected objects should collide
16
16
  */
@@ -79,7 +79,7 @@ declare global {
79
79
  /**
80
80
  * The available optional fields depend on the joint type.
81
81
  */
82
- interface joint_properties_info {
82
+ interface JointPropertiesInfo {
83
83
  /**
84
84
  * whether the connected objects collide
85
85
  */
@@ -160,7 +160,7 @@ declare global {
160
160
  /**
161
161
  * Ray-cast options
162
162
  */
163
- interface raycast_options {
163
+ interface RaycastOptions {
164
164
  /**
165
165
  * Return every hit instead of only the closest hit.
166
166
  */
@@ -169,11 +169,11 @@ declare global {
169
169
  /**
170
170
  * The available geometry fields depend on `type`.
171
171
  */
172
- interface shape_data {
172
+ interface ShapeData {
173
173
  /**
174
174
  * shape type
175
175
  */
176
- type: physics.SHAPE_TYPE;
176
+ type: physics.ShapeType;
177
177
  /**
178
178
  * sphere diameter or capsule pole diameter
179
179
  */
@@ -187,8 +187,8 @@ declare global {
187
187
  */
188
188
  height?: number;
189
189
  }
190
- type JOINT_TYPE = typeof physics.JOINT_TYPE_FIXED | typeof physics.JOINT_TYPE_HINGE | typeof physics.JOINT_TYPE_SLIDER | typeof physics.JOINT_TYPE_SPRING | typeof physics.JOINT_TYPE_WELD | typeof physics.JOINT_TYPE_WHEEL;
191
- type SHAPE_TYPE = typeof physics.SHAPE_TYPE_BOX | typeof physics.SHAPE_TYPE_CAPSULE | typeof physics.SHAPE_TYPE_HULL | typeof physics.SHAPE_TYPE_MESH | typeof physics.SHAPE_TYPE_SPHERE;
190
+ type JointType = typeof physics.JOINT_TYPE_FIXED | typeof physics.JOINT_TYPE_HINGE | typeof physics.JOINT_TYPE_SLIDER | typeof physics.JOINT_TYPE_SPRING | typeof physics.JOINT_TYPE_WELD | typeof physics.JOINT_TYPE_WHEEL;
191
+ type ShapeType = typeof physics.SHAPE_TYPE_BOX | typeof physics.SHAPE_TYPE_CAPSULE | typeof physics.SHAPE_TYPE_HULL | typeof physics.SHAPE_TYPE_MESH | typeof physics.SHAPE_TYPE_SPHERE;
192
192
  /**
193
193
  * Fixed joint; uses `max_length` from physics.joint_properties.
194
194
  */
@@ -245,7 +245,7 @@ declare global {
245
245
  * @param position_b - local position where to attach the joint on the second collision object
246
246
  * @param properties - optional joint-specific properties
247
247
  */
248
- function create_joint(joint_type: physics.JOINT_TYPE, collisionobject_a: string | Hash | Url, joint_id: string | Hash, position_a: Vector3, collisionobject_b: string | Hash | Url, position_b: Vector3, properties?: physics.joint_properties): void;
248
+ function create_joint(joint_type: physics.JointType, collisionobject_a: string | Hash | Url, joint_id: string | Hash, position_a: Vector3, collisionobject_b: string | Hash | Url, position_b: Vector3, properties?: physics.JointProperties): void;
249
249
  /**
250
250
  * Destroy an already physics joint. The joint has to be created before a
251
251
  * destroy can be issued.
@@ -297,7 +297,7 @@ declare global {
297
297
  * @param joint_id - id of the joint
298
298
  * @returns joint properties
299
299
  */
300
- function get_joint_properties(collisionobject: string | Hash | Url, joint_id: string | Hash): physics.joint_properties_info;
300
+ function get_joint_properties(collisionobject: string | Hash | Url, joint_id: string | Hash): physics.JointPropertiesInfo;
301
301
  /**
302
302
  * Get the reaction force for a joint. The joint has to be created before
303
303
  * the reaction force can be calculated.
@@ -350,7 +350,7 @@ declare global {
350
350
  * }
351
351
  * ```
352
352
  */
353
- function get_shape(url: string | Hash | Url, shape: string | Hash): physics.shape_data;
353
+ function get_shape(url: string | Hash | Url, shape: string | Hash): physics.ShapeData;
354
354
  /**
355
355
  * Ray casts are used to test for intersections against collision objects in the physics world.
356
356
  * Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
@@ -391,7 +391,7 @@ declare global {
391
391
  * });
392
392
  * ```
393
393
  */
394
- function raycast(from: Vector3, to: Vector3, groups: Hash[], options?: physics.raycast_options): Omit<BuiltinMessages["ray_cast_response"], "request_id">[] | Omit<BuiltinMessages["ray_cast_response"], "request_id"> | undefined;
394
+ function raycast(from: Vector3, to: Vector3, groups: Hash[], options?: physics.RaycastOptions): Omit<BuiltinMessages["ray_cast_response"], "request_id">[] | Omit<BuiltinMessages["ray_cast_response"], "request_id"> | undefined;
395
395
  /**
396
396
  * Ray casts are used to test for intersections against collision objects in the physics world.
397
397
  * Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
@@ -435,7 +435,51 @@ declare global {
435
435
  * });
436
436
  * ```
437
437
  */
438
- function raycast_async(from: Vector3, to: Vector3, groups: Hash[], request_id?: number): void;
438
+ function raycast_async(from: Vector3, to: Vector3, groups: Hash[]): void;
439
+ /**
440
+ * Ray casts are used to test for intersections against collision objects in the physics world.
441
+ * Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
442
+ * do not intersect with ray casts.
443
+ * Which collision objects to hit is filtered by their collision groups and can be configured
444
+ * through `groups`.
445
+ * The actual ray cast will be performed during the physics-update.
446
+ *
447
+ * - If an object is hit, the result will be reported via a ray_cast_response message.
448
+ * - If there is no object hit, the result will be reported via a ray_cast_missed message.
449
+ *
450
+ * NOTE: Ray casts will ignore collision objects that contain the starting point of the ray. This is a limitation in Box2D.
451
+ *
452
+ * @param from - the world position of the start of the ray
453
+ * @param to - the world position of the end of the ray
454
+ * @param groups - a lua table containing the hashed groups for which to test collisions against
455
+ * @param request_id - a number in range [0,255]. It will be sent back in the response for identification, 0 by default
456
+ * @example
457
+ * ```ts
458
+ * // How to perform a ray cast asynchronously:
459
+ * export default defineScript({
460
+ * init() {
461
+ * return { my_groups: [hash("my_group1"), hash("my_group2")] };
462
+ * },
463
+ *
464
+ * update(self, dt) {
465
+ * // request ray cast
466
+ * const my_start = go.get_world_position();
467
+ * const my_end = vmath.vector3(my_start.x, my_start.y - 100, my_start.z);
468
+ * physics.raycast_async(my_start, my_end, self.my_groups);
469
+ * },
470
+ *
471
+ * on_message(self, message_id, message, sender) {
472
+ * // check for the response
473
+ * if (message_id === hash("ray_cast_response")) {
474
+ * // act on the hit
475
+ * } else if (message_id === hash("ray_cast_missed")) {
476
+ * // act on the miss
477
+ * }
478
+ * },
479
+ * });
480
+ * ```
481
+ */
482
+ function raycast_async(from: Vector3, to: Vector3, groups: Hash[], request_id: number): void;
439
483
  /**
440
484
  * Only one physics world event listener can be set at a time.
441
485
  *
@@ -533,7 +577,7 @@ declare global {
533
577
  * });
534
578
  * ```
535
579
  */
536
- function set_event_listener(callback?: (self: unknown, events: physics.event[]) => void): void;
580
+ function set_event_listener(callback?: (self: unknown, events: physics.Event[]) => void): void;
537
581
  /**
538
582
  * Set the gravity in runtime. The gravity change is not global, it will only affect
539
583
  * the collection that the function is called from.
@@ -593,7 +637,7 @@ declare global {
593
637
  * @param properties - joint specific properties table
594
638
  * Note: The `collide_connected` field cannot be updated/changed after a connection has been made.
595
639
  */
596
- function set_joint_properties(collisionobject: string | Hash | Url, joint_id: string | Hash, properties: physics.joint_properties): void;
640
+ function set_joint_properties(collisionobject: string | Hash | Url, joint_id: string | Hash, properties: physics.JointProperties): void;
597
641
  /**
598
642
  * Sets or clears the masking of a group (maskbit) in a collision object.
599
643
  *
@@ -642,7 +686,7 @@ declare global {
642
686
  * }
643
687
  * ```
644
688
  */
645
- function set_shape(url: string | Hash | Url, shape: string | Hash, table: physics.shape_data): void;
689
+ function set_shape(url: string | Hash | Url, shape: string | Hash, table: physics.ShapeData): void;
646
690
  /**
647
691
  * Flips the collision shapes vertically for a collision object
648
692
  *
@@ -694,7 +738,7 @@ declare global {
694
738
  /**
695
739
  * collision object information
696
740
  */
697
- interface collision_info {
741
+ interface CollisionInfo {
698
742
  /**
699
743
  * object position in world space
700
744
  */
@@ -711,7 +755,7 @@ declare global {
711
755
  /**
712
756
  * contact-point object information
713
757
  */
714
- interface contact_point_info {
758
+ interface ContactPointInfo {
715
759
  /**
716
760
  * contact point position in world space
717
761
  */
@@ -744,7 +788,7 @@ declare global {
744
788
  /**
745
789
  * trigger interaction object information
746
790
  */
747
- interface trigger_info {
791
+ interface TriggerInfo {
748
792
  /**
749
793
  * object identifier
750
794
  */
@@ -756,7 +800,7 @@ declare global {
756
800
  }
757
801
  }
758
802
  }
759
- interface properties {
803
+ interface Properties {
760
804
  /**
761
805
  * The angular damping value for the collision object. Setting this value alters the damping of
762
806
  * angular motion of the object (rotation). Valid values are between 0 (no damping) and 1 (full damping).
@@ -5,10 +5,8 @@ declare global {
5
5
  * More detailed [profiling](https://www.defold.com/manuals/profiling/) and [debugging](http://www.defold.com/manuals/debugging/) information available in the manuals.
6
6
  */
7
7
  namespace profiler {
8
- type Mode = typeof profiler.MODE_RUN | typeof profiler.MODE_PAUSE | typeof profiler.MODE_SHOW_PEAK_FRAME | typeof profiler.MODE_RECORD;
8
+ type Mode = typeof profiler.MODE_PAUSE | typeof profiler.MODE_RECORD | typeof profiler.MODE_RUN | typeof profiler.MODE_SHOW_PEAK_FRAME;
9
9
  type ViewMode = typeof profiler.VIEW_MODE_FULL | typeof profiler.VIEW_MODE_MINIMIZED;
10
- type MODE = typeof profiler.MODE_PAUSE | typeof profiler.MODE_RECORD | typeof profiler.MODE_RUN | typeof profiler.MODE_SHOW_PEAK_FRAME;
11
- type VIEW_MODE = typeof profiler.VIEW_MODE_FULL | typeof profiler.VIEW_MODE_MINIMIZED;
12
10
  /**
13
11
  * pause on the currently displayed frame
14
12
  */
@@ -173,7 +171,7 @@ declare global {
173
171
  * }
174
172
  * ```
175
173
  */
176
- function set_ui_mode(mode: profiler.MODE): void;
174
+ function set_ui_mode(mode: profiler.Mode): void;
177
175
  /**
178
176
  * Set the on-screen profile view mode - minimized or expanded
179
177
  *
@@ -184,7 +182,7 @@ declare global {
184
182
  * profiler.set_ui_view_mode(profiler.VIEW_MODE_MINIMIZED);
185
183
  * ```
186
184
  */
187
- function set_ui_view_mode(mode: profiler.VIEW_MODE): void;
185
+ function set_ui_view_mode(mode: profiler.ViewMode): void;
188
186
  /**
189
187
  * Shows or hides the time the engine waits for vsync in the on-screen profiler
190
188
  * Each frame the engine waits for vsync and depending on your vsync settings and how much time