@ts-defold/types 1.2.21 → 1.2.23

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 +89 -6
  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.4.7 (7a608d3ce6ed895d484956c1e76110ed8b78422a)
5
+ // DEFOLD. stable version 1.5.0 (57b34efdf44a922acc6f21d285b207029b53927d)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -1723,6 +1723,13 @@ with a custom curve. See the animation guide for more information.
1723
1723
  */
1724
1724
  export function get_line_break(node: node): boolean
1725
1725
 
1726
+ /**
1727
+ * Returns the material of a node.
1728
+ * The material must be mapped to the gui scene in the gui editor.
1729
+ * @param node node to get the material for
1730
+ */
1731
+ export function get_material(node: node): void
1732
+
1726
1733
  /**
1727
1734
  * Retrieves the node with the specified id.
1728
1735
  * @param id id of the node to retrieve
@@ -1882,6 +1889,13 @@ with a custom curve. See the animation guide for more information.
1882
1889
  */
1883
1890
  export function get_tracking(node: node): number
1884
1891
 
1892
+ /**
1893
+ * Get a node and all its children as a Lua table.
1894
+ * @param node root node to get node tree from
1895
+ * @return clones a table mapping node ids to the corresponding nodes
1896
+ */
1897
+ export function get_tree(node: node): any
1898
+
1885
1899
  /**
1886
1900
  * Returns `true` if a node is visible and `false` if it's not.
1887
1901
  * Invisible nodes are not rendered.
@@ -2263,6 +2277,21 @@ the new state of the emitter:
2263
2277
  */
2264
2278
  export function set_line_break(node: node, line_break: boolean): void
2265
2279
 
2280
+ /**
2281
+ * Set the material on a node. The material must be mapped to the gui scene in the gui editor,
2282
+ * and assigning a material is supported for all node types. To set the default material that
2283
+ * is assigned to the gui scene node, use `gui.reset_material(node_id)` instead.
2284
+ * @param node node to set material for
2285
+ * @param material material id
2286
+ */
2287
+ export function set_material(node: node, material: string | hash): void
2288
+
2289
+ /**
2290
+ * Resets the node material to the material assigned in the gui scene.
2291
+ * @param node node to reset the material for
2292
+ */
2293
+ export function set_material(node: node): void
2294
+
2266
2295
  /**
2267
2296
  * Sets the outer bounds mode for a pie node.
2268
2297
  * @param node node for which to set the outer bounds mode
@@ -2509,10 +2538,16 @@ the new state of the emitter:
2509
2538
  export type layout_changed = "layout_changed"
2510
2539
 
2511
2540
  /**
2512
- * The material used when rendering the gui. The type of the property is hash.
2541
+ * The main material (the default material assigned to a GUI) used when rendering the gui. The type of the property is hash.
2513
2542
  */
2514
2543
  export let material: any
2515
2544
 
2545
+ /**
2546
+ * The materials used when rendering the gui. The type of the property is hash.
2547
+ * Key must be specified in options table.
2548
+ */
2549
+ export let materials: any
2550
+
2516
2551
 
2517
2552
 
2518
2553
 
@@ -4514,11 +4549,26 @@ a list of the indices of the geometry in the form {i0, i1, i2, ..., in}. Each tr
4514
4549
  export function set_atlas(path: hash | string, table: any): void
4515
4550
 
4516
4551
  /**
4517
- * sets the buffer of a resource
4552
+ * Sets the buffer of a resource. By default, setting the resource buffer will either copy the data from the incoming buffer object
4553
+ * to the buffer stored in the destination resource, or make a new buffer object if the sizes between the source buffer and the destination buffer
4554
+ * stored in the resource differs. In some cases, e.g performance reasons, it might be beneficial to just set the buffer object on the resource without copying or cloning.
4555
+ * To achieve this, set the `transfer_ownership` flag to true in the argument table. Transferring ownership from a lua buffer to a resource with this function
4556
+ * works exactly the same as resource.create_buffer: the destination resource will take ownership of the buffer held by the lua reference, i.e the buffer will not automatically be removed
4557
+ * when the lua reference to the buffer is garbage collected.
4558
+ * Note: When setting a buffer with `transfer_ownership = true`, the currently bound buffer in the resource will be destroyed.
4518
4559
  * @param path The path to the resource
4519
4560
  * @param buffer The resource buffer
4561
+ * @param table A table containing info about how to set the buffer. Supported entries:
4562
+
4563
+
4564
+
4565
+ `transfer_ownership`
4566
+ optional flag to determine wether or not the resource should take over ownership of the buffer object (default false)
4567
+
4568
+
4569
+
4520
4570
  */
