@ts-defold/types 1.2.18 → 1.2.20

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 +37 -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.3.6 (905234d8da2e642f1075c73aaa1bfb72e49199e3)
5
+ // DEFOLD. stable version 1.3.7 (f0ad06a2f1fbf0e9cbddbf96162a75bc006d84bb)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -4452,7 +4452,7 @@ The HTTP user agent, i.e. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) Apple
4452
4452
  * @param attributes table with attributes
4453
4453
  `target`
4454
4454
  : Optional. Specifies the target attribute or the name of the window. The following values are supported:
4455
- - `_self` - URL replaces the current page. This is default.
4455
+ - `_self` - (default value) URL replaces the current page.
4456
4456
  - `_blank` - URL is loaded into a new window, or tab.
4457
4457
  - `_parent` - URL is loaded into the parent frame.
4458
4458
  - `_top` - URL replaces any framesets that may be loaded.
@@ -4626,6 +4626,12 @@ declare namespace window {
4626
4626
  */
4627
4627
  export function get_dim_mode(): any
4628
4628
 
4629
+ /**
4630
+ * This returns the current lock state of the mouse cursor
4631
+ * @return state The lock state
4632
+ */
4633
+ export function get_mouse_lock(): boolean
4634
+
4629
4635
  /**
4630
4636
  * This returns the current window size (width and height).
4631
4637
  * @return width The window width
@@ -4672,6 +4678,14 @@ The callback value `data` is a table which currently holds these values
4672
4678
  */
4673
4679
  export function set_listener(callback: any): void
4674
4680
 
4681
+ /**
4682
+ * Set the locking state for current mouse cursor on a PC platform.
4683
+ * This function locks or unlocks the mouse cursor to the center point of the window. While the cursor is locked,
4684
+ * mouse position updates will still be sent to the scripts as usual.
4685
+ * @param flag The lock state for the mouse cursor
4686
+ */
4687
+ export function set_mouse_lock(flag: boolean): void
4688
+
4675
4689
  }
4676
4690
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
4677
4691
 
@@ -4795,6 +4809,19 @@ declare namespace html5 {
4795
4809
  */
4796
4810
  export function run(code: string): string
4797
4811
 
4812
+ /**
4813
+ * Set a JavaScript interaction listener callaback from lua that will be
4814
+ * invoked when a user interacts with the web page by clicking, touching or typing.
4815
+ * The callback can then call DOM restricted actions like requesting a pointer lock,
4816
+ * or start playing sounds the first time the callback is invoked.
4817
+ * @param callback The interaction callback. Pass an empty function or nil if you no longer wish to receive callbacks.
4818
+
4819
+ `self`
4820
+ The calling script
4821
+
4822
+ */
4823
+ export function set_interaction_listener(callback: any): void
4824
+
4798
4825
  }
4799
4826
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
4800
4827
 
@@ -4888,6 +4915,14 @@ declare namespace json {
4888
4915
  */
4889
4916
  export function decode(json: string): any
4890
4917
 
4918
+ /**
4919
+ * Encode a lua table to a JSON string.
4920
+ * A Lua error is raised for syntax errors.
4921
+ * @param tbl lua table to encode
4922
+ * @return json encoded json
4923
+ */
4924
+ export function encode(tbl: any): string
4925
+
4891
4926
  }
4892
4927
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
4893
4928
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.18",
3
+ "version": "1.2.20",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [