@ts-defold/types 1.2.55 → 1.2.57

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 -2
  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.5 (87b6907759f7b8dff830d54b2250b8d721bde291)
5
+ // DEFOLD. stable version 1.9.6 (4035511f1e258a47b77798a2005c024609ed2c67)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -2370,6 +2370,31 @@ declare namespace gui {
2370
2370
  */
2371
2371
  export let SIZE_MODE_MANUAL: any
2372
2372
 
2373
+ /**
2374
+ * box type
2375
+ */
2376
+ export let TYPE_BOX: any
2377
+
2378
+ /**
2379
+ * custom type
2380
+ */
2381
+ export let TYPE_CUSTOM: any
2382
+
2383
+ /**
2384
+ * particlefx type
2385
+ */
2386
+ export let TYPE_PARTICLEFX: any
2387
+
2388
+ /**
2389
+ * pie type
2390
+ */
2391
+ export let TYPE_PIE: any
2392
+
2393
+ /**
2394
+ * text type
2395
+ */
2396
+ export let TYPE_TEXT: any
2397
+
2373
2398
  /**
2374
2399
  * This starts an animation of a node property according to the specified parameters.
2375
2400
  * If the node property is already being animated, that animation will be canceled and
@@ -2913,6 +2938,21 @@ index into array property (1 based)
2913
2938
  */
2914
2939
  export function get_tree(node: node): any
2915
2940
 
2941
+ /**
2942
+ * gets the node type
2943
+ * @param node node from which to get the type
2944
+ * @return type type
2945
+
2946
+ - `gui.TYPE_BOX`
2947
+ - `gui.TYPE_TEXT`
2948
+ - `gui.TYPE_PIE`
2949
+ - `gui.TYPE_PARTICLEFX`
2950
+ - `gui.TYPE_CUSTOM`
2951
+
2952
+ * @return subtype id of the custom type
2953
+ */
2954
+ export function get_type(node: node): LuaMultiReturn<[any, any, any]>
2955
+
2916
2956
  /**
2917
2957
  * Returns `true` if a node is visible and `false` if it's not.
2918
2958
  * Invisible nodes are not rendered.
@@ -4215,7 +4255,6 @@ declare namespace profiler {
4215
4255
  To stop recording, switch to a different mode such as `MODE_PAUSE` or `MODE_RUN`.
4216
4256
  You can also use the `view_recorded_frame` function to display a recorded frame. Doing so stops the recording as well.
4217
4257
  Every time you switch to recording mode the recording buffer is cleared.
4218
- The recording buffer is also cleared when setting the `MODE_SHOW_PEAK_FRAME` mode.
4219
4258
  */
4220
4259
  export function set_ui_mode(mode: any): void
4221
4260
 
@@ -4772,6 +4811,22 @@ If true, the renderer will use the cameras view-projection matrix for frustum cu
4772
4811
  */
4773
4812
  export function set_depth_mask(depth: boolean): void
4774
4813
 
4814
+ /**
4815
+ * Set or remove listener. Currenly only only two type of events can arrived:
4816
+ * `render.CONTEXT_EVENT_CONTEXT_LOST` - when rendering context lost. Rending paused and all graphics resources become invalid.
4817
+ * `render.CONTEXT_EVENT_CONTEXT_RESTORED` - when rendering context was restored. Rendering still paused and graphics resources still
4818
+ * invalid but can be reloaded.
4819
+ * @param callback A callback that receives all render related events.
4820
+ Pass `nil` if want to remove listener.
4821
+
4822
+ `self`
4823
+ The render script
4824
+ `event_type`
4825
+ Rendering event. Possible values: `render.CONTEXT_EVENT_CONTEXT_LOST`, `render.CONTEXT_EVENT_CONTEXT_RESTORED`
4826
+
4827
+ */
4828
+ export function set_listener(callback: any): void
4829
+
4775
4830
  /**
4776
4831
  * Sets the scale and units used to calculate depth values.
4777
4832
  * If `graphics.STATE_POLYGON_OFFSET_FILL` is enabled, each fragment's depth value
@@ -5736,6 +5791,12 @@ declare namespace sys {
5736
5791
  */
5737
5792
  export type reboot = "reboot"
5738
5793
 
5794
+ /**
5795
+ * Resume rendering.
5796
+ * This message can only be sent to the designated `@system` socket.
5797
+ */
5798
+ export type resume_rendering = "resume_rendering"
5799
+
5739
5800
  /**
5740
5801
  * Set game update-frequency (frame cap). This option is equivalent to `display.update_frequency` in
5741
5802
  * the "game.project" settings but set in run-time. If `Vsync` checked in "game.project", the rate will
@@ -6824,6 +6885,17 @@ declare namespace vmath {
6824
6885
  */
6825
6886
  export function dot(v1: vmath.vector3 | vmath.vector4, v2: vmath.vector3 | vmath.vector4): number
6826
6887
 
6888
+ /**
6889
+ * Converts euler angles (x, y, z) in degrees into a quaternion
6890
+ * The error is guaranteed to be less than 0.001.
6891
+ * If the first argument is vector3, its values are used as x, y, z angles.
6892
+ * @param x rotation around x-axis in degrees or vector3 with euler angles in degrees
6893
+ * @param y rotation around y-axis in degrees
6894
+ * @param z rotation around z-axis in degrees
6895
+ * @return q quaternion describing an equivalent rotation (231 (YZX) rotation sequence)
6896
+ */
6897
+ export function euler_to_quat(x: number | vmath.vector3, y: number, z: number): vmath.quaternion
6898
+
6827
6899
  /**
6828
6900
  * The resulting matrix is the inverse of the supplied matrix.
6829
6901
  * ⚠ For ortho-normal matrices, e.g. regular object transformation,
@@ -7173,6 +7245,18 @@ declare namespace vmath {
7173
7245
  */
7174
7246
  export function quat_rotation_z(angle: number): vmath.quaternion
7175
7247
 
7248
+ /**
7249
+ * Converts a quaternion into euler angles (r0, r1, r2), based on YZX rotation order.
7250
+ * To handle gimbal lock (singularity at r1 ~ +/- 90 degrees), the cut off is at r0 = +/- 88.85 degrees, which snaps to +/- 90.
7251
+ * The provided quaternion is expected to be normalized.
7252
+ * The error is guaranteed to be less than +/- 0.02 degrees
7253
+ * @param q source quaternion
7254
+ * @return x euler angle x in degrees
7255
+ * @return y euler angle y in degrees
7256
+ * @return z euler angle z in degrees
7257
+ */
7258
+ export function quat_to_euler(q: vmath.quaternion): LuaMultiReturn<[number, number, number]>
7259
+
7176
7260
  /**
7177
7261
  * Returns a new vector from the supplied vector that is
7178
7262
  * rotated by the rotation described by the supplied
@@ -7340,6 +7424,13 @@ declare namespace camera {
7340
7424
  */
7341
7425
  export function get_cameras(): any
7342
7426
 
7427
+ /**
7428
+ * get enabled
7429
+ * @param camera camera id
7430
+ * @return flag true if the camera is enabled
7431
+ */
7432
+ export function get_enabled(camera: any): any
7433
+
7343
7434
  /**
7344
7435
  * get far z
7345
7436
  * @param camera camera id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.55",
3
+ "version": "1.2.57",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [