@ts-defold/types 1.2.65 → 1.2.66

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 +135 -77
  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.9.8 (67542769598a1b794877c96f740f3f527f63f491)
5
+ // DEFOLD. stable version 1.10.0 (591eb496d52f4140bc2c7de547131f1b9408b9b4)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -491,10 +491,18 @@ declare namespace b2d.body {
491
491
  export function apply_torque(body: any, torque: number): void
492
492
 
493
493
  /**
494
- * Print the body representation to the log output
494
+ * You can disable sleeping on this body. If you disable sleeping, the body will be woken.
495
+ * @param body body
496
+ * @param enable if false, the body will never sleep, and consume more CPU
497
+ */
498
+ export function enable_sleep(body: any, enable: any): void
499
+
500
+ /**
501
+ * Get the angle in radians.
495
502
  * @param body body
503
+ * @return angle the current world rotation angle in radians.
496
504
  */
497
- export function dump(body: any): void
505
+ export function get_angle(body: any): number
498
506
 
499
507
  /**
500
508
  * Get the angular damping of the body.
@@ -517,13 +525,6 @@ declare namespace b2d.body {
517
525
  */
518
526
  export function get_gravity_scale(body: any): number
519
527
 
520
- /**
521
- * Get the rotational inertia of the body about the local origin.
522
- * @param body body
523
- * @return inertia the rotational inertia, usually in kg-m^2.
524
- */
525
- export function get_inertia(body: any): number
526
-
527
528
  /**
528
529
  * Get the linear damping of the body.
529
530
  * @param body body
@@ -559,7 +560,7 @@ declare namespace b2d.body {
559
560
  * @param body body
560
561
  * @return center Get the local position of the center of mass.
561
562
  */
562
- export function get_local_center(body: any): vmath.vector3
563
+ export function get_local_center_of_mass(body: any): vmath.vector3
563
564
 
564
565
  /**
565
566
  * Gets a local point relative to the body's origin given a world point.
@@ -585,18 +586,18 @@ declare namespace b2d.body {
585
586
  export function get_mass(body: any): number
586
587
 
587
588
  /**
588
- * Get the next body in the world's body list.
589
+ * Get the world body origin position.
589
590
  * @param body body
590
- * @return body the next body
591
+ * @return position the world position of the body's origin.
591
592
  */
592
- export function get_next(body: any): any
593
+ export function get_position(body: any): vmath.vector3
593
594
 
594
595
  /**
595
- * Get the world body origin position.
596
+ * Get the rotational inertia of the body about the local origin.
596
597
  * @param body body
597
- * @return position the world position of the body's origin.
598
+ * @return inertia the rotational inertia, usually in kg-m^2.
598
599
  */
599
- export function get_position(body: any): vmath.vector3
600
+ export function get_rotational_inertia(body: any): number
600
601
 
601
602
  /**
602
603
  * Get the type of this body.
@@ -612,19 +613,12 @@ declare namespace b2d.body {
612
613
  */
613
614
  export function get_world(body: any): any
614
615
 
615
- /**
616
- * Get the angle in radians.
617
- * @param body body
618
- * @return angle the current world rotation angle in radians.
619
- */
620
- export function get_world_center(body: any): number
621
-
622
616
  /**
623
617
  * Get the world position of the center of mass.
624
618
  * @param body body
625
619
  * @return center Get the world position of the center of mass.
626
620
  */
627
- export function get_world_center(body: any): vmath.vector3
621
+ export function get_world_center_of_mass(body: any): vmath.vector3
628
622
 
629
623
  /**
630
624
  * Get the world coordinates of a point given the local coordinates.
@@ -675,7 +669,7 @@ declare namespace b2d.body {
675
669
  * @param body body
676
670
  * @return enabled true if the body is allowed to sleep
677
671
  */
678
- export function is_sleeping_allowed(body: any): any
672
+ export function is_sleeping_enabled(body: any): any
679
673
 
680
674
  /**
681
675
  * This resets the mass properties to the sum of the mass properties of the fixtures.
@@ -759,13 +753,6 @@ declare namespace b2d.body {
759
753
  */
760
754
  export function set_linear_velocity(body: any, velocity: vmath.vector3): void
761
755
 