4521
- export function set_buffer(path: hash | string, buffer: buffer): void
4571
+ export function set_buffer(path: hash | string, buffer: buffer, table: any): void
4522
4572
 
4523
4573
  /**
4524
4574
  * Update internal sound resource (wavc/oggc) with new data
@@ -4788,6 +4838,14 @@ If the engine is a debug or release version
4788
4838
  */
4789
4839
  export function get_engine_info(): any
4790
4840
 
4841
+ /**
4842
+ * Create a path to the host device for unit testing
4843
+ * Useful for saving logs etc during development
4844
+ * @param filename file to read from
4845
+ * @return host_path the path prefixed with the proper host mount
4846
+ */
4847
+ export function get_host_path(filename: string): string
4848
+
4791
4849
  /**
4792
4850
  * Returns an array of tables with information on network interfaces.
4793
4851
  * @return ifaddrs an array of tables. Each table entry contain the following fields:
@@ -5996,6 +6054,13 @@ declare namespace camera {
5996
6054
  */
5997
6055
  export type acquire_camera_focus = "acquire_camera_focus"
5998
6056
 
6057
+ /**
6058
+ * The ratio between the frustum width and height. Used when calculating the
6059
+ * projection of a perspective camera.
6060
+ * The type of the property is number.
6061
+ */
6062
+ export let aspect_ratio: any
6063
+
5999
6064
  /**
6000
6065
  * Camera frustum far plane.
6001
6066
  * The type of the property is float.
@@ -6020,6 +6085,12 @@ declare namespace camera {
6020
6085
  */
6021
6086
  export let orthographic_zoom: any
6022
6087
 
6088
+ /**
6089
+ * READ ONLY The calculated projection matrix of the camera.
6090
+ * The type of the property is matrix4.
6091
+ */
6092
+ export let projection: any
6093
+
6023
6094
  /**
6024
6095
  *
6025
6096
  * Post this message to a camera-component to deactivate it. The camera is then removed from the active cameras.
@@ -6035,6 +6106,12 @@ declare namespace camera {
6035
6106
  */
6036
6107
  export type set_camera = "set_camera"
6037
6108
 
6109
+ /**
6110
+ * READ ONLY The calculated view matrix of the camera.
6111
+ * The type of the property is matrix4.
6112
+ */
6113
+ export let view: any
6114
+
6038
6115
  }
6039
6116
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
6040
6117
 
@@ -6742,12 +6819,12 @@ sound pan between -1 and 1, default is 0. The final pan of the sound will be an
6742
6819
  `speed`
6743
6820
  sound speed where 1.0 is normal speed, 0.5 is half speed and 2.0 is double speed. The final speed of the sound will be a multiplication of this speed and the sound speed.
6744
6821
 
6745
- * @param complete_function function to call when the sound has finished playing.
6822
+ * @param complete_function function to call when the sound has finished playing or stopped manually via sound.stop.
6746
6823
 
6747
6824
  `self`
6748
6825
  The current object.
6749
6826
  `message_id`
6750
- The name of the completion message, `"sound_done"`.
6827
+ The name of the completion message, which can be either `"sound_done"` if the sound has finished playing, or `"sound_stopped"` if it was stopped manually.
6751
6828
  `message`
6752
6829
  Information about the completion:
6753
6830
 
@@ -6804,6 +6881,12 @@ The invoker of the callback: the sound component.
6804
6881
  */
6805
6882
  export type sound_done = "sound_done"
6806
6883
 
6884
+ /**
6885
+ * This message is sent back to the sender of a `play_sound` message, if the sound
6886
+ * has been manually stopped.
6887
+ */
6888
+ export type sound_stopped = "sound_stopped"
6889
+
6807
6890
  /**
6808
6891
  * The speed on the sound-component where 1.0 is normal speed, 0.5 is half
6809
6892
  * speed and 2.0 is double speed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [