@defold-typescript/types 0.40.0 → 0.41.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 (224) hide show
  1. package/api-availability.json +3963 -772
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18069 -10240
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +560 -89
  6. package/fixtures/messages_doc.json +96 -0
  7. package/generated/b2d.d.ts +680 -4
  8. package/generated/b2d_body.d.ts +29 -103
  9. package/generated/b2d_chain.d.ts +5 -6
  10. package/generated/b2d_fixture.d.ts +34 -38
  11. package/generated/b2d_joint.d.ts +503 -25
  12. package/generated/b2d_shape.d.ts +183 -20
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +16 -15
  15. package/generated/builtin-messages.d.ts +7 -1
  16. package/generated/bullet3d.d.ts +91 -0
  17. package/generated/bullet3d_collision_object.d.ts +433 -0
  18. package/generated/bullet3d_constraint.d.ts +818 -0
  19. package/generated/bullet3d_rigid_body.d.ts +429 -0
  20. package/generated/bullet3d_shape.d.ts +123 -0
  21. package/generated/bullet3d_world.d.ts +492 -0
  22. package/generated/camera.d.ts +29 -32
  23. package/generated/collectionfactory.d.ts +15 -18
  24. package/generated/collectionproxy.d.ts +22 -6
  25. package/generated/compute.d.ts +12 -238
  26. package/generated/crash.d.ts +24 -10
  27. package/generated/editor-vm/http.d.ts +90 -7
  28. package/generated/editor-vm/image.d.ts +7 -7
  29. package/generated/editor-vm/json.d.ts +11 -0
  30. package/generated/editor-vm/localization.d.ts +7 -7
  31. package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
  32. package/generated/editor-vm/zip.d.ts +28 -0
  33. package/generated/editor.d.ts +1496 -430
  34. package/generated/factory.d.ts +21 -25
  35. package/generated/font.d.ts +64 -22
  36. package/generated/go.d.ts +235 -182
  37. package/generated/graphics.d.ts +335 -97
  38. package/generated/gui.d.ts +240 -471
  39. package/generated/html5.d.ts +2 -2
  40. package/generated/http.d.ts +28 -35
  41. package/generated/image.d.ts +105 -72
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +7 -0
  44. package/generated/kinds/render-script.d.ts +7 -0
  45. package/generated/kinds/script.d.ts +7 -0
  46. package/generated/label.d.ts +77 -7
  47. package/generated/liveupdate.d.ts +13 -10
  48. package/generated/material.d.ts +312 -360
  49. package/generated/model.d.ts +40 -39
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +365 -133
  52. package/generated/profiler.d.ts +13 -23
  53. package/generated/render.d.ts +237 -297
  54. package/generated/resource.d.ts +664 -583
  55. package/generated/socket.d.ts +120 -133
  56. package/generated/sound.d.ts +62 -31
  57. package/generated/sprite.d.ts +31 -17
  58. package/generated/sys.d.ts +234 -190
  59. package/generated/tilemap.d.ts +21 -16
  60. package/generated/timer.d.ts +34 -21
  61. package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
  62. package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
  63. package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
  65. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
  68. package/generated/versions/defold-1.12.4/go.d.ts +6 -12
  69. package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
  70. package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/http.d.ts +0 -13
  72. package/generated/versions/defold-1.12.4/image.d.ts +16 -33
  73. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  74. package/generated/versions/defold-1.12.4/json.d.ts +10 -6
  75. package/generated/versions/defold-1.12.4/label.d.ts +2 -3
  76. package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
  77. package/generated/versions/defold-1.12.4/model.d.ts +2 -10
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
  81. package/generated/versions/defold-1.12.4/render.d.ts +99 -128
  82. package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
  83. package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
  84. package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
  86. package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
  87. package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
  88. package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
  89. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
  90. package/generated/versions/defold-1.12.4/window.d.ts +1 -16
  91. package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
  92. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
  93. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
  94. package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
  95. package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
  96. package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
  100. package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
  102. package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
  103. package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
  104. package/generated/versions/defold-1.13.0/go.d.ts +6 -12
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
  107. package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
  108. package/generated/versions/defold-1.13.0/http.d.ts +0 -13
  109. package/generated/versions/defold-1.13.0/image.d.ts +16 -33
  110. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  111. package/generated/versions/defold-1.13.0/json.d.ts +10 -6
  112. package/generated/versions/defold-1.13.0/label.d.ts +2 -3
  113. package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
  114. package/generated/versions/defold-1.13.0/material.d.ts +68 -106
  115. package/generated/versions/defold-1.13.0/model.d.ts +2 -10
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
  119. package/generated/versions/defold-1.13.0/render.d.ts +99 -128
  120. package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
  121. package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
  122. package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
  124. package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
  125. package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
  126. package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
  127. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
  128. package/generated/versions/defold-1.13.0/window.d.ts +1 -16
  129. package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
  130. package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
  131. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
  132. package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
  133. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
  134. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
  135. package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
  136. package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
  137. package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
  138. package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
  139. package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
  140. package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
  141. package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
  142. package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
  143. package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
  144. package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
  145. package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
  146. package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
  147. package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
  148. package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
  149. package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
  150. package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
  151. package/generated/versions/defold-1.13.1/font.d.ts +81 -0
  152. package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
  153. package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
  154. package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
  155. package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
  156. package/generated/versions/defold-1.13.1/http.d.ts +77 -0
  157. package/generated/versions/defold-1.13.1/image.d.ts +131 -0
  158. package/generated/versions/defold-1.13.1/index.d.ts +57 -0
  159. package/generated/versions/defold-1.13.1/json.d.ts +80 -0
  160. package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
  161. package/generated/versions/defold-1.13.1/label.d.ts +93 -0
  162. package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
  163. package/generated/versions/defold-1.13.1/material.d.ts +408 -0
  164. package/generated/versions/defold-1.13.1/model.d.ts +272 -0
  165. package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
  166. package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
  167. package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
  168. package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
  169. package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
  170. package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
  171. package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
  172. package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
  173. package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
  174. package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
  175. package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
  176. package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
  177. package/generated/versions/defold-1.13.1/types.d.ts +61 -0
  178. package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
  179. package/generated/versions/defold-1.13.1/window.d.ts +183 -0
  180. package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
  181. package/generated/vmath.d.ts +1 -21
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +7 -0
  185. package/package.json +13 -2
  186. package/scripts/example-store-io.ts +12 -1
  187. package/scripts/extension-goldens.ts +1 -0
  188. package/scripts/fidelity-baseline.json +146 -46
  189. package/scripts/generate-api-availability.ts +90 -12
  190. package/scripts/generate-api-signatures.ts +12 -2
  191. package/scripts/import-defold-release.ts +85 -24
  192. package/scripts/prose-constants.ts +77 -16
  193. package/scripts/regen.ts +391 -77
  194. package/scripts/shared-handle-methods.ts +53 -0
  195. package/scripts/signature-store-fs.ts +1 -0
  196. package/scripts/sync-api-docs.ts +16 -5
  197. package/src/api-availability.ts +0 -0
  198. package/src/api-doc.ts +201 -3
  199. package/src/api-identity.ts +252 -0
  200. package/src/core-types.ts +26 -3
  201. package/src/correction-pins.ts +49 -0
  202. package/src/doc-comment.ts +104 -11
  203. package/src/doc-corrections.ts +108 -0
  204. package/src/editor-vm-globals.d.ts +5 -2
  205. package/src/emit-dts.ts +2064 -281
  206. package/src/emit-messages.ts +52 -0
  207. package/src/example-store.ts +125 -14
  208. package/src/field-correction-coverage.ts +204 -0
  209. package/src/fnv1a.ts +16 -0
  210. package/src/go-overloads.d.ts +25 -6
  211. package/src/index-base-table.ts +145 -0
  212. package/src/index-slot-classifications.ts +588 -0
  213. package/src/index.ts +38 -5
  214. package/src/library-index-slot-classifications.ts +332 -0
  215. package/src/lifecycle.ts +61 -199
  216. package/src/luals-type-expr.ts +354 -0
  217. package/src/msg-overloads.d.ts +0 -1
  218. package/src/param-correction-provenance.ts +8 -11
  219. package/src/render-overloads.d.ts +0 -15
  220. package/src/return-correction-provenance.ts +58 -16
  221. package/src/sys-overloads.d.ts +48 -0
  222. package/src/vmath-overloads.d.ts +27 -1
  223. package/src/window-event-guard.d.ts +6 -9
  224. package/url-parameters.json +1 -2
@@ -0,0 +1,400 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque, Vector3 } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Constants for functional shape tables used with `b2d.body.create_fixture`
7
+ * and returned from `b2d.fixture.get_shape`.
8
+ */
9
+ namespace b2d.shape {
10
+ type b2Shape = Opaque<"b2Shape">;
11
+ /**
12
+ * Uses the polygon enum value, but indicates the `hx`/`hy` box convenience format.
13
+ */
14
+ const SHAPE_TYPE_BOX: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_BOX" };
15
+ /**
16
+ * Capsule shape type.
17
+ */
18
+ const SHAPE_TYPE_CAPSULE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CAPSULE" };
19
+ /**
20
+ * Chain shape type.
21
+ */
22
+ const SHAPE_TYPE_CHAIN: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CHAIN" };
23
+ /**
24
+ * Circle shape type.
25
+ */
26
+ const SHAPE_TYPE_CIRCLE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CIRCLE" };
27
+ /**
28
+ * Edge shape type.
29
+ */
30
+ const SHAPE_TYPE_EDGE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_EDGE" };
31
+ /**
32
+ * Grid shape type.
33
+ */
34
+ const SHAPE_TYPE_GRID: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_GRID" };
35
+ /**
36
+ * Polygon shape type.
37
+ */
38
+ const SHAPE_TYPE_POLYGON: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_POLYGON" };
39
+ /**
40
+ * Segment shape type.
41
+ */
42
+ const SHAPE_TYPE_SEGMENT: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_SEGMENT" };
43
+ /**
44
+ * Check if contact events are enabled for a shape.
45
+ *
46
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
47
+ * @returns true if contact events are enabled
48
+ */
49
+ function are_contact_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
50
+ /**
51
+ * Check if contact events are enabled for a shape.
52
+ *
53
+ * @param body - The body that owns the shape.
54
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
55
+ * @returns true if contact events are enabled
56
+ */
57
+ function are_contact_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
58
+ /**
59
+ * Check if hit events are enabled for a shape.
60
+ *
61
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
62
+ * @returns true if hit events are enabled
63
+ */
64
+ function are_hit_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
65
+ /**
66
+ * Check if hit events are enabled for a shape.
67
+ *
68
+ * @param body - The body that owns the shape.
69
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
70
+ * @returns true if hit events are enabled
71
+ */
72
+ function are_hit_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
73
+ /**
74
+ * Check if pre-solve events are enabled for a shape.
75
+ *
76
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
77
+ * @returns true if pre-solve events are enabled
78
+ */
79
+ function are_pre_solve_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
80
+ /**
81
+ * Check if pre-solve events are enabled for a shape.
82
+ *
83
+ * @param body - The body that owns the shape.
84
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
85
+ * @returns true if pre-solve events are enabled
86
+ */
87
+ function are_pre_solve_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
88
+ /**
89
+ * Check if sensor events are enabled for a shape.
90
+ *
91
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
92
+ * @returns true if sensor events are enabled
93
+ */
94
+ function are_sensor_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
95
+ /**
96
+ * Check if sensor events are enabled for a shape.
97
+ *
98
+ * @param body - The body that owns the shape.
99
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
100
+ * @returns true if sensor events are enabled
101
+ */
102
+ function are_sensor_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
103
+ /**
104
+ * Enable or disable contact events for a shape.
105
+ *
106
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
107
+ * @param enable - true to enable contact events
108
+ */
109
+ function enable_contact_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
110
+ /**
111
+ * Enable or disable contact events for a shape.
112
+ *
113
+ * @param body - The body that owns the shape.
114
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
115
+ * @param enable - true to enable contact events
116
+ */
117
+ function enable_contact_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
118
+ /**
119
+ * Enable or disable hit events for a shape.
120
+ *
121
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
122
+ * @param enable - true to enable hit events
123
+ */
124
+ function enable_hit_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
125
+ /**
126
+ * Enable or disable hit events for a shape.
127
+ *
128
+ * @param body - The body that owns the shape.
129
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
130
+ * @param enable - true to enable hit events
131
+ */
132
+ function enable_hit_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
133
+ /**
134
+ * Enable or disable pre-solve events for a shape.
135
+ *
136
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
137
+ * @param enable - true to enable pre-solve events
138
+ */
139
+ function enable_pre_solve_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
140
+ /**
141
+ * Enable or disable pre-solve events for a shape.
142
+ *
143
+ * @param body - The body that owns the shape.
144
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
145
+ * @param enable - true to enable pre-solve events
146
+ */
147
+ function enable_pre_solve_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
148
+ /**
149
+ * Enable or disable sensor events for a shape.
150
+ *
151
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
152
+ * @param enable - true to enable sensor events
153
+ */
154
+ function enable_sensor_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
155
+ /**
156
+ * Enable or disable sensor events for a shape.
157
+ *
158
+ * @param body - The body that owns the shape.
159
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
160
+ * @param enable - true to enable sensor events
161
+ */
162
+ function enable_sensor_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
163
+ /**
164
+ * Get the body owning a shape.
165
+ *
166
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
167
+ * @returns owning body
168
+ */
169
+ function get_body(shape_id: Opaque<"b2Shape">): Opaque<"b2Body">;
170
+ /**
171
+ * Get the body owning a shape.
172
+ *
173
+ * @param body - The body that owns the shape.
174
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
175
+ * @returns owning body
176
+ */
177
+ function get_body(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2Body">;
178
+ /**
179
+ * Get the closest point on a shape.
180
+ *
181
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
182
+ * @param target - world target point
183
+ * @returns closest world point on the shape
184
+ */
185
+ function get_closest_point(shape_id: Opaque<"b2Shape">, target: Vector3): Vector3;
186
+ /**
187
+ * Get the closest point on a shape.
188
+ *
189
+ * @param body - The body that owns the shape.
190
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
191
+ * @param target - world target point
192
+ * @returns closest world point on the shape
193
+ */
194
+ function get_closest_point(body: Opaque<"b2Body">, shape_index: number, target: Vector3): Vector3;
195
+ /**
196
+ * Get shape contact capacity.
197
+ *
198
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
199
+ * @returns maximum contact data count
200
+ */
201
+ function get_contact_capacity(shape_id: Opaque<"b2Shape">): number;
202
+ /**
203
+ * Get shape contact capacity.
204
+ *
205
+ * @param body - The body that owns the shape.
206
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
207
+ * @returns maximum contact data count
208
+ */
209
+ function get_contact_capacity(body: Opaque<"b2Body">, shape_index: number): number;
210
+ /**
211
+ * Get touching contact data for a shape.
212
+ *
213
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
214
+ * @returns array of contact tables
215
+ */
216
+ function get_contact_data(shape_id: Opaque<"b2Shape">): Record<string | number, unknown>;
217
+ /**
218
+ * Get touching contact data for a shape.
219
+ *
220
+ * @param body - The body that owns the shape.
221
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
222
+ * @returns array of contact tables
223
+ */
224
+ function get_contact_data(body: Opaque<"b2Body">, shape_index: number): Record<string | number, unknown>;
225
+ /**
226
+ * Get mass data for a shape.
227
+ *
228
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
229
+ * @returns table with `mass`, `center`, and `inertia`
230
+ */
231
+ function get_mass_data(shape_id: Opaque<"b2Shape">): { mass: number; center: Vector3; inertia: number };
232
+ /**
233
+ * Get mass data for a shape.
234
+ *
235
+ * @param body - The body that owns the shape.
236
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
237
+ * @returns table with `mass`, `center`, and `inertia`
238
+ */
239
+ function get_mass_data(body: Opaque<"b2Body">, shape_index: number): { mass: number; center: Vector3; inertia: number };
240
+ /**
241
+ * Get shape material id.
242
+ *
243
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
244
+ * @returns shape material id
245
+ */
246
+ function get_material(shape_id: Opaque<"b2Shape">): number;
247
+ /**
248
+ * Get shape material id.
249
+ *
250
+ * @param body - The body that owns the shape.
251
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
252
+ * @returns shape material id
253
+ */
254
+ function get_material(body: Opaque<"b2Body">, shape_index: number): number;
255
+ /**
256
+ * Get sensor overlap capacity.
257
+ *
258
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
259
+ * @returns maximum sensor overlap count
260
+ */
261
+ function get_sensor_capacity(shape_id: Opaque<"b2Shape">): number;
262
+ /**
263
+ * Get sensor overlap capacity.
264
+ *
265
+ * @param body - The body that owns the shape.
266
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
267
+ * @returns maximum sensor overlap count
268
+ */
269
+ function get_sensor_capacity(body: Opaque<"b2Body">, shape_index: number): number;
270
+ /**
271
+ * Get sensor overlaps.
272
+ *
273
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
274
+ * @returns array of shape info tables
275
+ */
276
+ function get_sensor_overlaps(shape_id: Opaque<"b2Shape">): { shape_id: number }[];
277
+ /**
278
+ * Get sensor overlaps.
279
+ *
280
+ * @param body - The body that owns the shape.
281
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
282
+ * @returns array of shape info tables
283
+ */
284
+ function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): { shape_id: number }[];
285
+ /**
286
+ * Get a shape's geometry.
287
+ *
288
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
289
+ * @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
290
+ */
291
+ function get_shape(shape_id: Opaque<"b2Shape">): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3; center1?: Vector3; center2?: Vector3 };
292
+ /**
293
+ * Get a shape's geometry.
294
+ *
295
+ * @param body - The body that owns the shape.
296
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
297
+ * @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
298
+ */
299
+ function get_shape(body: Opaque<"b2Body">, shape_index: number): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3; center1?: Vector3; center2?: Vector3 };
300
+ /**
301
+ * Get the world owning a shape.
302
+ *
303
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
304
+ * @returns owning world
305
+ */
306
+ function get_world(shape_id: Opaque<"b2Shape">): Opaque<"b2World">;
307
+ /**
308
+ * Get the world owning a shape.
309
+ *
310
+ * @param body - The body that owns the shape.
311
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
312
+ * @returns owning world
313
+ */
314
+ function get_world(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2World">;
315
+ /**
316
+ * Validate a shape handle.
317
+ *
318
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
319
+ * @returns true if the shape handle still refers to a live Box2D shape
320
+ */
321
+ function is_valid(shape_id: Opaque<"b2Shape">): boolean;
322
+ /**
323
+ * Validate a shape handle.
324
+ *
325
+ * @param body - The body that owns the shape.
326
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
327
+ * @returns true if the shape handle still refers to a live Box2D shape
328
+ */
329
+ function is_valid(body: Opaque<"b2Body">, shape_index: number): boolean;
330
+ /**
331
+ * Ray cast a shape directly.
332
+ *
333
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
334
+ * @param origin - world ray origin
335
+ * @param translation - world ray translation
336
+ * @param max_fraction - optional maximum translation fraction, defaults to 1
337
+ * @returns hit table with `point`, `normal`, `fraction`, and `iterations`, or nil
338
+ */
339
+ function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number } | undefined;
340
+ /**
341
+ * Ray cast a shape directly.
342
+ *
343
+ * @param body - The body that owns the shape.
344
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
345
+ * @param origin - world ray origin
346
+ * @param translation - world ray translation
347
+ * @param max_fraction - optional maximum translation fraction, defaults to 1
348
+ * @returns hit table with `point`, `normal`, `fraction`, and `iterations`, or nil
349
+ */
350
+ function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number } | undefined;
351
+ /**
352
+ * Set shape material id.
353
+ *
354
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
355
+ * @param material - shape material id
356
+ */
357
+ function set_material(shape_id: Opaque<"b2Shape">, material: number): void;
358
+ /**
359
+ * Set shape material id.
360
+ *
361
+ * @param body - The body that owns the shape.
362
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
363
+ * @param material - shape material id
364
+ */
365
+ function set_material(body: Opaque<"b2Body">, shape_index: number, material: number): void;
366
+ /**
367
+ * This updates the shape geometry using the same table format as
368
+ * `b2d.body.create_shape` and `b2d.shape.get_shape`. The body mass is not
369
+ * updated unless `update_mass` is true.
370
+ *
371
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
372
+ * @param definition - shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
373
+ * @param update_mass - true to reset body mass from shapes
374
+ * @example
375
+ * ```ts
376
+ * const body = b2d.get_body("#collisionobject");
377
+ * if (body !== undefined) {
378
+ * const circle = b2d.shape.get_shape(body, 1);
379
+ * const radius = "radius" in circle ? circle.radius : undefined;
380
+ * b2d.shape.set_shape(body, 1, { type: b2d.shape.SHAPE_TYPE_CIRCLE, radius: radius ?? 16, center: vmath.vector3(24, 0, 0) }, true);
381
+ * b2d.shape.set_shape(body, 2, { type: b2d.shape.SHAPE_TYPE_SEGMENT, v1: vmath.vector3(-32, 0, 0), v2: vmath.vector3(32, 0, 0) });
382
+ * }
383
+ * ```
384
+ */
385
+ function set_shape(shape_id: Opaque<"b2Shape">, definition: { 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_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 }, update_mass?: boolean): void;
386
+ /**
387
+ * This updates the shape geometry using the same table format as
388
+ * `b2d.body.create_shape` and `b2d.shape.get_shape`. The body mass is not
389
+ * updated unless `update_mass` is true.
390
+ *
391
+ * @param body - The body that owns the shape.
392
+ * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
393
+ * @param definition - shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
394
+ * @param update_mass - true to reset body mass from shapes
395
+ */
396
+ function set_shape(body: Opaque<"b2Body">, shape_index: number, definition: { 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_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 }, update_mass?: boolean): void;
397
+ }
398
+ }
399
+
400
+ export {};