@defold-typescript/types 0.51.0 → 0.53.0

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 (228) hide show
  1. package/api-availability.json +4 -58
  2. package/api-signatures.json +2804 -3172
  3. package/api-targets.json +15 -5
  4. package/examples/translations.json +19 -71
  5. package/generated/b2d.d.ts +39 -39
  6. package/generated/b2d_body.d.ts +11 -11
  7. package/generated/b2d_chain.d.ts +3 -3
  8. package/generated/b2d_fixture.d.ts +5 -5
  9. package/generated/b2d_joint.d.ts +29 -29
  10. package/generated/b2d_shape.d.ts +13 -13
  11. package/generated/b2d_world.d.ts +15 -15
  12. package/generated/buffer.d.ts +10 -11
  13. package/generated/bullet3d.d.ts +6 -6
  14. package/generated/bullet3d_collision_object.d.ts +10 -10
  15. package/generated/bullet3d_constraint.d.ts +173 -71
  16. package/generated/bullet3d_rigid_body.d.ts +3 -3
  17. package/generated/bullet3d_shape.d.ts +11 -11
  18. package/generated/bullet3d_world.d.ts +20 -20
  19. package/generated/camera.d.ts +4 -4
  20. package/generated/collectionfactory.d.ts +2 -3
  21. package/generated/collectionproxy.d.ts +5 -5
  22. package/generated/compute.d.ts +5 -5
  23. package/generated/crash.d.ts +7 -7
  24. package/generated/editor-vm/http.d.ts +13 -13
  25. package/generated/editor-vm/image.d.ts +4 -4
  26. package/generated/editor-vm/json.d.ts +1 -1
  27. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  28. package/generated/editor-vm/zip.d.ts +4 -4
  29. package/generated/editor.d.ts +183 -183
  30. package/generated/factory.d.ts +2 -3
  31. package/generated/font.d.ts +4 -4
  32. package/generated/go.d.ts +122 -230
  33. package/generated/graphics.d.ts +23 -25
  34. package/generated/gui.d.ts +186 -423
  35. package/generated/http.d.ts +3 -3
  36. package/generated/image.d.ts +63 -11
  37. package/generated/json.d.ts +4 -4
  38. package/generated/kinds/gui-script.d.ts +2 -0
  39. package/generated/kinds/render-script.d.ts +14 -15
  40. package/generated/label.d.ts +5 -5
  41. package/generated/liveupdate.d.ts +7 -3
  42. package/generated/material.d.ts +49 -49
  43. package/generated/model.d.ts +46 -14
  44. package/generated/particlefx.d.ts +24 -5
  45. package/generated/physics.d.ts +64 -20
  46. package/generated/profiler.d.ts +3 -5
  47. package/generated/render-script-modules/b2d.d.ts +711 -0
  48. package/generated/render-script-modules/bullet3d.d.ts +73 -0
  49. package/generated/render-script-modules/collectionfactory.d.ts +24 -0
  50. package/generated/render-script-modules/collectionproxy.d.ts +39 -0
  51. package/generated/render-script-modules/factory.d.ts +24 -0
  52. package/generated/render-script-modules/go.d.ts +434 -0
  53. package/generated/render-script-modules/label.d.ts +105 -0
  54. package/generated/render-script-modules/model.d.ts +121 -0
  55. package/generated/render-script-modules/particlefx.d.ts +59 -0
  56. package/generated/render-script-modules/physics.d.ts +333 -0
  57. package/generated/render-script-modules/resource.d.ts +1232 -0
  58. package/generated/render-script-modules/sound.d.ts +227 -0
  59. package/generated/render-script-modules/sprite.d.ts +68 -0
  60. package/generated/render-script-modules/tilemap.d.ts +43 -0
  61. package/generated/render.d.ts +172 -47
  62. package/generated/resource.d.ts +81 -61
  63. package/generated/socket.d.ts +18 -23
  64. package/generated/sound.d.ts +6 -6
  65. package/generated/sprite.d.ts +51 -3
  66. package/generated/sys.d.ts +87 -24
  67. package/generated/tilemap.d.ts +3 -3
  68. package/generated/timer.d.ts +3 -3
  69. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  70. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  71. package/generated/versions/defold-1.12.4/buffer.d.ts +8 -8
  72. package/generated/versions/defold-1.12.4/go.d.ts +117 -345
  73. package/generated/versions/defold-1.12.4/graphics.d.ts +2 -1
  74. package/generated/versions/defold-1.12.4/gui.d.ts +169 -532
  75. package/generated/versions/defold-1.12.4/http.d.ts +2 -2
  76. package/generated/versions/defold-1.12.4/image.d.ts +82 -2
  77. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  78. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  79. package/generated/versions/defold-1.12.4/liveupdate.d.ts +4 -0
  80. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  81. package/generated/versions/defold-1.12.4/particlefx.d.ts +23 -2
  82. package/generated/versions/defold-1.12.4/physics.d.ts +46 -2
  83. package/generated/versions/defold-1.12.4/render.d.ts +83 -7
  84. package/generated/versions/defold-1.12.4/resource.d.ts +50 -17
  85. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  86. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  87. package/generated/versions/defold-1.12.4/sprite.d.ts +59 -2
  88. package/generated/versions/defold-1.12.4/sys.d.ts +103 -8
  89. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  90. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -24
  91. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  92. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  93. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  94. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  95. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  96. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  97. package/generated/versions/defold-1.13.0/buffer.d.ts +8 -8
  98. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  99. package/generated/versions/defold-1.13.0/go.d.ts +117 -372
  100. package/generated/versions/defold-1.13.0/graphics.d.ts +2 -1
  101. package/generated/versions/defold-1.13.0/gui.d.ts +169 -532
  102. package/generated/versions/defold-1.13.0/http.d.ts +2 -2
  103. package/generated/versions/defold-1.13.0/image.d.ts +82 -2
  104. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  105. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  106. package/generated/versions/defold-1.13.0/liveupdate.d.ts +4 -0
  107. package/generated/versions/defold-1.13.0/material.d.ts +3 -1
  108. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  109. package/generated/versions/defold-1.13.0/particlefx.d.ts +23 -2
  110. package/generated/versions/defold-1.13.0/physics.d.ts +46 -2
  111. package/generated/versions/defold-1.13.0/render.d.ts +147 -9
  112. package/generated/versions/defold-1.13.0/resource.d.ts +50 -17
  113. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  114. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  115. package/generated/versions/defold-1.13.0/sprite.d.ts +59 -2
  116. package/generated/versions/defold-1.13.0/sys.d.ts +103 -8
  117. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  118. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -24
  119. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  120. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  121. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  122. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  123. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  124. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  125. package/generated/versions/defold-1.13.1/buffer.d.ts +8 -8
  126. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  127. package/generated/versions/defold-1.13.1/go.d.ts +117 -372
  128. package/generated/versions/defold-1.13.1/graphics.d.ts +2 -1
  129. package/generated/versions/defold-1.13.1/gui.d.ts +169 -548
  130. package/generated/versions/defold-1.13.1/http.d.ts +2 -2
  131. package/generated/versions/defold-1.13.1/image.d.ts +82 -2
  132. package/generated/versions/defold-1.13.1/index.d.ts +2 -0
  133. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  134. package/generated/versions/defold-1.13.1/liveupdate.d.ts +4 -0
  135. package/generated/versions/defold-1.13.1/material.d.ts +3 -1
  136. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  137. package/generated/versions/defold-1.13.1/particlefx.d.ts +23 -2
  138. package/generated/versions/defold-1.13.1/physics.d.ts +46 -2
  139. package/generated/versions/defold-1.13.1/render.d.ts +147 -9
  140. package/generated/versions/defold-1.13.1/resource.d.ts +50 -17
  141. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  142. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  143. package/generated/versions/defold-1.13.1/sprite.d.ts +59 -2
  144. package/generated/versions/defold-1.13.1/sys.d.ts +103 -8
  145. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  146. package/generated/versions/defold-1.13.1/vmath.d.ts +0 -24
  147. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  148. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  149. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  150. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  151. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  152. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  153. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  154. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  155. package/generated/versions/defold-1.13.2/buffer.d.ts +10 -11
  156. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  157. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +10 -10
  158. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +173 -71
  159. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  160. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  161. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  162. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  163. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  164. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  165. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  166. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  167. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  168. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  169. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  170. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  171. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  172. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  173. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  174. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  175. package/generated/versions/defold-1.13.2/go.d.ts +122 -230
  176. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -24
  177. package/generated/versions/defold-1.13.2/gui.d.ts +186 -423
  178. package/generated/versions/defold-1.13.2/http.d.ts +3 -3
  179. package/generated/versions/defold-1.13.2/image.d.ts +63 -11
  180. package/generated/versions/defold-1.13.2/index.d.ts +2 -0
  181. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  182. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  183. package/generated/versions/defold-1.13.2/liveupdate.d.ts +7 -3
  184. package/generated/versions/defold-1.13.2/material.d.ts +49 -49
  185. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  186. package/generated/versions/defold-1.13.2/particlefx.d.ts +24 -5
  187. package/generated/versions/defold-1.13.2/physics.d.ts +64 -20
  188. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  189. package/generated/versions/defold-1.13.2/render.d.ts +161 -46
  190. package/generated/versions/defold-1.13.2/resource.d.ts +81 -61
  191. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  192. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  193. package/generated/versions/defold-1.13.2/sprite.d.ts +51 -3
  194. package/generated/versions/defold-1.13.2/sys.d.ts +87 -24
  195. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  196. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  197. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -25
  198. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  199. package/generated/vmath.d.ts +0 -25
  200. package/generated/window.d.ts +8 -10
  201. package/identity-vocabulary.json +86 -34
  202. package/index.d.ts +2 -0
  203. package/package.json +3 -1
  204. package/scripts/generate-api-availability.ts +10 -24
  205. package/scripts/generate-api-signatures.ts +75 -14
  206. package/scripts/materialize-version.ts +48 -7
  207. package/scripts/regen.ts +214 -19
  208. package/scripts/shared-handle-methods.ts +3 -2
  209. package/scripts/signature-store-fs.ts +1 -0
  210. package/scripts/target-version.ts +26 -0
  211. package/src/api-doc.ts +34 -0
  212. package/src/api-identity.ts +32 -1
  213. package/src/component-properties.d.ts +96 -7
  214. package/src/core-types.ts +71 -28
  215. package/src/doc-corrections.ts +62 -5
  216. package/src/emit-dts.ts +1423 -401
  217. package/src/engine-globals.d.ts +5 -1
  218. package/src/engine-type-name.ts +33 -0
  219. package/src/go-overloads.d.ts +74 -19
  220. package/src/gui-overloads.d.ts +489 -0
  221. package/src/gui-texture-removal.d.ts +41 -0
  222. package/src/index.ts +3 -0
  223. package/src/lifecycle.ts +32 -23
  224. package/src/msg-overloads.d.ts +25 -13
  225. package/src/signature-store.ts +50 -0
  226. package/src/socket-types.d.ts +3 -3
  227. package/src/timers.d.ts +2 -1
  228. package/src/vmath-overloads.d.ts +26 -0
