@ts-defold/types 1.2.50 → 1.2.51

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 +66 -5
  2. package/package.json +2 -2
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.2 (3251ca82359cf238a1074e383281e3126547d50b)
5
+ // DEFOLD. stable version 1.9.3 (e4aaff11f49c941fde1dd93883cf69c6b8abebe4)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -10,6 +10,9 @@ declare type hash = {
10
10
  }
11
11
 
12
12
  declare type url = {
13
+ socket: hash,
14
+ path: hash,
15
+ fragment: hash,
13
16
  }
14
17
 
15
18
  declare type node = {
@@ -6140,6 +6143,61 @@ The stack traceback.
6140
6143
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
6141
6144
 
6142
6145
 
6146
+ declare namespace types {
6147
+
6148
+ /**
6149
+ * Check if passed type is hash.
6150
+ * @param v Variable to check type
6151
+ * @return result True if passed type is hash
6152
+ */
6153
+ export function is_hash(v: any): boolean
6154
+
6155
+ /**
6156
+ * Check if passed type is matrix4.
6157
+ * @param v Variable to check type
6158
+ * @return result True if passed type is matrix4
6159
+ */
6160
+ export function is_matrix4(v: any): boolean
6161
+
6162
+ /**
6163
+ * Check if passed type is quaternion.
6164
+ * @param v Variable to check type
6165
+ * @return result True if passed type is quaternion
6166
+ */
6167
+ export function is_quat(v: any): boolean
6168
+
6169
+ /**
6170
+ * Check if passed type is URL.
6171
+ * @param v Variable to check type
6172
+ * @return result True if passed type is URL
6173
+ */
6174
+ export function is_url(v: any): boolean
6175
+
6176
+ /**
6177
+ * Check if passed type is vector.
6178
+ * @param v Variable to check type
6179
+ * @return result True if passed type is vector
6180
+ */
6181
+ export function is_vector(v: any): boolean
6182
+
6183
+ /**
6184
+ * Check if passed type is vector3.
6185
+ * @param v Variable to check type
6186
+ * @return result True if passed type is vector3
6187
+ */
6188
+ export function is_vector3(v: any): boolean
6189
+
6190
+ /**
6191
+ * Check if passed type is vector4.
6192
+ * @param v Variable to check type
6193
+ * @return result True if passed type is vector4
6194
+ */
6195
+ export function is_vector4(v: any): boolean
6196
+
6197
+ }
6198
+ // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
6199
+
6200
+
6143
6201
  declare namespace window {
6144
6202
 
6145
6203
  /**
@@ -6436,6 +6494,8 @@ The response data. Contains the fields:
6436
6494
  `headers`: all the returned headers
6437
6495
  `path`: the stored path (if saved to disc)
6438
6496
  `error`: if any unforeseen errors occurred (e.g. file I/O)
6497
+ `bytes_received`: the amount of bytes received/sent for a request, only if option `report_progress` is true
6498
+ `bytes_total`: the total amount of bytes for a request, only if option `report_progress` is true
6439
6499
 
6440
6500
  * @param headers optional table with custom headers
6441
6501
  * @param post_data optional data to send
@@ -6445,6 +6505,7 @@ The response data. Contains the fields:
6445
6505
  Path should be absolute
6446
6506
  Not available in HTML5 build
6447
6507
  Not available in HTML5 build
6508
+ `report_progress`: when it is true, the amount of bytes sent and/or received for a request will be passed into the callback function
6448
6509
 
6449
6510
  */
6450
6511
  export function request(url: string, method: string, callback: any, headers?: any, post_data?: string, options?: any): void
@@ -6636,7 +6697,7 @@ declare namespace timer {
6636
6697
  * @param handle the timer handle returned by timer.delay()
6637
6698
  * @return true if the timer was active, false if the timer is already cancelled / complete
6638
6699
  */
6639
- export function cancel(handle: hash): boolean
6700
+ export function cancel(handle: any): boolean
6640
6701
 
6641
6702
  /**
6642
6703
  * Adds a timer and returns a unique handle.
@@ -6658,7 +6719,7 @@ The elapsed time - on first trigger it is time since timer.delay call, otherwise
6658
6719
 
6659
6720
  * @return handle identifier for the create timer, returns timer.INVALID_TIMER_HANDLE if the timer can not be created
6660
6721
  */
6661
- export function delay(delay: number, repeat: boolean, callback: any): hash
6722
+ export function delay(delay: number, repeat: boolean, callback: any): any
6662
6723
 
6663
6724
  /**
6664
6725
  * Get information about timer.
@@ -6673,14 +6734,14 @@ Time interval.
6673
6734
  true = repeat timer until cancel, false = one-shot timer.
6674
6735
 
6675
6736
  */
6676
- export function get_info(handle: hash): LuaMultiReturn<[any, any]>
6737
+ export function get_info(handle: any): LuaMultiReturn<[any, any]>
6677
6738
 
6678
6739
  /**
6679
6740
  * Manual triggering a callback for a timer.
6680
6741
  * @param handle the timer handle returned by timer.delay()
6681
6742
  * @return true if the timer was active, false if the timer is already cancelled / complete
6682
6743
  */
6683
- export function trigger(handle: hash): boolean
6744
+ export function trigger(handle: any): boolean
6684
6745
 
6685
6746
  }
6686
6747
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.50",
3
+ "version": "1.2.51",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "lua-types": "^2.10.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@ts-defold/type-gen": "^0.5.3",
30
+ "@ts-defold/type-gen": "^0.5.6",
31
31
  "typescript": "~5.1.0",
32
32
  "typescript-to-lua": "~1.16.0"
33
33
  },