762
- /**
763
- * You can disable sleeping on this body. If you disable sleeping, the body will be woken.
764
- * @param body body
765
- * @param enable if false, the body will never sleep, and consume more CPU
766
- */
767
- export function set_sleeping_allowed(body: any, enable: any): void
768
-
769
756
  /**
770
757
  * Set the position of the body's origin and rotation.
771
758
  * This breaks any contacts and wakes the other bodies.
@@ -2012,6 +1999,11 @@ declare namespace graphics {
2012
1999
  */
2013
2000
  export let TEXTURE_TYPE_2D_ARRAY: any
2014
2001
 
2002
+ /**
2003
+ * May be nil if the graphics driver doesn't support ...
2004
+ */
2005
+ export let TEXTURE_TYPE_3D: any
2006
+
2015
2007
  /**
2016
2008
  *
2017
2009
  */
@@ -2022,6 +2014,11 @@ declare namespace graphics {
2022
2014
  */
2023
2015
  export let TEXTURE_TYPE_IMAGE_2D: any
2024
2016
 
2017
+ /**
2018
+ * May be nil if the graphics driver doesn't support ...
2019
+ */
2020
+ export let TEXTURE_TYPE_IMAGE_3D: any
2021
+
2025
2022
  /**
2026
2023
  *
2027
2024
  */
@@ -3873,8 +3870,8 @@ declare namespace physics {
3873
3870
  export type apply_force = "apply_force"
3874
3871
 
3875
3872
  /**
3876
- * See physics.set_listener.
3877
- * This message is sent to a function specified in physics.set_listener
3873
+ * See physics.set_event_listener.
3874
+ * This message is sent to a function specified in physics.set_event_listener
3878
3875
  * when two collision objects collide.
3879
3876
  * This message only reports that a collision has occurred and will be sent once per frame and per colliding pair.
3880
3877
  * For more detailed information, check for the contact_point_event.
@@ -3893,8 +3890,8 @@ declare namespace physics {
3893
3890
  export type collision_response = "collision_response"
3894
3891
 
3895
3892
  /**
3896
- * See physics.set_listener.
3897
- * This message is sent to a function specified in physics.set_listener when
3893
+ * See physics.set_event_listener.
3894
+ * This message is sent to a function specified in physics.set_event_listener when
3898
3895
  * a collision object has contact points with another collision object.
3899
3896
  * Since multiple contact points can occur for two colliding objects, this event can be sent
3900
3897
  * multiple times in the same frame for the same two colliding objects. To only be notified once
@@ -4152,6 +4149,29 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
4152
4149
  */
4153
4150
  export function raycast_async(from: vmath.vector3, to: vmath.vector3, groups: any, request_id?: number): void
4154
4151
 
4152
+ /**
4153
+ * sets a physics world event listener. If a function is set, physics messages will no longer be sent to on_message.
4154
+ * @param callback A callback that receives an information about all the physics interactions in this physics world.
4155
+
4156
+ `self`
4157
+ The calling script
4158
+ `event`
4159
+ The type of event. Can be one of these messages:
4160
+
4161
+
4162
+ - contact_point_event
4163
+ - collision_event
4164
+ - trigger_event
4165
+ - ray_cast_response
4166
+ - ray_cast_missed
4167
+
4168
+
4169
+ `data`
4170
+ The callback value data is a table that contains event-related data. See the documentation for details on the messages.
4171
+
4172
+ */
4173
+ export function set_event_listener(callback: any): void
4174
+
4155
4175
  /**
4156
4176
  * Set the gravity in runtime. The gravity change is not global, it will only affect
4157
4177
  * the collection that the function is called from.
@@ -4191,29 +4211,6 @@ Note: The `collide_connected` field cannot be updated/changed after a connection
4191
4211
  */
4192
4212
  export function set_joint_properties(collisionobject: string | hash | url, joint_id: string | hash, properties: any): void
4193
4213
 
4194
- /**
4195
- * sets a physics world event listener. If a function is set, physics messages will no longer be sent.
4196
- * @param callback A callback that receives information about all the physics interactions in this physics world.
4197
-
4198
- `self`
4199
- The calling script
4200
- `event`
4201
- The type of event. Can be one of these messages:
4202
-
4203
-
4204
- - contact_point_event
4205
- - collision_event
4206
- - trigger_event
4207
- - ray_cast_response
4208
- - ray_cast_missed
4209
-
4210
-
4211
- `data`
4212
- The callback value data is a table that contains event-related data. See the documentation for details on the messages.
4213
-
4214
- */
4215
- export function set_listener(callback: any): void
4216
-
4217
4214
  /**
4218
4215
  * Sets or clears the masking of a group (maskbit) in a collision object.
4219
4216
  * @param url the collision object to change the mask of.
@@ -4289,21 +4286,21 @@ end
4289
4286
 
4290
4287
  /**
4291
4288
  * This message is sent back to the sender of a ray_cast_request, or to the physics world listener
4292
- * if it is set (see physics.set_listener), if the ray didn't hit any collision object.
4289
+ * if it is set (see physics.set_event_listener), if the ray didn't hit any collision object.
4293
4290
  * See physics.raycast_async for examples of how to use it.
4294
4291
  */
4295
4292
  export type ray_cast_missed = "ray_cast_missed"
4296
4293
 
4297
4294
  /**
4298
4295
  * This message is sent back to the sender of a ray_cast_request, or to the physics world listener
4299
- * if it is set (see physics.set_listener), if the ray hits a collision object.
4296
+ * if it is set (see physics.set_event_listener), if the ray hits a collision object.
4300
4297
  * See physics.raycast_async for examples of how to use it.
4301
4298
  */
4302
4299
  export type ray_cast_response = "ray_cast_response"
4303
4300
 
4304
4301
  /**
4305
- * See physics.set_listener.
4306
- * This message is sent to a function specified in physics.set_listener
4302
+ * See physics.set_event_listener.
4303
+ * This message is sent to a function specified in physics.set_event_listener
4307
4304
  * when a collision object interacts with another collision object and one of them is a trigger.
4308
4305
  * This message only reports that an interaction actually happened and will be sent once per colliding pair and frame.
4309
4306
  * For more detailed information, check for the contact_point_event.
@@ -4357,6 +4354,11 @@ declare namespace profiler {
4357
4354
  */
4358
4355
  export let VIEW_MODE_MINIMIZED: any
4359
4356
 
4357
+ /**
4358
+ * logs the current frame to the console
4359
+ */
4360
+ export function dump_frame(): void
4361
+
4360
4362
  /**
4361
4363
  * Creates and shows or hides and destroys the on-sceen profiler ui
4362
4364
  * The profiler is a real-time tool that shows the numbers of milliseconds spent
@@ -4408,8 +4410,8 @@ declare namespace profiler {
4408
4410
  export function get_memory_usage(): number
4409
4411
 
4410
4412
  /**
4411
- * Send a text to the profiler
4412
- * @param text the string to send to the profiler
4413
+ * Send a text to the connected profiler
4414
+ * @param text the string to send to the connected profiler
4413
4415
  */
4414
4416
  export function log_text(text: string): void
4415
4417
 
@@ -5399,14 +5401,18 @@ The texture type. Supported values:
5399
5401
 
5400
5402
 
5401
5403
  - `graphics.TEXTURE_TYPE_2D`
5402
- - `graphics.TEXTURE_TYPE_CUBE_MAP`
5403
5404
  - `graphics.TEXTURE_TYPE_IMAGE_2D`
5405
+ - `graphics.TEXTURE_TYPE_3D`
5406
+ - `graphics.TEXTURE_TYPE_IMAGE_3D`
5407
+ - `graphics.TEXTURE_TYPE_CUBE_MAP`
5404
5408
 
5405
5409
 
5406
5410
  `width`
5407
5411
  The width of the texture (in pixels). Must be larger than 0.
5408
5412
  `height`
5409
5413
  The width of the texture (in pixels). Must be larger than 0.
5414
+ `depth`
5415
+ The depth of the texture (in pixels). Must be larger than 0. Only used when `type` is `graphics.TEXTURE_TYPE_3D` or `graphics.TEXTURE_TYPE_IMAGE_3D`.
5410
5416
  `format`
5411
5417
  The texture format, note that some of these formats might not be supported by the running device. Supported values:
5412
5418
 
@@ -5467,6 +5473,11 @@ Creating an empty texture with no buffer data is not supported as a core feature
5467
5473
 
5468
5474
  * @param buffer optional buffer of precreated pixel data
5469
5475
  * @return path The path to the resource.
5476
+ ⚠ 3D Textures are currently only supported on OpenGL and Vulkan adapters. To check if your device supports 3D textures, use:
5477
+ ```lua
5478
+ if graphics.TEXTURE_TYPE_3D ~= nil then
5479
+ -- Device and graphics adapter support 3D textures
5480
+ end
5470
5481
  */
5471
5482
  export function create_texture(path: string, table: any, buffer?: buffer): hash
5472
5483
 
@@ -5489,6 +5500,9 @@ The texture type. Supported values:
5489
5500
 
5490
5501
 
5491
5502
  - `graphics.TEXTURE_TYPE_2D`
5503
+ - `graphics.TEXTURE_TYPE_IMAGE_2D`
5504
+ - `graphics.TEXTURE_TYPE_3D`
5505
+ - `graphics.TEXTURE_TYPE_IMAGE_3D`
5492
5506
  - `graphics.TEXTURE_TYPE_CUBE_MAP`
5493
5507
 
5494
5508
 
@@ -5496,6 +5510,8 @@ The texture type. Supported values:
5496
5510
  The width of the texture (in pixels). Must be larger than 0.
5497
5511
  `height`
5498
5512
  The width of the texture (in pixels). Must be larger than 0.
5513
+ `depth`
5514
+ The depth of the texture (in pixels). Must be larger than 0. Only used when `type` is `graphics.TEXTURE_TYPE_3D` or `graphics.TEXTURE_TYPE_IMAGE_3D`.
5499
5515
  `format`
5500
5516
  The texture format, note that some of these formats might not be supported by the running device. Supported values:
5501
5517
 
@@ -5527,6 +5543,12 @@ These constants might not be available on the device:
5527
5543
  - `graphics.TEXTURE_FORMAT_R32F`
5528
5544
  - `graphics.TEXTURE_FORMAT_RG32F`
5529
5545
 
5546
+ You can test if the device supports these values by checking if a specific enum is nil or not:
5547
+ `if graphics.TEXTURE_FORMAT_RGBA16F ~= nil then
5548
+ -- it is safe to use this format
5549
+ end
5550
+ `
5551
+
5530
5552
 
5531
5553
  `flags`
5532
5554
  Texture creation flags that can be used to dictate how the texture is created. Supported values:
@@ -5536,12 +5558,6 @@ Texture creation flags that can be used to dictate how the texture is created. S
5536
5558
  - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS` - The texture can be used as a memoryless texture, i.e only transient memory for the texture is used during rendering
5537
5559
  - `graphics.TEXTURE_USAGE_FLAG_STORAGE` - The texture can be used as a storage texture, which is required for a shader to write to the texture
5538
5560
 
5539
- You can test if the device supports these values by checking if a specific enum is nil or not:
5540
- `if graphics.TEXTURE_FORMAT_RGBA16F ~= nil then
5541
- -- it is safe to use this format
5542
- end
5543
- `
5544
-
5545
5561
 
5546
5562
  `max_mipmaps`
5547
5563
  optional max number of mipmaps. Defaults to zero, i.e no mipmap support
@@ -5554,10 +5570,14 @@ Creating an empty texture with no buffer data is not supported as a core feature
5554
5570
  - `COMPRESSION_TYPE_BASIS_UASTC`
5555
5571
 
5556
5572
  * @param buffer optional buffer of precreated pixel data
5557
- * @return path The path to the resource.
5558
5573
  * @return request_id The request id for the async request.
5574
+ ⚠ 3D Textures are currently only supported on OpenGL and Vulkan adapters. To check if your device supports 3D textures, use:
5575
+ ```lua
5576
+ if graphics.TEXTURE_TYPE_3D ~= nil then
5577
+ -- Device and graphics adapter support 3D textures
5578
+ end
5559
5579
  */
5560
- export function create_texture_async(path: string, table: any, buffer?: buffer): LuaMultiReturn<[hash, any]>
5580
+ export function create_texture_async(path: string, table: any, buffer?: buffer): any
5561
5581
 
5562
5582
  /**
5563
5583
  * Constructor-like function with two purposes:
@@ -5678,7 +5698,7 @@ width of the texture
5678
5698
  `height`
5679
5699
  height of the texture
5680
5700
  `depth`
5681
- depth of the texture (i.e 1 for a 2D texture and 6 for a cube map)
5701
+ depth of the texture (i.e 1 for a 2D texture, 6 for a cube map, number of slices for an array texture and the actual depth of a 3D texture)
5682
5702
  `mipmaps`
5683
5703
  number of mipmaps of the texture
5684
5704
  `flags`
@@ -5688,9 +5708,11 @@ The texture type. Supported values:
5688
5708
 
5689
5709
 
5690
5710
  - `graphics.TEXTURE_TYPE_2D`
5711
+ - `graphics.TEXTURE_TYPE_2D_ARRAY`
5691
5712
  - `graphics.TEXTURE_TYPE_IMAGE_2D`
5713
+ - `graphics.TEXTURE_TYPE_3D`
5714
+ - `graphics.TEXTURE_TYPE_IMAGE_3D`
5692
5715
  - `graphics.TEXTURE_TYPE_CUBE_MAP`
5693
- - `graphics.TEXTURE_TYPE_2D_ARRAY`
5694
5716
 
5695
5717
  */
5696
5718
  export function get_texture_info(path: any): any
@@ -5888,6 +5910,9 @@ The texture type. Supported values:
5888
5910
 
5889
5911
 
5890
5912
  - `graphics.TEXTURE_TYPE_2D`
5913
+ - `graphics.TEXTURE_TYPE_IMAGE_2D`
5914
+ - `graphics.TEXTURE_TYPE_3D`
5915
+ - `graphics.TEXTURE_TYPE_IMAGE_3D`
5891
5916
  - `graphics.TEXTURE_TYPE_CUBE_MAP`
5892
5917
 
5893
5918
 
@@ -5935,6 +5960,8 @@ end
5935
5960
  optional x offset of the texture (in pixels)
5936
5961
  `y`
5937
5962
  optional y offset of the texture (in pixels)
5963
+ `z`
5964
+ optional z offset of the texture (in pixels). Only applies to 3D textures
5938
5965
  `mipmap`
5939
5966
  optional mipmap to upload the data to
5940
5967
  `compression_type`
@@ -5946,6 +5973,11 @@ optional specify the compression type for the data in the buffer object that hol
5946
5973
 
5947
5974
  * @param buffer The buffer of precreated pixel data
5948
5975
  ⚠ To update a cube map texture you need to pass in six times the amount of data via the buffer, since a cube map has six sides!
5976
+ ⚠ 3D Textures are currently only supported on OpenGL and Vulkan adapters. To check if your device supports 3D textures, use:
5977
+ ```lua
5978
+ if graphics.TEXTURE_TYPE_3D ~= nil then
5979
+ -- Device and graphics adapter support 3D textures
5980
+ end
5949
5981
  */
5950
5982
  export function set_texture(path: hash | string, table: any, buffer: buffer): void
5951
5983
 
@@ -6542,6 +6574,12 @@ declare namespace window {
6542
6574
  */
6543
6575
  export function get_dim_mode(): any
6544
6576
 
6577
+ /**
6578
+ * This returns the content scale of the current display.
6579
+ * @return scale The display scale
6580
+ */
6581
+ export function get_display_scale(): number
6582
+
6545
6583
  /**
6546
6584
  * This returns the current lock state of the mouse cursor
6547
6585
  * @return state The lock state
@@ -6602,6 +6640,26 @@ The callback value `data` is a table which currently holds these values
6602
6640
  */
6603
6641
  export function set_mouse_lock(flag: boolean): void
6604
6642
 
6643
+ /**
6644
+ * Sets the window position.
6645
+ * @param x Horizontal position of window
6646
+ * @param y Vertical position of window
6647
+ */
6648
+ export function set_position(x: number, y: number): void
6649
+
6650
+ /**
6651
+ * Sets the window size. Works on desktop platforms only.
6652
+ * @param width Width of window
6653
+ * @param height Height of window
6654
+ */
6655
+ export function set_size(width: number, height: number): void
6656
+
6657
+ /**
6658
+ * Sets the window title. Works on desktop platforms.
6659
+ * @param title The title, encoded as UTF-8
6660
+ */
6661
+ export function set_title(title: string): void
6662
+
6605
6663
  }
6606
6664
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
6607
6665
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.65",
3
+ "version": "1.2.66",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [