@ts-defold/types 1.2.47 → 1.2.48

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 +95 -17
  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.0 (d6882f432beca85d460ec42497888157c356d058)
5
+ // DEFOLD. stable version 1.9.1 (3be87d89fd5a93a63f527351fbedb84f8a875812)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -775,6 +775,7 @@ declare namespace go {
775
775
  * and be a part of the simulation. A component is disabled when it receives the `disable` message.
776
776
  * undefined Components that currently supports this message are:
777
777
  *
778
+ * - Camera
778
779
  * - Collection Proxy
779
780
  * - Collision Object
780
781
  * - Gui
@@ -793,6 +794,7 @@ declare namespace go {
793
794
  * and be a part of the simulation. A component is disabled when it receives the `disable` message.
794
795
  * undefined Components that currently supports this message are:
795
796
  *
797
+ * - Camera
796
798
  * - Collection Proxy
797
799
  * - Collision Object
798
800
  * - Gui
@@ -1759,6 +1761,11 @@ declare namespace gui {
1759
1761
  */
1760
1762
  export let PROP_INNER_RADIUS: any
1761
1763
 
1764
+ /**
1765
+ * leading property
1766
+ */
1767
+ export let PROP_LEADING: any
1768
+
1762
1769
  /**
1763
1770
  * outline color property
1764
1771
  */
@@ -1794,6 +1801,11 @@ declare namespace gui {
1794
1801
  */
1795
1802
  export let PROP_SLICE9: any
1796
1803
 
1804
+ /**
1805
+ * tracking property
1806
+ */
1807
+ export let PROP_TRACKING: any
1808
+
1797
1809
  /**
1798
1810
  * data error
1799
1811
  */
@@ -1848,6 +1860,8 @@ declare namespace gui {
1848
1860
  - `"size"`
1849
1861
  - `"fill_angle"` (pie)
1850
1862
  - `"inner_radius"` (pie)
1863
+ - `"leading"` (text)
1864
+ - `"tracking"` (text)
1851
1865
  - `"slice9"` (slice9)
1852
1866
 
1853
1867
  The following property constants are defined equaling the corresponding property string names.
@@ -1862,6 +1876,8 @@ The following property constants are defined equaling the corresponding property
1862
1876
  - `gui.PROP_SIZE`
1863
1877
  - `gui.PROP_FILL_ANGLE`
1864
1878
  - `gui.PROP_INNER_RADIUS`
1879
+ - `gui.PROP_LEADING`
1880
+ - `gui.PROP_TRACKING`
1865
1881
  - `gui.PROP_SLICE9`
1866
1882
 
1867
1883
  * @param to target property value
@@ -1899,6 +1915,8 @@ with a custom curve. See the animation guide for more information.
1899
1915
  - `"size"`
1900
1916
  - `"fill_angle"` (pie)
1901
1917
  - `"inner_radius"` (pie)
1918
+ - `"leading"` (text)
1919
+ - `"tracking"` (text)
1902
1920
  - `"slice9"` (slice9)
1903
1921
 
1904
1922
  */
@@ -1946,7 +1964,7 @@ with a custom curve. See the animation guide for more information.
1946
1964
  * Instead of using specific getters such as gui.get_position or gui.get_scale,
1947
1965
  * you can use gui.get instead and supply the property as a string or a hash.
1948
1966
  * While this function is similar to go.get, there are a few more restrictions
1949
- * when operating in the gui namespace. Most notably, only these propertie identifiers are supported:
1967
+ * when operating in the gui namespace. Most notably, only these explicitly named properties are supported:
1950
1968
  *
1951
1969
  * - `"position"`
1952
1970
  * - `"rotation"`
@@ -1958,14 +1976,19 @@ with a custom curve. See the animation guide for more information.
1958
1976
  * - `"size"`
1959
1977
  * - `"fill_angle"` (pie)
1960
1978
  * - `"inner_radius"` (pie)
1979
+ * - `"leading"` (text)
1980
+ * - `"tracking"` (text)
1961
1981
  * - `"slice9"` (slice9)
1962
1982
  *
1963
1983
  * The value returned will either be a vmath.vector4 or a single number, i.e getting the "position"
1964
1984
  * property will return a vec4 while getting the "position.x" property will return a single value.
1985
+ * You can also use this function to get material constants.
1965
1986
  * @param node node to get the property for
1966
1987
  * @param property the property to retrieve
1988
+ * @param options optional options table (only applicable for material constants)
1989
+ index into array property (1 based)
1967
1990
  */
1968
- export function get(node: node, property: any): void
1991
+ export function get(node: node, property: any, options?: any): void
1969
1992
 
1970
1993
  /**
1971
1994
  * Returns the adjust mode of a node.
@@ -1984,8 +2007,9 @@ with a custom curve. See the animation guide for more information.
1984
2007
  /**
1985
2008
  * gets the node alpha
1986
2009
  * @param node node from which to get alpha
2010
+ * @return alpha alpha
1987
2011
  */
1988
- export function get_alpha(node: node): void
2012
+ export function get_alpha(node: node): number
1989
2013
 
1990
2014
  /**
1991
2015
  * Returns the blend mode of a node.
@@ -2005,7 +2029,7 @@ with a custom curve. See the animation guide for more information.
2005
2029
  /**
2006
2030
  * If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
2007
2031
  * @param node node from which to get the clipping inverted state
2008
- * @return inverted true or false
2032
+ * @return inverted `true` or `false`
2009
2033
  */
2010
2034
  export function get_clipping_inverted(node: node): boolean
2011
2035
 
@@ -2023,7 +2047,7 @@ with a custom curve. See the animation guide for more information.
2023
2047
  /**
2024
2048
  * If node is set as visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
2025
2049
  * @param node node from which to get the clipping visibility state
2026
- * @return visible true or false
2050
+ * @return visible `true` or `false`
2027
2051
  */
2028
2052
  export function get_clipping_visible(node: node): boolean
2029
2053
 
@@ -2136,8 +2160,9 @@ with a custom curve. See the animation guide for more information.
2136
2160
  /**
2137
2161
  * gets the node inherit alpha state
2138
2162
  * @param node node from which to get the inherit alpha state
2163
+ * @return inherit_alpha `true` or `false`
2139
2164
  */
2140
- export function get_inherit_alpha(node: node): void
2165
+ export function get_inherit_alpha(node: node): boolean
2141
2166
 
2142
2167
  /**
2143
2168
  * Returns the inner radius of a pie node.
@@ -2179,8 +2204,9 @@ with a custom curve. See the animation guide for more information.
2179
2204
  * Returns the material of a node.
2180
2205
  * The material must be mapped to the gui scene in the gui editor.
2181
2206
  * @param node node to get the material for
2207
+ * @return materal material id
2182
2208
  */
2183
- export function get_material(node: node): void
2209
+ export function get_material(node: node): hash
2184
2210
 
2185
2211
  /**
2186
2212
  * Retrieves the node with the specified id.
@@ -2558,7 +2584,7 @@ the new state of the emitter:
2558
2584
  * Instead of using specific setteres such as gui.set_position or gui.set_scale,
2559
2585
  * you can use gui.set instead and supply the property as a string or a hash.
2560
2586
  * While this function is similar to go.get and go.set, there are a few more restrictions
2561
- * when operating in the gui namespace. Most notably, only these propertie identifiers are supported:
2587
+ * when operating in the gui namespace. Most notably, only these named properties identifiers are supported:
2562
2588
  *
2563
2589
  * - `"position"`
2564
2590
  * - `"rotation"`
@@ -2570,6 +2596,8 @@ the new state of the emitter:
2570
2596
  * - `"size"`
2571
2597
  * - `"fill_angle"` (pie)
2572
2598
  * - `"inner_radius"` (pie)
2599
+ * - `"leading"` (text)
2600
+ * - `"tracking"` (text)
2573
2601
  * - `"slice9"` (slice9)
2574
2602
  *
2575
2603
  * The value to set must either be a vmath.vector4, vmath.vector3, vmath.quat or a single number and depends on the property name you want to set.
@@ -2578,11 +2606,17 @@ the new state of the emitter:
2578
2606
  * Note: When setting the rotation using the "rotation" property, you need to pass in a vmath.quat. This behaviour is different than from the gui.set_rotation function,
2579
2607
  * the intention is to move new functionality closer to go namespace so that migrating between gui and go is easier. To set the rotation using degrees instead,
2580
2608
  * use the "euler" property instead. The rotation and euler properties are linked, changing one of them will change the backing data of the other.
2609
+ * Similar to go.set, you can also use gui.set for setting material constant values on a node. E.g if a material has specified a constant called `tint` in
2610
+ * the .material file, you can use gui.set to set the value of that constant by calling `gui.set(node, "tint", vmath.vec4(1,0,0,1))`, or `gui.set(node, "matrix", vmath.matrix4())`
2611
+ * if the constant is a matrix. Arrays are also supported by gui.set - to set an array constant, you need to pass in an options table with the 'index' key set.
2612
+ * If the material has a constant array called 'tint_array' specified in the material, you can use `gui.set(node, "tint_array", vmath.vec4(1,0,0,1), { index = 4})` to set the fourth array element to a different value.
2581
2613
  * @param node node to set the property for
2582
2614
  * @param property the property to set
2583
2615
  * @param value the property to set
2616
+ * @param options optional options table (only applicable for material constants)
2617
+ index into array property (1 based)
2584
2618
  */
2585
- export function set(node: node, property: any, value: number | vmath.vector4 | vmath.vector3 | vmath.quaternion): void
2619
+ export function set(node: node, property: any, value: number | vmath.vector4 | vmath.vector3 | vmath.quaternion, options?: any): void
2586
2620
 
2587
2621
  /**
2588
2622
  * Sets the adjust mode on a node.
@@ -2623,7 +2657,7 @@ the new state of the emitter:
2623
2657
  /**
2624
2658
  * If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
2625
2659
  * @param node node to set clipping inverted state for
2626
- * @param inverted true or false
2660
+ * @param inverted `true` or `false`
2627
2661
  */
2628
2662
  export function set_clipping_inverted(node: node, inverted: boolean): void
2629
2663
 
@@ -2641,7 +2675,7 @@ the new state of the emitter:
2641
2675
  /**
2642
2676
  * If node is set as an visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
2643
2677
  * @param node node to set clipping visibility for
2644
- * @param visible true or false
2678
+ * @param visible `true` or `false`
2645
2679
  */
2646
2680
  export function set_clipping_visible(node: node, visible: boolean): void
2647
2681
 
@@ -2739,7 +2773,7 @@ the new state of the emitter:
2739
2773
  /**
2740
2774
  * sets the node inherit alpha state
2741
2775
  * @param node node from which to set the inherit alpha state
2742
- * @param inherit_alpha true or false
2776
+ * @param inherit_alpha `true` or `false`
2743
2777
  */
2744
2778
  export function set_inherit_alpha(node: node, inherit_alpha: boolean): void
2745
2779
 
@@ -2770,7 +2804,7 @@ the new state of the emitter:
2770
2804
  * Sets the line-break mode on a text node.
2771
2805
  * This is only useful for text nodes.
2772
2806
  * @param node node to set line-break for
2773
- * @param line_break true or false
2807
+ * @param line_break `true` or `false`
2774
2808
  */
2775
2809
  export function set_line_break(node: node, line_break: boolean): void
2776
2810
 
@@ -5252,7 +5286,15 @@ The attachment buffer type. Supported values:
5252
5286
  - `resource.BUFFER_TYPE_COLOR2`
5253
5287
  - `resource.BUFFER_TYPE_COLOR3`
5254
5288
  - `resource.BUFFER_TYPE_DEPTH`
5255
- - `resource.BUFFER_TYPE_STENCIL`
5289
+
5290
+ `resource.BUFFER_TYPE_STENCIL`
5291
+
5292
+
5293
+
5294
+ `texture`
5295
+ The hashed path to the attachment texture resource. This field is only available if the render target passed in is a resource.
5296
+
5297
+
5256
5298
 
5257
5299
  */
5258
5300
  export function get_render_target_info(path: any): any
@@ -5337,6 +5379,18 @@ The texture type. Supported values:
5337
5379
  */
5338
5380
  export function release(path: hash | string): void
5339
5381
 
5382
+ /**
5383
+ * Constructor-like function with two purposes:
5384
+ *
5385
+ * - Load the specified resource as part of loading the script
5386
+ * - Return a hash to the run-time version of the resource
5387
+ *
5388
+ * ⚠ This function can only be called within go.property function calls.
5389
+ * @param path optional resource path string to the resource
5390
+ * @return path a path hash to the binary version of the resource
5391
+ */
5392
+ export function render_target(path?: string): hash
5393
+
5340
5394
  /**
5341
5395
  * Sets the resource data for a specific resource
5342
5396
  * @param path The path to the resource
@@ -7087,10 +7141,9 @@ declare namespace camera {
7087
7141
  /**
7088
7142
  * This function returns a table with all the camera URLs that have been
7089
7143
  * registered in the render context.
7090
- * @param camera camera id
7091
7144
  * @return cameras a table with all camera URLs
7092
7145
  */
7093
- export function get_cameras(camera: any): any
7146
+ export function get_cameras(): any
7094
7147
 
7095
7148
  /**
7096
7149
  * get far z
@@ -8219,6 +8272,31 @@ declare namespace tilemap {
8219
8272
  */
8220
8273
  export function get_tile(url: string | hash | url, layer: string | hash, x: number, y: number): number
8221
8274
 
8275
+ /**
8276
+ * Get the tile information at the specified position in the tilemap.
8277
+ * The position is identified by the tile index starting at origin
8278
+ * with index 1, 1. (see tilemap.set_tile())
8279
+ * Which tile map and layer to query is identified by the URL and the
8280
+ * layer name parameters.
8281
+ * @param url the tile map
8282
+ * @param layer name of the layer for the tile
8283
+ * @param x x-coordinate of the tile
8284
+ * @param y y-coordinate of the tile
8285
+ * @return tile_info index of the tile
8286
+ */
8287
+ export function get_tile_info(url: string | hash | url, layer: string | hash, x: number, y: number): any
8288
+
8289
+ /**
8290
+ * Retrieves all the tiles for the specified layer in the tilemap.
8291
+ * It returns a table of rows where the keys are the
8292
+ * tile positions (see tilemap.get_bounds()).
8293
+ * You can iterate it using `tiles[row_index][column_index]`.
8294
+ * @param url the tilemap
8295
+ * @param layer the name of the layer for the tiles
8296
+ * @return tiles a table of rows representing the layer
8297
+ */
8298
+ export function get_tiles(url: string | hash | url, layer: string | hash): any
8299
+
8222
8300
  /**
8223
8301
  * Replace a tile in a tile map with a new tile.
8224
8302
  * The coordinates of the tiles are indexed so that the "first" tile just
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [