@defold-typescript/types 0.19.3 → 0.20.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 (86) hide show
  1. package/api-availability.json +2755 -0
  2. package/api-migrations.json +31 -0
  3. package/api-signatures.json +2324 -0
  4. package/api-targets.json +493 -45
  5. package/generated/b2d.d.ts +6 -0
  6. package/generated/b2d_body.d.ts +329 -1
  7. package/generated/b2d_chain.d.ts +106 -0
  8. package/generated/b2d_fixture.d.ts +155 -0
  9. package/generated/b2d_joint.d.ts +823 -0
  10. package/generated/b2d_shape.d.ts +215 -0
  11. package/generated/b2d_world.d.ts +314 -0
  12. package/generated/builtin-messages.d.ts +18 -0
  13. package/generated/camera.d.ts +62 -5
  14. package/generated/compute.d.ts +306 -0
  15. package/generated/go.d.ts +29 -4
  16. package/generated/graphics.d.ts +95 -0
  17. package/generated/gui.d.ts +1 -3
  18. package/generated/json.d.ts +2 -2
  19. package/generated/kinds/gui-script.d.ts +7 -0
  20. package/generated/kinds/render-script.d.ts +7 -0
  21. package/generated/kinds/script.d.ts +7 -0
  22. package/generated/label.d.ts +1 -1
  23. package/generated/liveupdate.d.ts +22 -4
  24. package/generated/material.d.ts +444 -0
  25. package/generated/model.d.ts +46 -5
  26. package/generated/physics.d.ts +1 -3
  27. package/generated/profiler.d.ts +2 -3
  28. package/generated/render.d.ts +25 -9
  29. package/generated/resource.d.ts +2 -2
  30. package/generated/sprite.d.ts +15 -1
  31. package/generated/tilemap.d.ts +14 -0
  32. package/generated/versions/defold-1.12.4/b2d.d.ts +27 -0
  33. package/generated/versions/defold-1.12.4/b2d_body.d.ts +348 -0
  34. package/generated/versions/defold-1.12.4/buffer.d.ts +176 -0
  35. package/generated/versions/defold-1.12.4/camera.d.ts +245 -0
  36. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +146 -0
  37. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +71 -0
  38. package/generated/versions/defold-1.12.4/crash.d.ts +143 -0
  39. package/generated/versions/defold-1.12.4/factory.d.ts +123 -0
  40. package/generated/versions/defold-1.12.4/font.d.ts +81 -0
  41. package/generated/versions/defold-1.12.4/go.d.ts +1029 -0
  42. package/generated/versions/defold-1.12.4/graphics.d.ts +226 -0
  43. package/generated/versions/defold-1.12.4/gui.d.ts +2372 -0
  44. package/generated/versions/defold-1.12.4/html5.d.ts +53 -0
  45. package/generated/versions/defold-1.12.4/http.d.ts +84 -0
  46. package/generated/versions/defold-1.12.4/iac.d.ts +18 -0
  47. package/generated/versions/defold-1.12.4/iap.d.ts +60 -0
  48. package/generated/versions/defold-1.12.4/image.d.ts +139 -0
  49. package/generated/versions/defold-1.12.4/index.d.ts +41 -0
  50. package/generated/versions/defold-1.12.4/json.d.ts +76 -0
  51. package/generated/versions/defold-1.12.4/label.d.ts +94 -0
  52. package/generated/versions/defold-1.12.4/liveupdate.d.ts +122 -0
  53. package/generated/versions/defold-1.12.4/model.d.ts +205 -0
  54. package/generated/versions/defold-1.12.4/msg.d.ts +10 -0
  55. package/generated/versions/defold-1.12.4/particlefx.d.ts +166 -0
  56. package/generated/versions/defold-1.12.4/physics.d.ts +547 -0
  57. package/generated/versions/defold-1.12.4/profiler.d.ts +234 -0
  58. package/generated/versions/defold-1.12.4/push.d.ts +66 -0
  59. package/generated/versions/defold-1.12.4/render.d.ts +1149 -0
  60. package/generated/versions/defold-1.12.4/resource.d.ts +1518 -0
  61. package/generated/versions/defold-1.12.4/socket.d.ts +795 -0
  62. package/generated/versions/defold-1.12.4/sound.d.ts +291 -0
  63. package/generated/versions/defold-1.12.4/sprite.d.ts +143 -0
  64. package/generated/versions/defold-1.12.4/sys.d.ts +695 -0
  65. package/generated/versions/defold-1.12.4/tilemap.d.ts +181 -0
  66. package/generated/versions/defold-1.12.4/timer.d.ts +114 -0
  67. package/generated/versions/defold-1.12.4/types.d.ts +61 -0
  68. package/generated/versions/defold-1.12.4/vmath.d.ts +806 -0
  69. package/generated/versions/defold-1.12.4/webview.d.ts +68 -0
  70. package/generated/versions/defold-1.12.4/window.d.ts +198 -0
  71. package/generated/versions/defold-1.12.4/zlib.d.ts +40 -0
  72. package/index.d.ts +22 -0
  73. package/package.json +8 -1
  74. package/scripts/fidelity-audit.ts +69 -12
  75. package/scripts/fidelity-baseline.json +56 -0
  76. package/scripts/generate-api-availability.ts +139 -0
  77. package/scripts/generate-api-signatures.ts +66 -0
  78. package/scripts/import-defold-release.ts +480 -0
  79. package/scripts/regen.ts +53 -6
  80. package/scripts/sync-api-docs.ts +89 -41
  81. package/src/api-availability.ts +0 -0
  82. package/src/core-types.ts +9 -0
  83. package/src/emit-dts.ts +674 -17
  84. package/src/emit-messages.ts +72 -2
  85. package/src/index.ts +26 -1
  86. package/src/lifecycle.ts +43 -2