@@ -1,5 +1,5 @@
1
1
  /** @noSelfInFile */
2
- import type { Hash } from "../src/core-types";
2
+ import type { Hash, Url } from "../src/core-types";
3
3
 
4
4
  declare global {
5
5
  /**
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * HTTP request options
11
11
  */
12
- interface request_options {
12
+ interface RequestOptions {
13
13
  /**
14
14
  * timeout in seconds
15
15
  */
@@ -78,7 +78,7 @@ declare global {
78
78
  * });
79
79
  * ```
80
80
  */
81
- function request(url: string, method: string, callback: (self: unknown, id: Hash, response: { status: number; url: string; response?: string; headers?: LuaMap<string, string>; path?: string; error?: string; bytes_sent?: number; bytes_received?: number; bytes_total?: number; range_start?: number; range_end?: number; document_size?: number }) => void, headers?: LuaMap<string, string> | Record<string, string>, post_data?: string, options?: http.request_options): void;
81
+ function request(url: string, method: string, callback: (self: unknown, id: Hash, response: { status: number; url: string; response?: string; headers?: LuaMap<string, string>; path?: string; error?: string; bytes_sent?: number; bytes_received?: number; bytes_total?: number; range_start?: number; range_end?: number; document_size?: number }, sender: Url) => void, headers?: LuaMap<string, string> | Record<string, string>, post_data?: string, options?: http.RequestOptions): void;
82
82
  }
83
83
  }
84
84
 
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * ASTC image header
11
11
  */
12
- interface astc_header {
12
+ interface AstcHeader {
13
13
  /**
14
14
  * Image width.
15
15
  */
@@ -38,7 +38,7 @@ declare global {
38
38
  /**
39
39
  * Loaded buffer image data
40
40
  */
41
- interface load_buffer_result {
41
+ interface LoadBufferResult {
42
42
  /**
43
43
  * Image width.
44
44
  */
@@ -50,16 +50,16 @@ declare global {
50
50
  /**
51
51
  * Image type.
52
52
  */
53
- type: image.TYPE;
53
+ type: image.Type;
54
54
  /**
55
55
  * Script buffer containing the decompressed image data.
56
56
  */
57
- buffer: Opaque<"buffer">;
57
+ buffer: Opaque<"buffer"> & { length: LuaLengthMethod<number> };
58
58
  }
59
59
  /**
60
60
  * Image loading options
61
61
  */
62
- interface load_options {
62
+ interface LoadOptions {
63
63
  /**
64
64
  * Whether to premultiply alpha into the color components. Defaults to `false`.
65
65
  */
@@ -72,7 +72,7 @@ declare global {
72
72
  /**
73
73
  * Loaded string image data
74
74
  */
75
- interface load_result {
75
+ interface LoadResult {
76
76
  /**
77
77
  * Image width.
78
78
  */
@@ -84,13 +84,13 @@ declare global {
84
84
  /**
85
85
  * Image type.
86
86
  */
87
- type: image.TYPE;
87
+ type: image.Type;
88
88
  /**
89
89
  * Raw image data.
90
90
  */
91
91
  buffer: string;
92
92
  }
93
- type TYPE = typeof image.TYPE_RGB | typeof image.TYPE_RGBA | typeof image.TYPE_LUMINANCE | typeof image.TYPE_LUMINANCE_ALPHA;
93
+ type Type = typeof image.TYPE_RGB | typeof image.TYPE_RGBA | typeof image.TYPE_LUMINANCE | typeof image.TYPE_LUMINANCE_ALPHA;
94
94
  /**
95
95
  * Luminance image type.
96
96
  */
@@ -122,7 +122,7 @@ declare global {
122
122
  * }
123
123
  * ```
124
124
  */
125
- function get_astc_header(buffer: string): image.astc_header;
125
+ function get_astc_header(buffer: string): image.AstcHeader;
126
126
  /**
127
127
  * Load image (PNG or JPEG) from buffer.
128
128
  *
@@ -141,7 +141,59 @@ declare global {
141
141
  * });
142
142
  * ```
143
143
  */
144
- function load(buffer: string, options?: boolean | image.load_options): image.load_result | undefined;
144
+ function load(buffer: string): image.LoadResult | undefined;
145
+ /**
146
+ * Load image (PNG or JPEG) from buffer.
147
+ *
148
+ * @param buffer - image data buffer
149
+ * @param options - Optional loading parameters. A boolean is accepted for backwards compatibility and controls `premultiply_alpha`.
150
+ * @returns loaded image, or `nil` if loading fails
151
+ * @example
152
+ * ```ts
153
+ * // How to load an image from an URL and create a GUI texture from it:
154
+ * const imgurl = "http://www.site.com/image.png";
155
+ * http.request(imgurl, "GET", (self, id, response) => {
156
+ * const img = response.response !== undefined ? image.load(response.response) : undefined;
157
+ * if (img !== undefined) {
158
+ * const tx = gui.new_texture("image_node", img.width, img.height, img.type, img.buffer);
159
+ * }
160
+ * });
161
+ * ```
162
+ */
163
+ function load(buffer: string, options: boolean | image.LoadOptions): image.LoadResult | undefined;
164
+ /**
165
+ * Load image (PNG or JPEG) from a string buffer.
166
+ *
167
+ * @param buffer - image data buffer
168
+ * @param options - Optional loading parameters. A boolean is accepted for backwards compatibility and controls `premultiply_alpha`.
169
+ * @returns loaded image, or `nil` if loading fails
170
+ * @example
171
+ * ```ts
172
+ * // Load an image from an URL as a buffer and create a texture resource from it:
173
+ * const imgurl = "http://www.site.com/image.png";
174
+ * http.request(imgurl, "GET", (self, id, response) => {
175
+ * const img =
176
+ * response.response !== undefined
177
+ * ? image.load_buffer(response.response, { flip_vertically: true })
178
+ * : undefined;
179
+ * // the engine registers a texture format only when the driver supports it
180
+ * const format = graphics.TEXTURE_FORMAT_RGBA;
181
+ * if (img !== undefined && format !== undefined) {
182
+ * const tparams = {
183
+ * width: img.width,
184
+ * height: img.height,
185
+ * type: graphics.TEXTURE_TYPE_2D,
186
+ * format,
187
+ * };
188
+ *
189
+ * const my_texture_id = resource.create_texture("/my_custom_texture.texturec", tparams, img.buffer);
190
+ * // Apply the texture to a model
191
+ * go.set("/go1#model", "texture0", my_texture_id);
192
+ * }
193
+ * });
194
+ * ```
195
+ */
196
+ function load_buffer(buffer: string): image.LoadBufferResult | undefined;
145
197
  /**
146
198
  * Load image (PNG or JPEG) from a string buffer.
147
199
  *
@@ -174,7 +226,7 @@ declare global {
174
226
  * });
175
227
  * ```
176
228
  */
177
- function load_buffer(buffer: string, options?: boolean | image.load_options): image.load_buffer_result | undefined;
229
+ function load_buffer(buffer: string, options: boolean | image.LoadOptions): image.LoadBufferResult | undefined;
178
230
  }
179
231
  }
180
232
 
@@ -7,7 +7,7 @@ declare global {
7
7
  /**
8
8
  * JSON decoding options
9
9
  */
10
- export interface decode_options {
10
+ export interface DecodeOptions {
11
11
  /**
12
12
  * Decode JSON `null` as json.null instead of `nil`.
13
13
  */
@@ -16,7 +16,7 @@ declare global {
16
16
  /**
17
17
  * JSON encoding options
18
18
  */
19
- export interface encode_options {
19
+ export interface EncodeOptions {
20
20
  /**
21
21
  * Encode an empty table as an object instead of an array. The default is true.
22
22
  */
@@ -59,7 +59,7 @@ declare global {
59
59
  * // }
60
60
  * ```
61
61
  */
62
- export function decode(json: string, options?: json.decode_options): unknown;
62
+ export function decode(json: string, options?: json.DecodeOptions): unknown;
63
63
  /**
64
64
  * Encode a lua table to a JSON string.
65
65
  * A Lua error is raised for syntax errors.
@@ -86,7 +86,7 @@ declare global {
86
86
  * // {"persons":[{"name":"John Doe"},{"name":"Darth Vader"}]}
87
87
  * ```
88
88
  */
89
- export function encode(tbl: unknown, options?: json.encode_options): string;
89
+ export function encode(tbl: unknown, options?: json.EncodeOptions): string;
90
90
  export { _null as null };
91
91
  }
92
92
  }
@@ -50,6 +50,8 @@ import "../../src/component-properties";
50
50
  import "../../src/custom-messages";
51
51
  import "../../src/engine-globals";
52
52
  import "../../src/go-overloads";
53
+ import "../../src/gui-overloads";
54
+ import "../../src/gui-texture-removal";
53
55
  import "../../src/message-guard";
54
56
  import "../../src/msg-overloads";
55
57
  import "../../src/physics-event-guard";
@@ -1,6 +1,6 @@
1
1
  /// <reference types="lua-types/5.1" />
2
2
  /// <reference types="lua-types/special/jit-only" />
3
- import "../b2d";
3
+ import "../render-script-modules/b2d";
4
4
  import "../b2d_body";
5
5
  import "../b2d_chain";
6
6
  import "../b2d_fixture";
@@ -8,39 +8,39 @@ import "../b2d_joint";
8
8
  import "../b2d_shape";
9
9
  import "../b2d_world";
10
10
  import "../buffer";
11
- import "../bullet3d";
11
+ import "../render-script-modules/bullet3d";
12
12
  import "../bullet3d_collision_object";
13
13
  import "../bullet3d_constraint";
14
14
  import "../bullet3d_rigid_body";
15
15
  import "../bullet3d_shape";
16
16
  import "../bullet3d_world";
17
17
  import "../camera";
18
- import "../collectionfactory";
19
- import "../collectionproxy";
18
+ import "../render-script-modules/collectionfactory";
19
+ import "../render-script-modules/collectionproxy";
20
20
  import "../compute";
21
21
  import "../crash";
22
- import "../factory";
22
+ import "../render-script-modules/factory";
23
23
  import "../font";
24
- import "../go";
24
+ import "../render-script-modules/go";
25
25
  import "../graphics";
26
26
  import "../html5";
27
27
  import "../http";
28
28
  import "../image";
29
29
  import "../json";
30
- import "../label";
30
+ import "../render-script-modules/label";
31
31
  import "../liveupdate";
32
32
  import "../material";
33
- import "../model";
33
+ import "../render-script-modules/model";
34
34
  import "../msg";
35
- import "../particlefx";
36
- import "../physics";
35
+ import "../render-script-modules/particlefx";
36
+ import "../render-script-modules/physics";
37
37
  import "../profiler";
38
- import "../resource";
38
+ import "../render-script-modules/resource";
39
39
  import "../socket";
40
- import "../sound";
41
- import "../sprite";
40
+ import "../render-script-modules/sound";
41
+ import "../render-script-modules/sprite";
42
42
  import "../sys";
43
- import "../tilemap";
43
+ import "../render-script-modules/tilemap";
44
44
  import "../timer";
45
45
  import "../types";
46
46
  import "../vmath";
@@ -49,7 +49,6 @@ import "../zlib";
49
49
  import "../../src/component-properties";
50
50
  import "../../src/custom-messages";
51
51
  import "../../src/engine-globals";
52
- import "../../src/go-overloads";
53
52
  import "../../src/message-guard";
54
53
  import "../../src/msg-overloads";
55
54
  import "../../src/physics-event-guard";
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * Rich-text layout object
11
11
  */
12
- interface layout_object {
12
+ interface LayoutObject {
13
13
  /**
14
14
  * object type, currently `link` or `sprite`
15
15
  */
@@ -70,7 +70,7 @@ declare global {
70
70
  * }
71
71
  * ```
72
72
  */
73
- function get_layout_objects(url: string | Hash | Url): label.layout_object[];
73
+ function get_layout_objects(url: string | Hash | Url): label.LayoutObject[];
74
74
  /**
75
75
  * Gets the text from a label component
76
76
  * This function is deprecated. Use `go.get("#label", "text")` instead.
@@ -81,7 +81,7 @@ declare global {
81
81
  * ```ts
82
82
  * export default defineScript({
83
83
  * init() {
84
- * const text = go.get<label.properties>()("#label", "text");
84
+ * const text = go.get<label.Properties>()("#label", "text");
85
85
  * print(text);
86
86
  * },
87
87
  * });
@@ -100,13 +100,13 @@ declare global {
100
100
  * ```ts
101
101
  * export default defineScript({
102
102
  * init() {
103
- * go.set<label.properties>()("#label", "text", "Hello World!");
103
+ * go.set<label.Properties>()("#label", "text", "Hello World!");
104
104
  * },
105
105
  * });
106
106
  * ```
107
107
  */
108
108
  function set_text(url: string | Hash | Url, text: string | number): void;
109
- interface properties {
109
+ interface Properties {
110
110
  /**
111
111
  * The color of the label. The type of the property is vector4.
112
112
  */
@@ -6,7 +6,7 @@ declare global {
6
6
  * Functions and constants to access resources.
7
7
  */
8
8
  namespace liveupdate {
9
- type LIVEUPDATE = typeof liveupdate.LIVEUPDATE_BUNDLED_RESOURCE_MISMATCH | typeof liveupdate.LIVEUPDATE_ENGINE_VERSION_MISMATCH | typeof liveupdate.LIVEUPDATE_FORMAT_ERROR | typeof liveupdate.LIVEUPDATE_INVAL | typeof liveupdate.LIVEUPDATE_INVALID_HEADER | typeof liveupdate.LIVEUPDATE_INVALID_RESOURCE | typeof liveupdate.LIVEUPDATE_IO_ERROR | typeof liveupdate.LIVEUPDATE_MEM_ERROR | typeof liveupdate.LIVEUPDATE_OK | typeof liveupdate.LIVEUPDATE_SCHEME_MISMATCH | typeof liveupdate.LIVEUPDATE_SIGNATURE_MISMATCH | typeof liveupdate.LIVEUPDATE_UNKNOWN | typeof liveupdate.LIVEUPDATE_VERSION_MISMATCH;
9
+ type LiveUpdate = typeof liveupdate.LIVEUPDATE_BUNDLED_RESOURCE_MISMATCH | typeof liveupdate.LIVEUPDATE_ENGINE_VERSION_MISMATCH | typeof liveupdate.LIVEUPDATE_FORMAT_ERROR | typeof liveupdate.LIVEUPDATE_INVAL | typeof liveupdate.LIVEUPDATE_INVALID_HEADER | typeof liveupdate.LIVEUPDATE_INVALID_RESOURCE | typeof liveupdate.LIVEUPDATE_IO_ERROR | typeof liveupdate.LIVEUPDATE_MEM_ERROR | typeof liveupdate.LIVEUPDATE_OK | typeof liveupdate.LIVEUPDATE_SCHEME_MISMATCH | typeof liveupdate.LIVEUPDATE_SIGNATURE_MISMATCH | typeof liveupdate.LIVEUPDATE_UNKNOWN | typeof liveupdate.LIVEUPDATE_VERSION_MISMATCH | typeof liveupdate.LIVEUPDATE_NOT_INITIALIZED;
10
10
  /**
11
11
  * Mismatch between between expected bundled resources and actual bundled resources. The manifest expects a resource to be in the bundle, but it was not found in the bundle. This is typically the case when a non-excluded resource was modified between publishing the bundle and publishing the manifest.
12
12
  */
@@ -39,6 +39,10 @@ declare global {
39
39
  * Memory wasn't allocated
40
40
  */
41
41
  const LIVEUPDATE_MEM_ERROR: number & { readonly __brand: "liveupdate.LIVEUPDATE_MEM_ERROR" };
42
+ /**
43
+ * Live update is not initialized. `liveupdate.add_mount` and `liveupdate.remove_mount` return it while live update is disabled.
44
+ */
45
+ const LIVEUPDATE_NOT_INITIALIZED: number & { readonly __brand: "liveupdate.LIVEUPDATE_NOT_INITIALIZED" };
42
46
  /**
43
47
  * Operation completed successfully.
44
48
  */
@@ -79,7 +83,7 @@ declare global {
79
83
  * liveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30, (result) => {}); // season pack, overriding content in the other packs
80
84
  * ```
81
85
  */
82
- function add_mount(name: string | Hash, uri: string, priority: number, callback: (self: unknown, name: Hash, uri: string, result: liveupdate.LIVEUPDATE) => void): liveupdate.LIVEUPDATE;
86
+ function add_mount(name: string | Hash, uri: string, priority: number, callback: (self: unknown, name: Hash, uri: string, result: liveupdate.LiveUpdate) => void): liveupdate.LiveUpdate;
83
87
  /**
84
88
  * Get an array of the current mounts
85
89
  * This can be used to determine if a new mount is needed or not
@@ -136,7 +140,7 @@ declare global {
136
140
  * liveupdate.remove_mount("season_pack_1");
137
141
  * ```
138
142
  */
139
- function remove_mount(name: string | Hash): liveupdate.LIVEUPDATE;
143
+ function remove_mount(name: string | Hash): liveupdate.LiveUpdate;
140
144
  }
141
145
  }
142
146
 
@@ -9,7 +9,7 @@ declare global {
9
9
  /**
10
10
  * Shader constant information
11
11
  */
12
- interface constant_info {
12
+ interface ConstantInfo {
13
13
  /**
14
14
  * Constant name.
15
15
  */
@@ -17,31 +17,31 @@ declare global {
17
17
  /**
18
18
  * Constant type.
19
19
  */
20
- type: material.CONSTANT_TYPE;
20
+ type: material.ConstantType;
21
21
  /**
22
22
  * Constant value or values. Present for user constants.
23
23
  */
24
- value?: material.constant_info_value;
24
+ value?: material.ConstantInfoValue;
25
25
  }
26
- type constant_info_value = Vector4 | Matrix4 | Vector4[] | Matrix4[];
26
+ type ConstantInfoValue = Vector4 | Matrix4 | Vector4[] | Matrix4[];
27
27
  /**
28
28
  * Shader constant update
29
29
  */
30
- interface constant_options {
30
+ interface ConstantOptions {
31
31
  /**
32
32
  * Constant type.
33
33
  */
34
- type?: material.CONSTANT_TYPE;
34
+ type?: material.ConstantType;
35
35
  /**
36
36
  * Constant value or values.
37
37
  */
38
- value?: material.constant_value;
38
+ value?: material.ConstantValue;
39
39
  }
40
- type constant_value = number | Vector3 | Vector4 | Matrix4 | (number | Vector3 | Vector4 | Matrix4)[];
40
+ type ConstantValue = number | Vector3 | Vector4 | Matrix4 | (number | Vector3 | Vector4 | Matrix4)[];
41
41
  /**
42
42
  * Named material vertex attribute update
43
43
  */
44
- interface named_vertex_attribute_options {
44
+ interface NamedVertexAttributeOptions {
45
45
  /**
46
46
  * Attribute name.
47
47
  */
@@ -49,7 +49,7 @@ declare global {
49
49
  /**
50
50
  * Attribute value.
51
51
  */
52
- value?: material.vertex_attribute_value;
52
+ value?: material.VertexAttributeValue;
53
53
  /**
54
54
  * Whether integer data is normalized.
55
55
  */
@@ -57,20 +57,20 @@ declare global {
57
57
  /**
58
58
  * Attribute data type.
59
59
  */
60
- data_type?: graphics.DATA_TYPE;
60
+ data_type?: graphics.DataType;
61
61
  /**
62
62
  * Attribute coordinate space.
63
63
  */
64
- coordinate_space?: graphics.COORDINATE_SPACE;
64
+ coordinate_space?: graphics.CoordinateSpace;
65
65
  /**
66
66
  * Attribute semantic.
67
67
  */
68
- semantic_type?: graphics.SEMANTIC_TYPE;
68
+ semantic_type?: graphics.SemanticType;
69
69
  }
70
70
  /**
71
71
  * Texture sampler information
72
72
  */
73
- interface sampler_info {
73
+ interface SamplerInfo {
74
74
  /**
75
75
  * Sampler name.
76
76
  */
@@ -78,27 +78,27 @@ declare global {
78
78
  /**
79
79
  * Sampler texture type.
80
80
  */
81
- type: graphics.TEXTURE_TYPE;
81
+ type: graphics.TextureType | 6 | 7 | 8 | 9 | 10;
82
82
  /**
83
83
  * Horizontal wrap mode.
84
84
  */
85
- u_wrap: graphics.TEXTURE_WRAP;
85
+ u_wrap: graphics.TextureWrap;
86
86
  /**
87
87
  * Vertical wrap mode.
88
88
  */
89
- v_wrap: graphics.TEXTURE_WRAP;
89
+ v_wrap: graphics.TextureWrap;
90
90
  /**
91
91
  * Depth wrap mode.
92
92
  */
93
- w_wrap: graphics.TEXTURE_WRAP;
93
+ w_wrap: graphics.TextureWrap;
94
94
  /**
95
95
  * Minification filter.
96
96
  */
97
- min_filter: graphics.TEXTURE_FILTER;
97
+ min_filter: graphics.TextureFilter;
98
98
  /**
99
99
  * Magnification filter.
100
100
  */
101
- mag_filter: graphics.TEXTURE_FILTER;
101
+ mag_filter: graphics.TextureFilter;
102
102
  /**
103
103
  * Maximum anisotropy.
104
104
  */
@@ -107,27 +107,27 @@ declare global {
107
107
  /**
108
108
  * Texture sampler update
109
109
  */
110
- interface sampler_options {
110
+ interface SamplerOptions {
111
111
  /**
112
112
  * Horizontal wrap mode.
113
113
  */
114
- u_wrap?: graphics.TEXTURE_WRAP;
114
+ u_wrap?: graphics.TextureWrap;
115
115
  /**
116
116
  * Vertical wrap mode.
117
117
  */
118
- v_wrap?: graphics.TEXTURE_WRAP;
118
+ v_wrap?: graphics.TextureWrap;
119
119
  /**
120
120
  * Depth wrap mode.
121
121
  */
122
- w_wrap?: graphics.TEXTURE_WRAP;
122
+ w_wrap?: graphics.TextureWrap;
123
123
  /**
124
124
  * Minification filter.
125
125
  */
126
- min_filter?: graphics.TEXTURE_FILTER;
126
+ min_filter?: graphics.TextureFilter;
127
127
  /**
128
128
  * Magnification filter.
129
129
  */
130
- mag_filter?: graphics.TEXTURE_FILTER;
130
+ mag_filter?: graphics.TextureFilter;
131
131
  /**
132
132
  * Maximum anisotropy.
133
133
  */
@@ -136,7 +136,7 @@ declare global {
136
136
  /**
137
137
  * Texture information
138
138
  */
139
- interface texture_info {
139
+ interface TextureInfo {
140
140
  /**
141
141
  * Texture resource path, if backed by a resource.
142
142
  */
@@ -168,16 +168,16 @@ declare global {
168
168
  /**
169
169
  * Texture type.
170
170
  */
171
- type: graphics.TEXTURE_TYPE;
171
+ type: graphics.TextureType;
172
172
  /**
173
173
  * Texture usage flags.
174
174
  */
175
- flags: graphics.TEXTURE_USAGE_FLAG | number;
175
+ flags: graphics.TextureUsageFlag | number;
176
176
  }
177
177
  /**
178
178
  * Material vertex attribute information
179
179
  */
180
- interface vertex_attribute_info {
180
+ interface VertexAttributeInfo {
181
181
  /**
182
182
  * Attribute name.
183
183
  */
@@ -185,7 +185,7 @@ declare global {
185
185
  /**
186
186
  * Attribute value.
187
187
  */
188
- value: material.vertex_attribute_value;
188
+ value: material.VertexAttributeValue;
189
189
  /**
190
190
  * Whether integer data is normalized.
191
191
  */
@@ -193,24 +193,24 @@ declare global {
193
193
  /**
194
194
  * Attribute data type.
195
195
  */
196
- data_type: graphics.DATA_TYPE;
196
+ data_type: graphics.DataType;
197
197
  /**
198
198
  * Attribute coordinate space.
199
199
  */
200
- coordinate_space: graphics.COORDINATE_SPACE;
200
+ coordinate_space: graphics.CoordinateSpace;
201
201
  /**
202
202
  * Attribute semantic.
203
203
  */
204
- semantic_type: graphics.SEMANTIC_TYPE;
204
+ semantic_type: graphics.SemanticType;
205
205
  }
206
206
  /**
207
207
  * Material vertex attribute update
208
208
  */
209
- interface vertex_attribute_options {
209
+ interface VertexAttributeOptions {
210
210
  /**
211
211
  * Attribute value.
212
212
  */
213
- value?: material.vertex_attribute_value;
213
+ value?: material.VertexAttributeValue;
214
214
  /**
215
215
  * Whether integer data is normalized.
216
216
  */
@@ -218,18 +218,18 @@ declare global {
218
218
  /**
219
219
  * Attribute data type.
220
220
  */
221
- data_type?: graphics.DATA_TYPE;
221
+ data_type?: graphics.DataType;
222
222
  /**
223
223
  * Attribute coordinate space.
224
224
  */
225
- coordinate_space?: graphics.COORDINATE_SPACE;
225
+ coordinate_space?: graphics.CoordinateSpace;
226
226
  /**
227
227
  * Attribute semantic.
228
228
  */
229
- semantic_type?: graphics.SEMANTIC_TYPE;
229
+ semantic_type?: graphics.SemanticType;
230
230
  }
231
- type vertex_attribute_value = number | Vector3 | Vector4 | Matrix4 | number[];
232
- type CONSTANT_TYPE = typeof material.CONSTANT_TYPE_USER | typeof material.CONSTANT_TYPE_USER_COLOR | typeof material.CONSTANT_TYPE_USER_MATRIX4 | typeof material.CONSTANT_TYPE_VIEWPROJ | typeof material.CONSTANT_TYPE_WORLD | typeof material.CONSTANT_TYPE_TEXTURE | typeof material.CONSTANT_TYPE_VIEW | typeof material.CONSTANT_TYPE_PROJECTION | typeof material.CONSTANT_TYPE_NORMAL | typeof material.CONSTANT_TYPE_WORLDVIEW | typeof material.CONSTANT_TYPE_WORLDVIEWPROJ | typeof material.CONSTANT_TYPE_TIME | typeof material.CONSTANT_TYPE_WORLD_INVERSE | typeof material.CONSTANT_TYPE_VIEW_INVERSE | typeof material.CONSTANT_TYPE_PROJECTION_INVERSE | typeof material.CONSTANT_TYPE_VIEWPROJ_INVERSE | typeof material.CONSTANT_TYPE_WORLDVIEW_INVERSE | typeof material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE;
231
+ type VertexAttributeValue = number | Vector3 | Vector4 | Matrix4 | number[];
232
+ type ConstantType = typeof material.CONSTANT_TYPE_USER | typeof material.CONSTANT_TYPE_USER_COLOR | typeof material.CONSTANT_TYPE_USER_MATRIX4 | typeof material.CONSTANT_TYPE_VIEWPROJ | typeof material.CONSTANT_TYPE_WORLD | typeof material.CONSTANT_TYPE_TEXTURE | typeof material.CONSTANT_TYPE_VIEW | typeof material.CONSTANT_TYPE_PROJECTION | typeof material.CONSTANT_TYPE_NORMAL | typeof material.CONSTANT_TYPE_WORLDVIEW | typeof material.CONSTANT_TYPE_WORLDVIEWPROJ | typeof material.CONSTANT_TYPE_TIME | typeof material.CONSTANT_TYPE_WORLD_INVERSE | typeof material.CONSTANT_TYPE_VIEW_INVERSE | typeof material.CONSTANT_TYPE_PROJECTION_INVERSE | typeof material.CONSTANT_TYPE_VIEWPROJ_INVERSE | typeof material.CONSTANT_TYPE_WORLDVIEW_INVERSE | typeof material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE;
233
233
  /**
234
234
  * Normal matrix constant.
235
235
  */
@@ -322,7 +322,7 @@ declare global {
322
322
  * });
323
323
  * ```
324
324
  */
325
- function get_constants(path: Hash | string): material.constant_info[];
325
+ function get_constants(path: Hash | string): material.ConstantInfo[];
326
326
  /**
327
327
  * Returns a table of all the texture samplers in the material. This function will return all the texture samplers
328
328
  * that are used in both the vertex and the fragment shaders.
@@ -343,12 +343,12 @@ declare global {
343
343
  * });
344
344
  * ```
345
345
  */
346
- function get_samplers(path: Hash | string): material.sampler_info[];
346
+ function get_samplers(path: Hash | string): material.SamplerInfo[];
347
347
  /**
348
348
  * Returns a table of all the textures from the material.
349
349
  *
350
350
  * @param path - The path to the resource
351
- * @returns material texture information
351
+ * @returns material texture information. Keyed by sampler slot from 1; a slot with no texture has no entry, so iterate with `for (const [slot, info] of textures)`.
352
352
  * @example
353
353
  * ```ts
354
354
  * // Get the textures from a material specified as a resource property
@@ -363,7 +363,7 @@ declare global {
363
363
  * });
364
364
  * ```
365
365
  */
366
- function get_textures(path: Hash | string): material.texture_info[];
366
+ function get_textures(path: Hash | string): LuaMap<number, material.TextureInfo>;
367
367
  /**
368
368
  * Returns a table of all the vertex attributes in the material. This function will return all the vertex attributes
369
369
  * that are used in the vertex shader of the material.
@@ -384,7 +384,7 @@ declare global {
384
384
  * });
385
385
  * ```
386
386
  */
387
- function get_vertex_attributes(path: Hash | string): material.vertex_attribute_info[];
387
+ function get_vertex_attributes(path: Hash | string): material.VertexAttributeInfo[];
388
388
  /**
389
389
  * Sets shader constants in a material, if the constants exist.
390
390
  *
@@ -415,7 +415,7 @@ declare global {
415
415
  * });
416
416
  * ```
417
417
  */
418
- function set_constants(path: Hash | string, constants: LuaMap<string | Hash, material.constant_options> | Record<string, material.constant_options>): void;
418
+ function set_constants(path: Hash | string, constants: LuaMap<string | Hash, material.ConstantOptions> | Record<string, material.ConstantOptions>): void;
419
419
  /**
420
420
  * Sets texture samplers in a material, if the samplers exist. Use this function to change the settings of texture samplers.
421
421
  * To set actual textures that should be bound to the samplers, use the `material.set_textures` function instead.
@@ -438,7 +438,7 @@ declare global {
438
438
  * });
439
439
  * ```
440
440
  */
441
- function set_samplers(path: Hash | string, samplers: LuaMap<string | Hash, material.sampler_options> | Record<string, material.sampler_options>): void;
441
+ function set_samplers(path: Hash | string, samplers: LuaMap<string | Hash, material.SamplerOptions> | Record<string, material.SamplerOptions>): void;
442
442
  /**
443
443
  * Sets textures in a material, if the samplers exist.
444
444
  *
@@ -483,7 +483,7 @@ declare global {
483
483
  * });
484
484
  * ```
485
485
  */
486
- function set_vertex_attributes(path: Hash | string, attributes: LuaMap<string | Hash, material.vertex_attribute_options> | Record<string, material.vertex_attribute_options> | material.named_vertex_attribute_options[]): void;
486
+ function set_vertex_attributes(path: Hash | string, attributes: LuaMap<string | Hash, material.VertexAttributeOptions> | Record<string, material.VertexAttributeOptions> | material.NamedVertexAttributeOptions[]): void;
487
487
  }
488
488
  }
489
489