@ts-defold/types 1.2.42 → 1.2.43

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 (2) hide show
  1. package/index.d.ts +93 -48
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  /// <reference types="lua-types/5.1" />
3
3
  /// <reference types="@typescript-to-lua/language-extensions" />
4
4
 
5
- // DEFOLD. stable version 1.8.0 (ef07c036b8f7d34f4b1d7fcc355ce46a92d2dcc8)
5
+ // DEFOLD. stable version 1.8.0 (fd3b8c652df601220d8651f581fa2fada8205237)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -230,7 +230,7 @@ declare namespace b2d {
230
230
  * @param url the url to the game object collision component
231
231
  * @return body the body if successful. Otherwise `nil`.
232
232
  */
233
- export function get_body(url: url): any
233
+ export function get_body(url: string | hash | url): any
234
234
 
235
235
  /**
236
236
  * Get the Box2D world from the current collection
@@ -261,214 +261,247 @@ declare namespace b2d.body {
261
261
 
262
262
  /**
263
263
  * Apply an angular impulse.
264
+ * @param body body
264
265
  * @param impulse impulse the angular impulse in units of kg*m*m/s
265
266
  */
266
- export function apply_angular_impulse(impulse: number): void
267
+ export function apply_angular_impulse(body: any, impulse: number): void
267
268
 
268
269
  /**
269
270
  * Apply a force at a world point. If the force is not
270
271
  * applied at the center of mass, it will generate a torque and
271
272
  * affect the angular velocity. This wakes up the body.
273
+ * @param body body
272
274
  * @param force the world force vector, usually in Newtons (N).
273
275
  * @param point the world position of the point of application.
274
276
  */
275
- export function apply_force(force: vmath.vector3, point: vmath.vector3): void
277
+ export function apply_force(body: any, force: vmath.vector3, point: vmath.vector3): void
276
278
 
277
279
  /**
278
280
  * Apply a force to the center of mass. This wakes up the body.
281
+ * @param body body
279
282
  * @param force the world force vector, usually in Newtons (N).
280
283
  */
281
- export function apply_force_to_center(force: vmath.vector3): void
284
+ export function apply_force_to_center(body: any, force: vmath.vector3): void
282
285
 
283
286
  /**
284
287
  * Apply an impulse at a point. This immediately modifies the velocity.
285
288
  * It also modifies the angular velocity if the point of application
286
289
  * is not at the center of mass. This wakes up the body.
290
+ * @param body body
287
291
  * @param impulse the world impulse vector, usually in N-seconds or kg-m/s.
288
292
  * @param point the world position of the point of application.
289
293
  */
290
- export function apply_linear_impulse(impulse: vmath.vector3, point: vmath.vector3): void
294
+ export function apply_linear_impulse(body: any, impulse: vmath.vector3, point: vmath.vector3): void
291
295
 
292
296
  /**
293
297
  * Apply a torque. This affects the angular velocity
294
298
  * without affecting the linear velocity of the center of mass.
295
299
  * This wakes up the body.
300
+ * @param body body
296
301
  * @param torque torque about the z-axis (out of the screen), usually in N-m.
297
302
  */
298
- export function apply_torque(torque: number): void
303
+ export function apply_torque(body: any, torque: number): void
299
304
 
300
305
  /**
301
306
  * Print the body representation to the log output
307
+ * @param body body
302
308
  */
303
- export function dump(): void
309
+ export function dump(body: any): void
304
310
 
305
311
  /**
306
312
  * Get the angular damping of the body.
313
+ * @param body body
307
314
  * @return damping the damping
308
315
  */
309
- export function get_angular_damping(): number
316
+ export function get_angular_damping(body: any): number
310
317
 
311
318
  /**
312
319
  * Set the angular velocity.
320
+ * @param body body
313
321
  * @param omega the new angular velocity in radians/second.
314
322
  */
315
- export function get_angular_velocity(omega: number): void
323
+ export function get_angular_velocity(body: any, omega: number): void
316
324
 
317
325
  /**
318
326
  * Get the angular velocity.
327
+ * @param body body
319
328
  * @return velocity the angular velocity in radians/second.
320
329
  */
321
- export function get_angular_velocity(): number
330
+ export function get_angular_velocity(body: any): number
322
331
 
323
332
  /**
324
333
  * Get the gravity scale of the body.
334
+ * @param body body
325
335
  * @return scale the scale
326
336
  */
327
- export function get_gravity_scale(): number
337
+ export function get_gravity_scale(body: any): number
328
338
 
329
339
  /**
330
340
  * Get the rotational inertia of the body about the local origin.
341
+ * @param body body
331
342
  * @return inertia the rotational inertia, usually in kg-m^2.
332
343
  */
333
- export function get_inertia(): number
344
+ export function get_inertia(body: any): number
334
345
 
335
346
  /**
336
347
  * Get the linear damping of the body.
348
+ * @param body body
337
349
  * @return damping the damping
338
350
  */
339
- export function get_linear_damping(): number
351
+ export function get_linear_damping(body: any): number
340
352
 
341
353
  /**
342
354
  * Get the linear velocity of the center of mass.
355
+ * @param body body
343
356
  * @return velocity the linear velocity of the center of mass.
344
357
  */
345
- export function get_linear_velocity(): vmath.vector3
358
+ export function get_linear_velocity(body: any): vmath.vector3
346
359
 
347
360
  /**
348
361
  * Get the world linear velocity of a world point attached to this body.
362
+ * @param body body
349
363
  * @param world_point a point in world coordinates.
350
364
  * @return velocity the world velocity of a point.
351
365
  */
352
- export function get_linear_velocity_from_world_point(world_point: vmath.vector3): vmath.vector3
366
+ export function get_linear_velocity_from_world_point(body: any, world_point: vmath.vector3): vmath.vector3
353
367
 
354
368
  /**
355
369
  * Get the world velocity of a local point.
370
+ * @param body body
356
371
  * @param world_point a point in local coordinates.
357
372
  * @return velocity the world velocity of a point.
358
373
  */
359
- export function get_linear_velocity_from_world_point(world_point: vmath.vector3): vmath.vector3
374
+ export function get_linear_velocity_from_world_point(body: any, world_point: vmath.vector3): vmath.vector3
360
375
 
361
376
  /**
362
377
  * Get the local position of the center of mass.
378
+ * @param body body
363
379
  * @return center Get the local position of the center of mass.
364
380
  */
365
- export function get_local_center(): vmath.vector3
381
+ export function get_local_center(body: any): vmath.vector3
366
382
 
367
383
  /**
368
384
  * Gets a local point relative to the body's origin given a world point.
385
+ * @param body body
369
386
  * @param world_point a point in world coordinates.
370
387
  * @return vector the corresponding local point relative to the body's origin.
371
388
  */
372
- export function get_local_point(world_point: vmath.vector3): vmath.vector3
389
+ export function get_local_point(body: any, world_point: vmath.vector3): vmath.vector3
373
390
 
374
391
  /**
375
392
  * Gets a local vector given a world vector.
393
+ * @param body body
376
394
  * @param world_vector a vector in world coordinates.
377
395
  * @return vector the corresponding local vector.
378
396
  */
379
- export function get_local_vector(world_vector: vmath.vector3): vmath.vector3
397
+ export function get_local_vector(body: any, world_vector: vmath.vector3): vmath.vector3
380
398
 
381
399
  /**
382
400
  * Get the total mass of the body.
401
+ * @param body body
383
402
  * @return mass the mass, usually in kilograms (kg).
384
403
  */
385
- export function get_mass(): number
404
+ export function get_mass(body: any): number
386
405
 
387
406
  /**
388
407
  * Get the next body in the world's body list.
408
+ * @param body body
389
409
  * @return body the next body
390
410
  */
391
- export function get_next(): any
411
+ export function get_next(body: any): any
392
412
 
393
413
  /**
394
414
  * Get the world body origin position.
415
+ * @param body body
395
416
  * @return position the world position of the body's origin.
396
417
  */
397
- export function get_position(): vmath.vector3
418
+ export function get_position(body: any): vmath.vector3
398
419
 