@@ -0,0 +1,823 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque, Vector3 } from "../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Functions for interacting with native Box2D joints.
7
+ */
8
+ namespace b2d.joint {
9
+ type b2Joint = Opaque<"b2Joint">;
10
+ /**
11
+ * Distance joint type.
12
+ */
13
+ const JOINT_TYPE_DISTANCE: number & { readonly __brand: "b2d.joint.JOINT_TYPE_DISTANCE" };
14
+ /**
15
+ * Filter joint type.
16
+ */
17
+ const JOINT_TYPE_FILTER: number & { readonly __brand: "b2d.joint.JOINT_TYPE_FILTER" };
18
+ /**
19
+ * Friction joint type.
20
+ */
21
+ const JOINT_TYPE_FRICTION: number & { readonly __brand: "b2d.joint.JOINT_TYPE_FRICTION" };
22
+ /**
23
+ * Gear joint type.
24
+ */
25
+ const JOINT_TYPE_GEAR: number & { readonly __brand: "b2d.joint.JOINT_TYPE_GEAR" };
26
+ /**
27
+ * Motor joint type.
28
+ */
29
+ const JOINT_TYPE_MOTOR: number & { readonly __brand: "b2d.joint.JOINT_TYPE_MOTOR" };
30
+ /**
31
+ * Mouse joint type.
32
+ */
33
+ const JOINT_TYPE_MOUSE: number & { readonly __brand: "b2d.joint.JOINT_TYPE_MOUSE" };
34
+ /**
35
+ * Prismatic joint type.
36
+ */
37
+ const JOINT_TYPE_PRISMATIC: number & { readonly __brand: "b2d.joint.JOINT_TYPE_PRISMATIC" };
38
+ /**
39
+ * Pulley joint type.
40
+ */
41
+ const JOINT_TYPE_PULLEY: number & { readonly __brand: "b2d.joint.JOINT_TYPE_PULLEY" };
42
+ /**
43
+ * Revolute joint type.
44
+ */
45
+ const JOINT_TYPE_REVOLUTE: number & { readonly __brand: "b2d.joint.JOINT_TYPE_REVOLUTE" };
46
+ /**
47
+ * Rope joint type.
48
+ */
49
+ const JOINT_TYPE_ROPE: number & { readonly __brand: "b2d.joint.JOINT_TYPE_ROPE" };
50
+ /**
51
+ * Unknown joint type.
52
+ */
53
+ const JOINT_TYPE_UNKNOWN: number & { readonly __brand: "b2d.joint.JOINT_TYPE_UNKNOWN" };
54
+ /**
55
+ * Weld joint type.
56
+ */
57
+ const JOINT_TYPE_WELD: number & { readonly __brand: "b2d.joint.JOINT_TYPE_WELD" };
58
+ /**
59
+ * Wheel joint type.
60
+ */
61
+ const JOINT_TYPE_WHEEL: number & { readonly __brand: "b2d.joint.JOINT_TYPE_WHEEL" };
62
+ /**
63
+ * At lower limit state.
64
+ */
65
+ const LIMIT_STATE_AT_LOWER: number & { readonly __brand: "b2d.joint.LIMIT_STATE_AT_LOWER" };
66
+ /**
67
+ * At upper limit state.
68
+ */
69
+ const LIMIT_STATE_AT_UPPER: number & { readonly __brand: "b2d.joint.LIMIT_STATE_AT_UPPER" };
70
+ /**
71
+ * Equal limits state.
72
+ */
73
+ const LIMIT_STATE_EQUAL: number & { readonly __brand: "b2d.joint.LIMIT_STATE_EQUAL" };
74
+ /**
75
+ * Inactive limit state.
76
+ */
77
+ const LIMIT_STATE_INACTIVE: number & { readonly __brand: "b2d.joint.LIMIT_STATE_INACTIVE" };
78
+ /**
79
+ * Create a distance joint.
80
+ *
81
+ * @param body_a - first body
82
+ * @param body_b - second body
83
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `length`, `frequency`, `damping_ratio`, and `collide_connected`
84
+ * @returns created joint
85
+ */
86
+ function create_distance(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; length?: number; frequency?: number; damping_ratio?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
87
+ /**
88
+ * Create a filter joint.
89
+ *
90
+ * @param body_a - first body
91
+ * @param body_b - second body
92
+ * @param definition - optional definition table
93
+ * @returns created joint
94
+ */
95
+ function create_filter(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: Record<string | number, unknown>): Opaque<"b2Joint">;
96
+ /**
97
+ * Create a friction joint.
98
+ *
99
+ * @param body_a - first body
100
+ * @param body_b - second body
101
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `max_force`, `max_torque`, and `collide_connected`
102
+ * @returns created joint
103
+ */
104
+ function create_friction(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; max_force?: number; max_torque?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
105
+ /**
106
+ * Create a gear joint.
107
+ *
108
+ * @param joint1 - first revolute or prismatic joint
109
+ * @param joint2 - second revolute or prismatic joint
110
+ * @param definition - optional definition with `ratio`
111
+ * @returns created joint
112
+ */
113
+ function create_gear(joint1: Opaque<"b2Joint">, joint2: Opaque<"b2Joint">, definition: { ratio?: number }): Opaque<"b2Joint">;
114
+ /**
115
+ * Create a motor joint.
116
+ *
117
+ * @param body_a - first body
118
+ * @param body_b - second body
119
+ * @param definition - optional definition with `linear_offset`, `angular_offset`, `max_force`, `max_torque`, `correction_factor`, and `collide_connected`
120
+ * @returns created joint
121
+ */
122
+ function create_motor(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { linear_offset?: Vector3; angular_offset?: number; max_force?: number; max_torque?: number; correction_factor?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
123
+ /**
124
+ * Create a mouse joint.
125
+ *
126
+ * @param body_a - first body
127
+ * @param body_b - second body
128
+ * @param definition - optional definition with `target`, `max_force`, `frequency`, `damping_ratio`, and `collide_connected`
129
+ * @returns created joint
130
+ */
131
+ function create_mouse(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { target?: Vector3; max_force?: number; frequency?: number; damping_ratio?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
132
+ /**
133
+ * Create a prismatic joint.
134
+ *
135
+ * @param body_a - first body
136
+ * @param body_b - second body
137
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `local_axis_a`, `reference_angle`, `enable_limit`, `lower_translation`, `upper_translation`, `enable_motor`, `max_motor_force`, `motor_speed`, and `collide_connected`
138
+ * @returns created joint
139
+ */
140
+ function create_prismatic(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; local_axis_a?: Vector3; reference_angle?: number; enable_limit?: boolean; lower_translation?: number; upper_translation?: number; enable_motor?: boolean; max_motor_force?: number; motor_speed?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
141
+ /**
142
+ * Create a pulley joint.
143
+ *
144
+ * @param body_a - first body
145
+ * @param body_b - second body
146
+ * @param definition - optional definition with `ground_anchor_a`, `ground_anchor_b`, `local_anchor_a`, `local_anchor_b`, `length_a`, `length_b`, `ratio`, and `collide_connected`
147
+ * @returns created joint
148
+ */
149
+ function create_pulley(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { ground_anchor_a?: Vector3; ground_anchor_b?: Vector3; local_anchor_a?: Vector3; local_anchor_b?: Vector3; length_a?: number; length_b?: number; ratio?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
150
+ /**
151
+ * Create a revolute joint.
152
+ *
153
+ * @param body_a - first body
154
+ * @param body_b - second body
155
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `reference_angle`, `enable_limit`, `lower_angle`, `upper_angle`, `enable_motor`, `max_motor_torque`, `motor_speed`, and `collide_connected`
156
+ * @returns created joint
157
+ */
158
+ function create_revolute(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; reference_angle?: number; enable_limit?: boolean; lower_angle?: number; upper_angle?: number; enable_motor?: boolean; max_motor_torque?: number; motor_speed?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
159
+ /**
160
+ * Create a rope joint.
161
+ *
162
+ * @param body_a - first body
163
+ * @param body_b - second body
164
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `max_length`, and `collide_connected`
165
+ * @returns created joint
166
+ */
167
+ function create_rope(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; max_length?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
168
+ /**
169
+ * Create a weld joint.
170
+ *
171
+ * @param body_a - first body
172
+ * @param body_b - second body
173
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `reference_angle`, `frequency`, `damping_ratio`, and `collide_connected`
174
+ * @returns created joint
175
+ */
176
+ function create_weld(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; reference_angle?: number; frequency?: number; damping_ratio?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
177
+ /**
178
+ * Create a wheel joint.
179
+ *
180
+ * @param body_a - first body
181
+ * @param body_b - second body
182
+ * @param definition - optional definition with `local_anchor_a`, `local_anchor_b`, `local_axis_a`, `enable_motor`, `max_motor_torque`, `motor_speed`, `frequency`, `damping_ratio`, and `collide_connected`
183
+ * @returns created joint
184
+ */
185
+ function create_wheel(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition: { local_anchor_a?: Vector3; local_anchor_b?: Vector3; local_axis_a?: Vector3; enable_motor?: boolean; max_motor_torque?: number; motor_speed?: number; frequency?: number; damping_ratio?: number; collide_connected?: boolean }): Opaque<"b2Joint">;
186
+ /**
187
+ * Destroy a joint created by `b2d.joint`.
188
+ *
189
+ * @param joint - joint
190
+ */
191
+ function destroy(joint: Opaque<"b2Joint">): void;
192
+ /**
193
+ * Enable or disable joint limits.
194
+ *
195
+ * @param joint - prismatic or revolute joint
196
+ * @param enable - true to enable limits
197
+ */
198
+ function enable_limit(joint: Opaque<"b2Joint">, enable: boolean): void;
199
+ /**
200
+ * Enable or disable the joint motor.
201
+ *
202
+ * @param joint - prismatic, revolute, or wheel joint
203
+ * @param enable - true to enable the motor
204
+ */
205
+ function enable_motor(joint: Opaque<"b2Joint">, enable: boolean): void;
206
+ /**
207
+ * Enable or disable joint spring behavior.
208
+ *
209
+ * @param joint - distance, prismatic, revolute, or wheel joint
210
+ * @param enable - true to enable the spring
211
+ */
212
+ function enable_spring(joint: Opaque<"b2Joint">, enable: boolean): void;
213
+ /**
214
+ * Get the world anchor on body A.
215
+ *
216
+ * @param joint - joint
217
+ * @returns world anchor
218
+ */
219
+ function get_anchor_a(joint: Opaque<"b2Joint">): Vector3;
220
+ /**
221
+ * Get the world anchor on body B.
222
+ *
223
+ * @param joint - joint
224
+ * @returns world anchor
225
+ */
226
+ function get_anchor_b(joint: Opaque<"b2Joint">): Vector3;
227
+ /**
228
+ * Get weld joint angular damping ratio.
229
+ *
230
+ * @param joint - weld joint
231
+ * @returns damping ratio
232
+ */
233
+ function get_angular_damping_ratio(joint: Opaque<"b2Joint">): number;
234
+ /**
235
+ * Get weld joint angular frequency.
236
+ *
237
+ * @param joint - weld joint
238
+ * @returns frequency in hertz
239
+ */
240
+ function get_angular_hertz(joint: Opaque<"b2Joint">): number;
241
+ /**
242
+ * Get motor joint angular offset.
243
+ *
244
+ * @param joint - motor joint
245
+ * @returns angular offset in radians
246
+ */
247
+ function get_angular_offset(joint: Opaque<"b2Joint">): number;
248
+ /**
249
+ * Get the first body connected to a joint.
250
+ *
251
+ * @param joint - joint
252
+ * @returns body A
253
+ */
254
+ function get_body_a(joint: Opaque<"b2Joint">): Opaque<"b2Body">;
255
+ /**
256
+ * Get the second body connected to a joint.
257
+ *
258
+ * @param joint - joint
259
+ * @returns body B
260
+ */
261
+ function get_body_b(joint: Opaque<"b2Joint">): Opaque<"b2Body">;
262
+ /**
263
+ * Get whether connected bodies can collide.
264
+ *
265
+ * @param joint - joint
266
+ * @returns true if connected bodies can collide
267
+ */
268
+ function get_collide_connected(joint: Opaque<"b2Joint">): boolean;
269
+ /**
270
+ * Get motor joint correction factor.
271
+ *
272
+ * @param joint - motor joint
273
+ * @returns correction factor
274
+ */
275
+ function get_correction_factor(joint: Opaque<"b2Joint">): number;
276
+ /**
277
+ * Get the current distance joint length.
278
+ *
279
+ * @param joint - distance joint
280
+ * @returns current length in project units
281
+ */
282
+ function get_current_length(joint: Opaque<"b2Joint">): number;
283
+ /**
284
+ * Get spring damping ratio.
285
+ *
286
+ * @param joint - distance, mouse, weld, or wheel joint
287
+ * @returns damping ratio
288
+ */
289
+ function get_damping_ratio(joint: Opaque<"b2Joint">): number;
290
+ /**
291
+ * Get spring frequency.
292
+ *
293
+ * @param joint - distance, mouse, weld, or wheel joint
294
+ * @returns frequency in hertz
295
+ */
296
+ function get_frequency(joint: Opaque<"b2Joint">): number;
297
+ /**
298
+ * Get pulley ground anchor A.
299
+ *
300
+ * @param joint - pulley joint
301
+ * @returns world anchor
302
+ */
303
+ function get_ground_anchor_a(joint: Opaque<"b2Joint">): Vector3;
304
+ /**
305
+ * Get pulley ground anchor B.
306
+ *
307
+ * @param joint - pulley joint
308
+ * @returns world anchor
309
+ */
310
+ function get_ground_anchor_b(joint: Opaque<"b2Joint">): Vector3;
311
+ /**
312
+ * Alias for `b2d.joint.get_frequency`.
313
+ *
314
+ * @param joint - distance, mouse, weld, or wheel joint
315
+ * @returns frequency in hertz
316
+ */
317
+ function get_hertz(joint: Opaque<"b2Joint">): number;
318
+ /**
319
+ * Get revolute joint angle.
320
+ *
321
+ * @param joint - revolute joint
322
+ * @returns angle in radians
323
+ */
324
+ function get_joint_angle(joint: Opaque<"b2Joint">): number;
325
+ /**
326
+ * Get joint speed.
327
+ *
328
+ * @param joint - prismatic, revolute, or wheel joint
329
+ * @returns joint speed
330
+ */
331
+ function get_joint_speed(joint: Opaque<"b2Joint">): number;
332
+ /**
333
+ * Get joint translation.
334
+ *
335
+ * @param joint - prismatic or wheel joint
336
+ * @returns translation in project units
337
+ */
338
+ function get_joint_translation(joint: Opaque<"b2Joint">): number;
339
+ /**
340
+ * Get the first joint connected to a gear joint.
341
+ *
342
+ * @param joint - gear joint
343
+ * @returns first connected joint
344
+ */
345
+ function get_joint1(joint: Opaque<"b2Joint">): Opaque<"b2Joint">;
346
+ /**
347
+ * Get the second joint connected to a gear joint.
348
+ *
349
+ * @param joint - gear joint
350
+ * @returns second connected joint
351
+ */
352
+ function get_joint2(joint: Opaque<"b2Joint">): Opaque<"b2Joint">;
353
+ /**
354
+ * Get the distance joint length.
355
+ *
356
+ * @param joint - distance joint
357
+ * @returns length in project units
358
+ */
359
+ function get_length(joint: Opaque<"b2Joint">): number;
360
+ /**
361
+ * Get pulley segment length A.
362
+ *
363
+ * @param joint - pulley joint
364
+ * @returns length in project units
365
+ */
366
+ function get_length_a(joint: Opaque<"b2Joint">): number;
367
+ /**
368
+ * Get pulley segment length B.
369
+ *
370
+ * @param joint - pulley joint
371
+ * @returns length in project units
372
+ */
373
+ function get_length_b(joint: Opaque<"b2Joint">): number;
374
+ /**
375
+ * Get rope limit state.
376
+ *
377
+ * @param joint - rope joint
378
+ * @returns one of the `LIMIT_STATE_*` constants
379
+ */
380
+ function get_limit_state(joint: Opaque<"b2Joint">): number;
381
+ /**
382
+ * Get weld joint linear damping ratio.
383
+ *
384
+ * @param joint - weld joint
385
+ * @returns damping ratio
386
+ */
387
+ function get_linear_damping_ratio(joint: Opaque<"b2Joint">): number;
388
+ /**
389
+ * Get weld joint linear frequency.
390
+ *
391
+ * @param joint - weld joint
392
+ * @returns frequency in hertz
393
+ */
394
+ function get_linear_hertz(joint: Opaque<"b2Joint">): number;
395
+ /**
396
+ * Get motor joint linear offset.
397
+ *
398
+ * @param joint - motor joint
399
+ * @returns linear offset in project units
400
+ */
401
+ function get_linear_offset(joint: Opaque<"b2Joint">): Vector3;
402
+ /**
403
+ * Get the local anchor on body A.
404
+ *
405
+ * @param joint - joint
406
+ * @returns local anchor
407
+ */
408
+ function get_local_anchor_a(joint: Opaque<"b2Joint">): Vector3;
409
+ /**
410
+ * Get the local anchor on body B.
411
+ *
412
+ * @param joint - joint
413
+ * @returns local anchor
414
+ */
415
+ function get_local_anchor_b(joint: Opaque<"b2Joint">): Vector3;
416
+ /**
417
+ * Get the local axis on body A.
418
+ *
419
+ * @param joint - prismatic or wheel joint
420
+ * @returns local axis
421
+ */
422
+ function get_local_axis_a(joint: Opaque<"b2Joint">): Vector3;
423
+ /**
424
+ * Get the lower joint limit.
425
+ *
426
+ * @param joint - prismatic or revolute joint
427
+ * @returns lower limit
428
+ */
429
+ function get_lower_limit(joint: Opaque<"b2Joint">): number;
430
+ /**
431
+ * Get maximum force.
432
+ *
433
+ * @param joint - mouse or friction joint
434
+ * @returns maximum force
435
+ */
436
+ function get_max_force(joint: Opaque<"b2Joint">): number;
437
+ /**
438
+ * Get rope maximum length.
439
+ *
440
+ * @param joint - rope joint
441
+ * @returns maximum length in project units
442
+ */
443
+ function get_max_length(joint: Opaque<"b2Joint">): number;
444
+ /**
445
+ * Get maximum motor force.
446
+ *
447
+ * @param joint - prismatic joint
448
+ * @returns maximum motor force
449
+ */
450
+ function get_max_motor_force(joint: Opaque<"b2Joint">): number;
451
+ /**
452
+ * Get maximum motor torque.
453
+ *
454
+ * @param joint - revolute or wheel joint
455
+ * @returns maximum motor torque
456
+ */
457
+ function get_max_motor_torque(joint: Opaque<"b2Joint">): number;
458
+ /**
459
+ * Get maximum torque.
460
+ *
461
+ * @param joint - friction joint
462
+ * @returns maximum torque
463
+ */
464
+ function get_max_torque(joint: Opaque<"b2Joint">): number;
465
+ /**
466
+ * Get the distance joint minimum length.
467
+ *
468
+ * @param joint - distance joint
469
+ * @returns minimum length in project units
470
+ */
471
+ function get_min_length(joint: Opaque<"b2Joint">): number;
472
+ /**
473
+ * Get current motor force.
474
+ *
475
+ * @param joint - distance or prismatic joint
476
+ * @returns motor force
477
+ */
478
+ function get_motor_force(joint: Opaque<"b2Joint">): number;
479
+ /**
480
+ * Get current motor force.
481
+ *
482
+ * @param joint - prismatic joint
483
+ * @param inv_dt - inverse time step
484
+ * @returns motor force
485
+ */
486
+ function get_motor_force(joint: Opaque<"b2Joint">, inv_dt: number): number;
487
+ /**
488
+ * Get motor speed.
489
+ *
490
+ * @param joint - prismatic, revolute, or wheel joint
491
+ * @returns motor speed
492
+ */
493
+ function get_motor_speed(joint: Opaque<"b2Joint">): number;
494
+ /**
495
+ * Get current motor torque.
496
+ *
497
+ * @param joint - revolute or wheel joint
498
+ * @returns motor torque
499
+ */
500
+ function get_motor_torque(joint: Opaque<"b2Joint">): number;
501
+ /**
502
+ * Get current motor torque.
503
+ *
504
+ * @param joint - revolute or wheel joint
505
+ * @param inv_dt - inverse time step
506
+ * @returns motor torque
507
+ */
508
+ function get_motor_torque(joint: Opaque<"b2Joint">, inv_dt: number): number;
509
+ /**
510
+ * Get the target for a mouse joint.
511
+ *
512
+ * @param joint - mouse joint
513
+ * @returns world target
514
+ */
515
+ function get_mouse_target(joint: Opaque<"b2Joint">): Vector3;
516
+ /**
517
+ * Get joint ratio.
518
+ *
519
+ * @param joint - pulley or gear joint
520
+ * @returns joint ratio
521
+ */
522
+ function get_ratio(joint: Opaque<"b2Joint">): number;
523
+ /**
524
+ * Get reaction force.
525
+ *
526
+ * @param joint - joint
527
+ * @returns reaction force
528
+ */
529
+ function get_reaction_force(joint: Opaque<"b2Joint">): Vector3;
530
+ /**
531
+ * Get reaction force.
532
+ *
533
+ * @param joint - joint
534
+ * @param inv_dt - inverse time step
535
+ * @returns reaction force
536
+ */
537
+ function get_reaction_force(joint: Opaque<"b2Joint">, inv_dt: number): Vector3;
538
+ /**
539
+ * Get reaction torque.
540
+ *
541
+ * @param joint - joint
542
+ * @returns reaction torque
543
+ */
544
+ function get_reaction_torque(joint: Opaque<"b2Joint">): number;
545
+ /**
546
+ * Get reaction torque.
547
+ *
548
+ * @param joint - joint
549
+ * @param inv_dt - inverse time step
550
+ * @returns reaction torque
551
+ */
552
+ function get_reaction_torque(joint: Opaque<"b2Joint">, inv_dt: number): number;
553
+ /**
554
+ * Get the reference angle.
555
+ *
556
+ * @param joint - prismatic, revolute, or weld joint
557
+ * @returns reference angle in radians
558
+ */
559
+ function get_reference_angle(joint: Opaque<"b2Joint">): number;
560
+ /**
561
+ * Alias for `b2d.joint.get_damping_ratio`.
562
+ *
563
+ * @param joint - distance, mouse, weld, or wheel joint
564
+ * @returns damping ratio
565
+ */
566
+ function get_spring_damping_ratio(joint: Opaque<"b2Joint">): number;
567
+ /**
568
+ * Get spring frequency.
569
+ *
570
+ * @param joint - distance, mouse, prismatic, revolute, or wheel joint
571
+ * @returns frequency in hertz
572
+ */
573
+ function get_spring_hertz(joint: Opaque<"b2Joint">): number;
574
+ /**
575
+ * Get the joint type.
576
+ *
577
+ * @param joint - joint
578
+ * @returns one of the `JOINT_TYPE_*` constants
579
+ */
580
+ function get_type(joint: Opaque<"b2Joint">): number;
581
+ /**
582
+ * Get the upper joint limit.
583
+ *
584
+ * @param joint - prismatic or revolute joint
585
+ * @returns upper limit
586
+ */
587
+ function get_upper_limit(joint: Opaque<"b2Joint">): number;
588
+ /**
589
+ * Get the world owning a joint.
590
+ *
591
+ * @param joint - joint
592
+ * @returns owning world
593
+ */
594
+ function get_world(joint: Opaque<"b2Joint">): Opaque<"b2World">;
595
+ /**
596
+ * Get whether the joint is active.
597
+ *
598
+ * @param joint - joint
599
+ * @returns true if the joint is active
600
+ */
601
+ function is_active(joint: Opaque<"b2Joint">): boolean;
602
+ /**
603
+ * Get whether joint limits are enabled.
604
+ *
605
+ * @param joint - prismatic or revolute joint
606
+ * @returns true if limits are enabled
607
+ */
608
+ function is_limit_enabled(joint: Opaque<"b2Joint">): boolean;
609
+ /**
610
+ * Get whether the joint motor is enabled.
611
+ *
612
+ * @param joint - prismatic, revolute, or wheel joint
613
+ * @returns true if the motor is enabled
614
+ */
615
+ function is_motor_enabled(joint: Opaque<"b2Joint">): boolean;
616
+ /**
617
+ * Get whether joint spring behavior is enabled.
618
+ *
619
+ * @param joint - distance, prismatic, revolute, or wheel joint
620
+ * @returns true if the spring is enabled
621
+ */
622
+ function is_spring_enabled(joint: Opaque<"b2Joint">): boolean;
623
+ /**
624
+ * Validate a joint handle.
625
+ *
626
+ * @param joint - joint
627
+ * @returns true if the joint handle still refers to a live Box2D joint
628
+ */
629
+ function is_valid(joint: Opaque<"b2Joint">): boolean;
630
+ /**
631
+ * Set weld joint angular damping ratio.
632
+ *
633
+ * @param joint - weld joint
634
+ * @param ratio - damping ratio
635
+ */
636
+ function set_angular_damping_ratio(joint: Opaque<"b2Joint">, ratio: number): void;
637
+ /**
638
+ * Set weld joint angular frequency.
639
+ *
640
+ * @param joint - weld joint
641
+ * @param hertz - frequency in hertz
642
+ */
643
+ function set_angular_hertz(joint: Opaque<"b2Joint">, hertz: number): void;
644
+ /**
645
+ * Set motor joint angular offset.
646
+ *
647
+ * @param joint - motor joint
648
+ * @param offset - angular offset in radians
649
+ */
650
+ function set_angular_offset(joint: Opaque<"b2Joint">, offset: number): void;
651
+ /**
652
+ * Set whether connected bodies can collide.
653
+ *
654
+ * @param joint - joint
655
+ * @param collide - true if connected bodies can collide
656
+ */
657
+ function set_collide_connected(joint: Opaque<"b2Joint">, collide: boolean): void;
658
+ /**
659
+ * Set motor joint correction factor.
660
+ *
661
+ * @param joint - motor joint
662
+ * @param factor - correction factor
663
+ */
664
+ function set_correction_factor(joint: Opaque<"b2Joint">, factor: number): void;
665
+ /**
666
+ * Set spring damping ratio.
667
+ *
668
+ * @param joint - distance, mouse, weld, or wheel joint
669
+ * @param ratio - damping ratio
670
+ */
671
+ function set_damping_ratio(joint: Opaque<"b2Joint">, ratio: number): void;
672
+ /**
673
+ * Set spring frequency.
674
+ *
675
+ * @param joint - distance, mouse, weld, or wheel joint
676
+ * @param frequency - frequency in hertz
677
+ */
678
+ function set_frequency(joint: Opaque<"b2Joint">, frequency: number): void;
679
+ /**
680
+ * Alias for `b2d.joint.set_frequency`.
681
+ *
682
+ * @param joint - distance, mouse, weld, or wheel joint
683
+ * @param hertz - frequency in hertz
684
+ */
685
+ function set_hertz(joint: Opaque<"b2Joint">, hertz: number): void;
686
+ /**
687
+ * Set the distance joint length.
688
+ *
689
+ * @param joint - distance joint
690
+ * @param length - length in project units
691
+ */
692
+ function set_length(joint: Opaque<"b2Joint">, length: number): void;
693
+ /**
694
+ * Set the distance joint length range.
695
+ *
696
+ * @param joint - distance joint
697
+ * @param min_length - minimum length in project units
698
+ * @param max_length - maximum length in project units
699
+ */
700
+ function set_length_range(joint: Opaque<"b2Joint">, min_length: number, max_length: number): void;
701
+ /**
702
+ * Set joint limits.
703
+ *
704
+ * @param joint - prismatic or revolute joint
705
+ * @param lower - lower limit
706
+ * @param upper - upper limit
707
+ */
708
+ function set_limits(joint: Opaque<"b2Joint">, lower: number, upper: number): void;
709
+ /**
710
+ * Set weld joint linear damping ratio.
711
+ *
712
+ * @param joint - weld joint
713
+ * @param ratio - damping ratio
714
+ */
715
+ function set_linear_damping_ratio(joint: Opaque<"b2Joint">, ratio: number): void;
716
+ /**
717
+ * Set weld joint linear frequency.
718
+ *
719
+ * @param joint - weld joint
720
+ * @param hertz - frequency in hertz
721
+ */
722
+ function set_linear_hertz(joint: Opaque<"b2Joint">, hertz: number): void;
723
+ /**
724
+ * Set motor joint linear offset.
725
+ *
726
+ * @param joint - motor joint
727
+ * @param offset - linear offset in project units
728
+ */
729
+ function set_linear_offset(joint: Opaque<"b2Joint">, offset: Vector3): void;
730
+ /**
731
+ * Set maximum force.
732
+ *
733
+ * @param joint - mouse or friction joint
734
+ * @param force - maximum force
735
+ */
736
+ function set_max_force(joint: Opaque<"b2Joint">, force: number): void;
737
+ /**
738
+ * Set rope maximum length.
739
+ *
740
+ * @param joint - rope joint
741
+ * @param length - maximum length in project units
742
+ */
743
+ function set_max_length(joint: Opaque<"b2Joint">, length: number): void;
744
+ /**
745
+ * Set maximum motor force.
746
+ *
747
+ * @param joint - prismatic joint
748
+ * @param force - maximum motor force
749
+ */
750
+ function set_max_motor_force(joint: Opaque<"b2Joint">, force: number): void;
751
+ /**
752
+ * Set maximum motor torque.
753
+ *
754
+ * @param joint - revolute or wheel joint
755
+ * @param torque - maximum motor torque
756
+ */
757
+ function set_max_motor_torque(joint: Opaque<"b2Joint">, torque: number): void;
758
+ /**
759
+ * Set maximum torque.
760
+ *
761
+ * @param joint - friction joint
762
+ * @param torque - maximum torque
763
+ */
764
+ function set_max_torque(joint: Opaque<"b2Joint">, torque: number): void;
765
+ /**
766
+ * Set the distance joint minimum length.
767
+ *
768
+ * @param joint - distance joint
769
+ * @param length - minimum length in project units
770
+ */
771
+ function set_min_length(joint: Opaque<"b2Joint">, length: number): void;
772
+ /**
773
+ * Set motor speed.
774
+ *
775
+ * @param joint - prismatic, revolute, or wheel joint
776
+ * @param speed - motor speed
777
+ */
778
+ function set_motor_speed(joint: Opaque<"b2Joint">, speed: number): void;
779
+ /**
780
+ * Set the target for a mouse joint.
781
+ *
782
+ * @param joint - mouse joint
783
+ * @param target - world target
784
+ */
785
+ function set_mouse_target(joint: Opaque<"b2Joint">, target: Vector3): void;
786
+ /**
787
+ * Set gear joint ratio.
788
+ *
789
+ * @param joint - gear joint
790
+ * @param ratio - gear ratio
791
+ */
792
+ function set_ratio(joint: Opaque<"b2Joint">, ratio: number): void;
793
+ /**
794
+ * Set weld joint reference angle.
795
+ *
796
+ * @param joint - weld joint
797
+ * @param angle - reference angle in radians
798
+ */
799
+ function set_reference_angle(joint: Opaque<"b2Joint">, angle: number): void;
800
+ /**
801
+ * Alias for `b2d.joint.set_damping_ratio`.
802
+ *
803
+ * @param joint - distance, mouse, weld, or wheel joint
804
+ * @param ratio - damping ratio
805
+ */
806
+ function set_spring_damping_ratio(joint: Opaque<"b2Joint">, ratio: number): void;
807
+ /**
808
+ * Set spring frequency.
809
+ *
810
+ * @param joint - distance, mouse, prismatic, revolute, or wheel joint
811
+ * @param hertz - frequency in hertz
812
+ */
813
+ function set_spring_hertz(joint: Opaque<"b2Joint">, hertz: number): void;
814
+ /**
815
+ * Wake the bodies connected to a joint.
816
+ *
817
+ * @param joint - joint
818
+ */
819
+ function wake_bodies(joint: Opaque<"b2Joint">): void;
820
+ }
821
+ }
822
+
823
+ export {};