399
420
  /**
400
421
  * Get the type of this body.
422
+ * @param body body
401
423
  * @return type the body type
402
424
  */
403
- export function get_type(): any
425
+ export function get_type(body: any): any
404
426
 
405
427
  /**
406
428
  * Get the parent world of this body.
429
+ * @param body body
407
430
  * @return world
408
431
  */
409
- export function get_world(): any
432
+ export function get_world(body: any): any
410
433
 
411
434
  /**
412
435
  * Get the angle in radians.
436
+ * @param body body
413
437
  * @return angle the current world rotation angle in radians.
414
438
  */
415
- export function get_world_center(): number
439
+ export function get_world_center(body: any): number
416
440
 
417
441
  /**
418
442
  * Get the world position of the center of mass.
443
+ * @param body body
419
444
  * @return center Get the world position of the center of mass.
420
445
  */
421
- export function get_world_center(): vmath.vector3
446
+ export function get_world_center(body: any): vmath.vector3
422
447
 
423
448
  /**
424
449
  * Get the world coordinates of a point given the local coordinates.
450
+ * @param body body
425
451
  * @param local_vector localPoint a point on the body measured relative the the body's origin.
426
452
  * @return vector the same point expressed in world coordinates.
427
453
  */
428
- export function get_world_point(local_vector: vmath.vector3): vmath.vector3
454
+ export function get_world_point(body: any, local_vector: vmath.vector3): vmath.vector3
429
455
 
430
456
  /**
431
457
  * Get the world coordinates of a vector given the local coordinates.
458
+ * @param body body
432
459
  * @param local_vector a vector fixed in the body.
433
460
  * @return vector the same vector expressed in world coordinates.
434
461
  */
435
- export function get_world_vector(local_vector: vmath.vector3): vmath.vector3
462
+ export function get_world_vector(body: any, local_vector: vmath.vector3): vmath.vector3
436
463
 
437
464
  /**
438
465
  * Get the active state of the body.
466
+ * @param body body
439
467
  * @return enabled is the body active
440
468
  */
441
- export function is_active(): any
469
+ export function is_active(body: any): any
442
470
 
443
471
  /**
444
472
  * Get the sleeping state of this body.
473
+ * @param body body
445
474
  * @return enabled true if the body is awake, false if it's sleeping.
446
475
  */
447
- export function is_awake(): any
476
+ export function is_awake(body: any): any
448
477
 
449
478
  /**
450
479
  * Is this body in bullet mode
480
+ * @param body body
451
481
  * @return enabled true if the body is in bullet mode
452
482
  */
453
- export function is_bullet(): any
483
+ export function is_bullet(body: any): any
454
484
 
455
485
  /**
456
486
  * Does this body have fixed rotation?
487
+ * @param body body
457
488
  * @return enabled is the rotation fixed
458
489
  */
459
- export function is_fixed_rotation(): any
490
+ export function is_fixed_rotation(body: any): any
460
491
 
461
492
  /**
462
493
  * Is this body allowed to sleep
494
+ * @param body body
463
495
  * @return enabled true if the body is allowed to sleep
464
496
  */
465
- export function is_sleeping_allowed(): any
497
+ export function is_sleeping_allowed(body: any): any
466
498
 
467
499
  /**
468
500
  * This resets the mass properties to the sum of the mass properties of the fixtures.
469
501
  * This normally does not need to be called unless you called SetMassData to override
502
+ * @param body body
470
503
  */
471
- export function reset_mass_data(): void
504
+ export function reset_mass_data(body: any): void
472
505
 
473
506
  /**
474
507
  * Set the active state of the body. An inactive body is not
@@ -484,72 +517,83 @@ declare namespace b2d.body {
484
517
  * Joints connected to an inactive body are implicitly inactive.
485
518
  * An inactive body is still owned by a b2World object and remains
486
519
  * in the body list.
520
+ * @param body body
487
521
  * @param enable true if the body should be active
488
522
  */
489
- export function set_active(enable: any): void
523
+ export function set_active(body: any, enable: any): void
490
524
 
491
525
  /**
492
526
  * Set the angular damping of the body.
527
+ * @param body body
493
528
  * @param damping the damping
494
529
  */
495
- export function set_angular_damping(damping: number): void
530
+ export function set_angular_damping(body: any, damping: number): void
496
531
 
497
532
  /**
498
533
  * Set the sleep state of the body. A sleeping body has very low CPU cost.
534
+ * @param body body
499
535
  * @param enable flag set to false to put body to sleep, true to wake it.
500
536
  */
501
- export function set_awake(enable: any): void
537
+ export function set_awake(body: any, enable: any): void
502
538
 
503
539
  /**
504
540
  * Should this body be treated like a bullet for continuous collision detection?
541
+ * @param body body
505
542
  * @param enable if true, the body will be in bullet mode
506
543
  */
507
- export function set_bullet(enable: any): void
544
+ export function set_bullet(body: any, enable: any): void
508
545
 
509
546
  /**
510
547
  * Set this body to have fixed rotation. This causes the mass to be reset.
548
+ * @param body body
511
549
  * @param enable true if the rotation should be fixed
512
550
  */
513
- export function set_fixed_rotation(enable: any): void
551
+ export function set_fixed_rotation(body: any, enable: any): void
514
552
 
515
553
  /**
516
554
  * Set the gravity scale of the body.
555
+ * @param body body
517
556
  * @param scale the scale
518
557
  */
519
- export function set_gravity_scale(scale: number): void
558
+ export function set_gravity_scale(body: any, scale: number): void
520
559
 
521
560
  /**
522
561
  * Set the linear damping of the body.
562
+ * @param body body
523
563
  * @param damping the damping
524
564
  */
525
- export function set_linear_damping(damping: number): void
565
+ export function set_linear_damping(body: any, damping: number): void
526
566
 
527
567
  /**
528
568
  * Set the linear velocity of the center of mass.
569
+ * @param body body
529
570
  * @param velocity the new linear velocity of the center of mass.
530
571
  */
531
- export function set_linear_velocity(velocity: vmath.vector3): void
572
+ export function set_linear_velocity(body: any, velocity: vmath.vector3): void
532
573
 
533
574
  /**
534
575
  * You can disable sleeping on this body. If you disable sleeping, the body will be woken.
576
+ * @param body body
535
577
  * @param enable if false, the body will never sleep, and consume more CPU
536
578
  */
537
- export function set_sleeping_allowed(enable: any): void
579
+ export function set_sleeping_allowed(body: any, enable: any): void
538
580
 
539
581
  /**
540
582
  * Set the position of the body's origin and rotation.
541
583
  * This breaks any contacts and wakes the other bodies.
542
584
  * Manipulating a body's transform may cause non-physical behavior.
585
+ * @param body body
543
586
  * @param position the world position of the body's local origin.
544
587
  * @param angle the world position of the body's local origin.
545
588
  */
546
- export function set_transform(position: vmath.vector3, angle: number): void
589
+ export function set_transform(body: any, position: vmath.vector3, angle: number): void
547
590
 
548
591
  /**
549
592
  * Set the type of this body. This may alter the mass and velocity.
593
+ * @param body body
550
594
  * @param type the body type
551
595
  */
552
- export function set_type(type: any): void
596
+ export function set_type(body: any, type: any): void
553
597
 
554
598
  }
555
599
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
@@ -5034,9 +5078,10 @@ Creating an empty texture with no buffer data is not supported as a core feature
5034
5078
  - `COMPRESSION_TYPE_BASIS_UASTC`
5035
5079
 
5036
5080
  * @param buffer optional buffer of precreated pixel data
5037
- * @return path_ The path to the resource and the request id for the async request.
5081
+ * @return path The path to the resource.
5082
+ * @return request_id The request id for the async request.
5038
5083
  */
5039
- export function create_texture_async(path: string, table: any, buffer?: buffer): any
5084
+ export function create_texture_async(path: string, table: any, buffer?: buffer): LuaMultiReturn<[hash, any]>
5040
5085
 
5041
5086
  /**
5042
5087
  * Constructor-like function with two purposes:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.42",
3
+ "version": "1.2.43",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [