@defold-typescript/types 0.19.4 → 0.20.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 (86) hide show
  1. package/api-availability.json +2755 -0
  2. package/api-migrations.json +31 -0
  3. package/api-signatures.json +2324 -0
  4. package/api-targets.json +493 -45
  5. package/generated/b2d.d.ts +6 -0
  6. package/generated/b2d_body.d.ts +329 -1
  7. package/generated/b2d_chain.d.ts +106 -0
  8. package/generated/b2d_fixture.d.ts +155 -0
  9. package/generated/b2d_joint.d.ts +823 -0
  10. package/generated/b2d_shape.d.ts +215 -0
  11. package/generated/b2d_world.d.ts +314 -0
  12. package/generated/builtin-messages.d.ts +18 -0
  13. package/generated/camera.d.ts +62 -5
  14. package/generated/compute.d.ts +306 -0
  15. package/generated/go.d.ts +29 -4
  16. package/generated/graphics.d.ts +95 -0
  17. package/generated/gui.d.ts +1 -3
  18. package/generated/json.d.ts +2 -2
  19. package/generated/kinds/gui-script.d.ts +7 -0
  20. package/generated/kinds/render-script.d.ts +7 -0
  21. package/generated/kinds/script.d.ts +7 -0
  22. package/generated/label.d.ts +1 -1
  23. package/generated/liveupdate.d.ts +22 -4
  24. package/generated/material.d.ts +444 -0
  25. package/generated/model.d.ts +46 -5
  26. package/generated/physics.d.ts +1 -3
  27. package/generated/profiler.d.ts +2 -3
  28. package/generated/render.d.ts +25 -9
  29. package/generated/resource.d.ts +2 -2
  30. package/generated/sprite.d.ts +15 -1
  31. package/generated/tilemap.d.ts +14 -0
  32. package/generated/versions/defold-1.12.4/b2d.d.ts +27 -0
  33. package/generated/versions/defold-1.12.4/b2d_body.d.ts +348 -0
  34. package/generated/versions/defold-1.12.4/buffer.d.ts +176 -0
  35. package/generated/versions/defold-1.12.4/camera.d.ts +245 -0
  36. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +146 -0
  37. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +71 -0
  38. package/generated/versions/defold-1.12.4/crash.d.ts +143 -0
  39. package/generated/versions/defold-1.12.4/factory.d.ts +123 -0
  40. package/generated/versions/defold-1.12.4/font.d.ts +81 -0
  41. package/generated/versions/defold-1.12.4/go.d.ts +1029 -0
  42. package/generated/versions/defold-1.12.4/graphics.d.ts +226 -0
  43. package/generated/versions/defold-1.12.4/gui.d.ts +2372 -0
  44. package/generated/versions/defold-1.12.4/html5.d.ts +53 -0
  45. package/generated/versions/defold-1.12.4/http.d.ts +84 -0
  46. package/generated/versions/defold-1.12.4/iac.d.ts +18 -0
  47. package/generated/versions/defold-1.12.4/iap.d.ts +60 -0
  48. package/generated/versions/defold-1.12.4/image.d.ts +139 -0
  49. package/generated/versions/defold-1.12.4/index.d.ts +41 -0
  50. package/generated/versions/defold-1.12.4/json.d.ts +76 -0
  51. package/generated/versions/defold-1.12.4/label.d.ts +94 -0
  52. package/generated/versions/defold-1.12.4/liveupdate.d.ts +122 -0
  53. package/generated/versions/defold-1.12.4/model.d.ts +205 -0
  54. package/generated/versions/defold-1.12.4/msg.d.ts +10 -0
  55. package/generated/versions/defold-1.12.4/particlefx.d.ts +166 -0
  56. package/generated/versions/defold-1.12.4/physics.d.ts +547 -0
  57. package/generated/versions/defold-1.12.4/profiler.d.ts +234 -0
  58. package/generated/versions/defold-1.12.4/push.d.ts +66 -0
  59. package/generated/versions/defold-1.12.4/render.d.ts +1149 -0
  60. package/generated/versions/defold-1.12.4/resource.d.ts +1518 -0
  61. package/generated/versions/defold-1.12.4/socket.d.ts +795 -0
  62. package/generated/versions/defold-1.12.4/sound.d.ts +291 -0
  63. package/generated/versions/defold-1.12.4/sprite.d.ts +143 -0
  64. package/generated/versions/defold-1.12.4/sys.d.ts +695 -0
  65. package/generated/versions/defold-1.12.4/tilemap.d.ts +181 -0
  66. package/generated/versions/defold-1.12.4/timer.d.ts +114 -0
  67. package/generated/versions/defold-1.12.4/types.d.ts +61 -0
  68. package/generated/versions/defold-1.12.4/vmath.d.ts +806 -0
  69. package/generated/versions/defold-1.12.4/webview.d.ts +68 -0
  70. package/generated/versions/defold-1.12.4/window.d.ts +198 -0
  71. package/generated/versions/defold-1.12.4/zlib.d.ts +40 -0
  72. package/index.d.ts +22 -0
  73. package/package.json +8 -1
  74. package/scripts/fidelity-audit.ts +69 -12
  75. package/scripts/fidelity-baseline.json +56 -0
  76. package/scripts/generate-api-availability.ts +139 -0
  77. package/scripts/generate-api-signatures.ts +66 -0
  78. package/scripts/import-defold-release.ts +480 -0
  79. package/scripts/regen.ts +53 -6
  80. package/scripts/sync-api-docs.ts +89 -41
  81. package/src/api-availability.ts +0 -0
  82. package/src/core-types.ts +9 -0
  83. package/src/emit-dts.ts +674 -17
  84. package/src/emit-messages.ts +72 -2
  85. package/src/index.ts +26 -1
  86. package/src/lifecycle.ts +43 -2
@@ -3,17 +3,19 @@ import type { Matrix4, Url, Vector3 } from "../src/core-types";
3
3
 
4
4
  declare global {
5
5
  /**
6
- * Camera functions, messages and constants.
6
+ * Messages to control camera components and camera focus.
7
7
  */
8
8
  namespace camera {
9
9
  /**
10
10
  * Computes zoom so the original display area covers the entire window while preserving aspect ratio.
11
11
  * Equivalent to using max(window_width/width, window_height/height).
12
+ * The result is multiplied by the user-controlled orthographic zoom.
12
13
  */
13
14
  const ORTHO_MODE_AUTO_COVER: number & { readonly __brand: "camera.ORTHO_MODE_AUTO_COVER" };
14
15
  /**
15
16
  * Computes zoom so the original display area (game.project width/height) fits inside the window
16
17
  * while preserving aspect ratio. Equivalent to using min(window_width/width, window_height/height).
18
+ * The result is multiplied by the user-controlled orthographic zoom.
17
19
  */
18
20
  const ORTHO_MODE_AUTO_FIT: number & { readonly __brand: "camera.ORTHO_MODE_AUTO_FIT" };
19
21
  /**
@@ -81,6 +83,14 @@ declare global {
81
83
  * @returns the near z.
82
84
  */
83
85
  function get_near_z(camera?: Url | number): number;
86
+ /**
87
+ * Gets the orthographic zoom calculated from the current window and project dimensions
88
+ * in auto-fit and auto-cover modes. Returns 1.0 in fixed mode.
89
+ *
90
+ * @param camera - camera id
91
+ * @returns the calculated orthographic auto zoom.
92
+ */
93
+ function get_orthographic_auto_zoom(camera?: Url | number): number;
84
94
  /**
85
95
  * get orthographic zoom mode
86
96
  *
@@ -90,10 +100,11 @@ declare global {
90
100
  */
91
101
  function get_orthographic_mode(camera?: Url | number): number;
92
102
  /**
93
- * get orthographic zoom
103
+ * Gets the positive user-controlled orthographic zoom multiplier. In auto-fit and auto-cover
104
+ * modes, this value is multiplied with camera.get_orthographic_auto_zoom(camera).
94
105
  *
95
106
  * @param camera - camera id
96
- * @returns the zoom level when the camera uses orthographic projection.
107
+ * @returns the positive zoom multiplier when the camera uses orthographic projection.
97
108
  */
98
109
  function get_orthographic_zoom(camera?: Url | number): number;
99
110
  /**
@@ -214,10 +225,11 @@ declare global {
214
225
  */
215
226
  function set_orthographic_mode(camera: Url | number | undefined, mode: number): void;
216
227
  /**
217
- * set orthographic zoom
228
+ * Sets the positive user-controlled orthographic zoom multiplier. In auto-fit and auto-cover
229
+ * modes, this value is multiplied with camera.get_orthographic_auto_zoom(camera).
218
230
  *
219
231
  * @param camera - camera id
220
- * @param orthographic_zoom - the zoom level when the camera uses orthographic projection.
232
+ * @param orthographic_zoom - the positive zoom multiplier when the camera uses orthographic projection.
221
233
  */
222
234
  function set_orthographic_zoom(camera: Url | number | undefined, orthographic_zoom: number): void;
223
235
  /**
@@ -239,6 +251,51 @@ declare global {
239
251
  * ```
240
252
  */
241
253
  function world_to_screen(world_pos: Vector3, camera?: Url | number): Vector3;
254
+ interface properties {
255
+ /**
256
+ * The ratio between the frustum width and height. Used when calculating the
257
+ * projection of a perspective camera.
258
+ * The type of the property is number.
259
+ */
260
+ aspect_ratio: unknown;
261
+ /**
262
+ * Camera frustum far plane.
263
+ * The type of the property is float.
264
+ */
265
+ far_z: unknown;
266
+ /**
267
+ * Vertical field of view of the camera.
268
+ * The type of the property is float.
269
+ */
270
+ fov: unknown;
271
+ /**
272
+ * Camera frustum near plane.
273
+ * The type of the property is float.
274
+ */
275
+ near_z: unknown;
276
+ /**
277
+ * READ ONLY The zoom calculated from the current window and project dimensions
278
+ * in auto fit and auto cover modes. The value is 1.0 in fixed mode.
279
+ * The type of the property is float.
280
+ */
281
+ orthographic_auto_zoom: unknown;
282
+ /**
283
+ * Positive zoom multiplier when using an orthographic projection. In auto fit and auto cover
284
+ * modes, this value is multiplied with the calculated orthographic_auto_zoom value.
285
+ * The type of the property is float.
286
+ */
287
+ orthographic_zoom: unknown;
288
+ /**
289
+ * READ ONLY The calculated projection matrix of the camera.
290
+ * The type of the property is matrix4.
291
+ */
292
+ projection: unknown;
293
+ /**
294
+ * READ ONLY The calculated view matrix of the camera.
295
+ * The type of the property is matrix4.
296
+ */
297
+ view: unknown;
298
+ }
242
299
  }
243
300
  }
244
301
 
@@ -0,0 +1,306 @@
1
+ /** @noSelfInFile */
2
+ import type { Hash, Matrix4, Vector3, Vector4 } from "../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Functions for interacting with compute programs.
7
+ */
8
+ namespace compute {
9
+ /**
10
+ * Returns a table of all the shader constants in the compute program.
11
+ *
12
+ * @param path - The path to the resource
13
+ * @returns A table of tables, where each entry contains info about the shader constants:
14
+ *
15
+ * `name`
16
+ * hash the hashed name of the constant
17
+ * `type`
18
+ * number the type of the constant. Supported values:
19
+ *
20
+ * - `material.CONSTANT_TYPE_USER`
21
+ *
22
+ * - `material.CONSTANT_TYPE_USER_MATRIX4`
23
+ *
24
+ * - `material.CONSTANT_TYPE_VIEWPROJ`
25
+ *
26
+ * - `material.CONSTANT_TYPE_WORLD`
27
+ *
28
+ * - `material.CONSTANT_TYPE_TEXTURE`
29
+ *
30
+ * - `material.CONSTANT_TYPE_VIEW`
31
+ *
32
+ * - `material.CONSTANT_TYPE_PROJECTION`
33
+ *
34
+ * - `material.CONSTANT_TYPE_NORMAL`
35
+ *
36
+ * - `material.CONSTANT_TYPE_WORLDVIEW`
37
+ *
38
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
39
+ *
40
+ * - `material.CONSTANT_TYPE_TIME`
41
+ *
42
+ * - `material.CONSTANT_TYPE_WORLD_INVERSE`
43
+ *
44
+ * - `material.CONSTANT_TYPE_VIEW_INVERSE`
45
+ *
46
+ * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
47
+ *
48
+ * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
49
+ *
50
+ * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
51
+ *
52
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
53
+ *
54
+ * `value`
55
+ * vmath.vector4 | vmath.matrix4 the value(s) of the constant. If the constant is an array, the value will be a table of vmath.vector4 or vmath.matrix4 if the type is `material.CONSTANT_TYPE_USER_MATRIX4`.
56
+ * @example
57
+ * ```ts
58
+ * const constants = compute.get_constants("/my_compute.computec");
59
+ * ```
60
+ */
61
+ function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];
62
+ /**
63
+ * Returns a table of all the texture samplers in the compute program. This function will return all the texture samplers
64
+ * that are available, even the ones that have not been specified in the compute resource.
65
+ *
66
+ * @param path - The path to the resource
67
+ * @returns A table of tables, where each entry contains info about the texture samplers:
68
+ *
69
+ * `name`
70
+ * hash the hashed name of the texture sampler
71
+ * `u_wrap`
72
+ * number the u wrap mode of the texture sampler. Supported values:
73
+ *
74
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
75
+ *
76
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
77
+ *
78
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
79
+ *
80
+ * - `graphics.TEXTURE_WRAP_REPEAT`
81
+ *
82
+ * `v_wrap`
83
+ * number the v wrap mode of the texture sampler. Supported values:
84
+ *
85
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
86
+ *
87
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
88
+ *
89
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
90
+ *
91
+ * - `graphics.TEXTURE_WRAP_REPEAT`
92
+ *
93
+ * `min_filter`
94
+ * number the min filter mode of the texture sampler. Supported values:
95
+ *
96
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
97
+ *
98
+ * - `graphics.TEXTURE_FILTER_NEAREST`
99
+ *
100
+ * - `graphics.TEXTURE_FILTER_LINEAR`
101
+ *
102
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
103
+ *
104
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
105
+ *
106
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
107
+ *
108
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
109
+ *
110
+ * `mag_filter`
111
+ * number the mag filter mode of the texture sampler
112
+ *
113
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
114
+ *
115
+ * - `graphics.TEXTURE_FILTER_NEAREST`
116
+ *
117
+ * - `graphics.TEXTURE_FILTER_LINEAR`
118
+ *
119
+ * `max_anisotropy`
120
+ * number the max anisotropy of the texture sampler
121
+ * @example
122
+ * ```ts
123
+ * const samplers = compute.get_samplers("/my_compute.computec");
124
+ * ```
125
+ */
126
+ function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];
127
+ /**
128
+ * Returns a table of all the textures from the compute program.
129
+ *
130
+ * @param path - The path to the resource
131
+ * @returns A table of tables, where each entry contains info about the compute textures:
132
+ *
133
+ * `path`
134
+ * hash the resource path of the texture. Only available if the texture is a resource.
135
+ * `handle`
136
+ * hash the runtime handle of the texture.
137
+ * `width`
138
+ * number the width of the texture
139
+ * `height`
140
+ * number the height of the texture
141
+ * `depth`
142
+ * number the depth of the texture. Corresponds to the number of layers in an array texture.
143
+ * `mipmaps`
144
+ * number the number of mipmaps in the texture
145
+ * `type`
146
+ * number the type of the texture. Supported values:
147
+ *
148
+ * - `graphics.TEXTURE_TYPE_2D`
149
+ *
150
+ * - `graphics.TEXTURE_TYPE_2D_ARRAY`
151
+ *
152
+ * - `graphics.TEXTURE_TYPE_CUBE_MAP`
153
+ *
154
+ * - `graphics.TEXTURE_TYPE_IMAGE_2D`
155
+ *
156
+ * - `graphics.TEXTURE_TYPE_3D`
157
+ *
158
+ * - `graphics.TEXTURE_TYPE_IMAGE_3D`
159
+ *
160
+ * `flags`
161
+ * number the flags of the texture. This field is a bit mask of these supported flags:
162
+ *
163
+ * - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
164
+ *
165
+ * - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
166
+ *
167
+ * - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
168
+ *
169
+ * - `graphics.TEXTURE_USAGE_FLAG_INPUT`
170
+ *
171
+ * - `graphics.TEXTURE_USAGE_FLAG_COLOR`
172
+ * @example
173
+ * ```ts
174
+ * const textures = compute.get_textures("/my_compute.computec");
175
+ * ```
176
+ */
177
+ function get_textures(path: Hash | string): { path: Hash; handle: Hash; width: number; height: number; depth: number; mipmaps: number; type: number; flags: number }[];
178
+ /**
179
+ * Sets shader constants in a compute program, if the constants exist.
180
+ *
181
+ * @param path - The path to the resource
182
+ * @param constants - A table keyed by constant name with args tables as values. Constants can be partially updated. Supported entries:
183
+ *
184
+ * `type`
185
+ * number the type of the constant. Supported values:
186
+ *
187
+ * - `material.CONSTANT_TYPE_USER`
188
+ *
189
+ * - `material.CONSTANT_TYPE_USER_MATRIX4`
190
+ *
191
+ * - `material.CONSTANT_TYPE_VIEWPROJ`
192
+ *
193
+ * - `material.CONSTANT_TYPE_WORLD`
194
+ *
195
+ * - `material.CONSTANT_TYPE_TEXTURE`
196
+ *
197
+ * - `material.CONSTANT_TYPE_VIEW`
198
+ *
199
+ * - `material.CONSTANT_TYPE_PROJECTION`
200
+ *
201
+ * - `material.CONSTANT_TYPE_NORMAL`
202
+ *
203
+ * - `material.CONSTANT_TYPE_WORLDVIEW`
204
+ *
205
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
206
+ *
207
+ * - `material.CONSTANT_TYPE_TIME`
208
+ *
209
+ * - `material.CONSTANT_TYPE_WORLD_INVERSE`
210
+ *
211
+ * - `material.CONSTANT_TYPE_VIEW_INVERSE`
212
+ *
213
+ * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
214
+ *
215
+ * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
216
+ *
217
+ * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
218
+ *
219
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
220
+ *
221
+ * `value`
222
+ * vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value(s) of the constant. If the shader constant is an array, the amount of values to update depends on how many values that are passed in the 'value' field.
223
+ * @example
224
+ * ```ts
225
+ * compute.set_constants("/my_compute.computec", { tint: { value: vmath.vector4(1, 0, 0, 1) } });
226
+ * ```
227
+ */
228
+ function set_constants(path: Hash | string, constants: Record<string, { type?: number; value?: Vector4 | Vector3 | Matrix4 | number | (Vector4 | Matrix4)[] }>): void;
229
+ /**
230
+ * Sets texture samplers in a compute program, if the samplers exist. Use this function to change the settings of texture samplers.
231
+ * To set actual textures that should be bound to the samplers, use the `compute.set_textures` function instead.
232
+ *
233
+ * @param path - The path to the resource
234
+ * @param samplers - A table keyed by sampler name with args tables as values. Partial updates are supported. Supported entries:
235
+ *
236
+ * `u_wrap`
237
+ * number the u wrap mode of the texture sampler. Supported values:
238
+ *
239
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
240
+ *
241
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
242
+ *
243
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
244
+ *
245
+ * - `graphics.TEXTURE_WRAP_REPEAT`
246
+ *
247
+ * `v_wrap`
248
+ * number the v wrap mode of the texture sampler. Supported values:
249
+ *
250
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
251
+ *
252
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
253
+ *
254
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
255
+ *
256
+ * - `graphics.TEXTURE_WRAP_REPEAT`
257
+ *
258
+ * `min_filter`
259
+ * number the min filter mode of the texture sampler. Supported values:
260
+ *
261
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
262
+ *
263
+ * - `graphics.TEXTURE_FILTER_NEAREST`
264
+ *
265
+ * - `graphics.TEXTURE_FILTER_LINEAR`
266
+ *
267
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
268
+ *
269
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
270
+ *
271
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
272
+ *
273
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
274
+ *
275
+ * `mag_filter`
276
+ * number the mag filter mode of the texture sampler
277
+ *
278
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
279
+ *
280
+ * - `graphics.TEXTURE_FILTER_NEAREST`
281
+ *
282
+ * - `graphics.TEXTURE_FILTER_LINEAR`
283
+ *
284
+ * `max_anisotropy`
285
+ * number the max anisotropy of the texture sampler
286
+ * @example
287
+ * ```ts
288
+ * compute.set_samplers("/my_compute.computec", { texture_sampler: { u_wrap: graphics.TEXTURE_WRAP_REPEAT, v_wrap: graphics.TEXTURE_WRAP_MIRRORED_REPEAT } });
289
+ * ```
290
+ */
291
+ function set_samplers(path: Hash | string, samplers: Record<string, { u_wrap?: number; v_wrap?: number; min_filter?: number; mag_filter?: number; max_anisotropy?: number }>): void;
292
+ /**
293
+ * Sets textures in a compute program, if the samplers exist.
294
+ *
295
+ * @param path - The path to the resource
296
+ * @param textures - A table keyed by sampler name with texture resources as values.
297
+ * @example
298
+ * ```ts
299
+ * compute.set_textures("/my_compute.computec", { my_texture: resource.texture() });
300
+ * ```
301
+ */
302
+ function set_textures(path: Hash | string, textures: LuaMap<string, Hash>): void;
303
+ }
304
+ }
305
+
306
+ export {};
package/generated/go.d.ts CHANGED
@@ -3,9 +3,7 @@ import type { Hash, Matrix4, Opaque, Quaternion, Url, Vector, Vector3, Vector4 }
3
3
 
4
4
  declare global {
5
5
  /**
6
- * Functions, core hooks, messages and constants for manipulation of
7
- * game objects. The "go" namespace is accessible from game object script
8
- * files.
6
+ * Game object API documentation
9
7
  */
10
8
  namespace go {
11
9
  /**
@@ -650,8 +648,14 @@ declare global {
650
648
  * `userid`
651
649
  * Id of the user associated with the controller. Usually only relevant on consoles.
652
650
  *
651
+ * `gamepad_guid`
652
+ * The guid of the gamepad controller. Only passed with "connected" action.
653
+ *
654
+ * `gamepad_guid_info`
655
+ * Parsed guid info table. Only passed with "connected" action. See table below.
656
+ *
653
657
  * `gamepad_unknown`
654
- * True if the inout originated from an unknown/unmapped gamepad.
658
+ * True if the input originated from an unknown/unmapped gamepad.
655
659
  *
656
660
  * `gamepad_name`
657
661
  * Name of the gamepad
@@ -703,6 +707,27 @@ declare global {
703
707
  * `acc_z`
704
708
  * Accelerometer z value (if present).
705
709
  *
710
+ * Guid info table:
711
+ * This info is only passed with a `connected` action.
712
+ *
713
+ * Field
714
+ * Description
715
+ *
716
+ * `vendor`
717
+ * USB vendor id. E.g. Nintendo 0x057e, Sony 0x054c, or Microsoft 0x045e
718
+ *
719
+ * `product`
720
+ * USB product id
721
+ *
722
+ * `bus`
723
+ * How device is communicating. E.g.0x0003 for USB devices and 0x0005 for Bluetooth devices.
724
+ *
725
+ * `crc`
726
+ * SDL CRC16 signature, typically used when vendor and product ids are unavailable
727
+ *
728
+ * `version`
729
+ * The device or firmware version
730
+ *
706
731
  * @param self - reference to the script state to be used for storing data
707
732
  * @param action_id - id of the received input action, as mapped in the input_binding-file
708
733
  * @param action - a table containing the input data, see above for a description
@@ -4,6 +4,11 @@ declare global {
4
4
  * Graphics functions and constants.
5
5
  */
6
6
  namespace graphics {
7
+ const BLEND_EQUATION_ADD: number & { readonly __brand: "graphics.BLEND_EQUATION_ADD" };
8
+ const BLEND_EQUATION_MAX: number & { readonly __brand: "graphics.BLEND_EQUATION_MAX" };
9
+ const BLEND_EQUATION_MIN: number & { readonly __brand: "graphics.BLEND_EQUATION_MIN" };
10
+ const BLEND_EQUATION_REVERSE_SUBTRACT: number & { readonly __brand: "graphics.BLEND_EQUATION_REVERSE_SUBTRACT" };
11
+ const BLEND_EQUATION_SUBTRACT: number & { readonly __brand: "graphics.BLEND_EQUATION_SUBTRACT" };
7
12
  const BLEND_FACTOR_CONSTANT_ALPHA: number & { readonly __brand: "graphics.BLEND_FACTOR_CONSTANT_ALPHA" };
8
13
  const BLEND_FACTOR_CONSTANT_COLOR: number & { readonly __brand: "graphics.BLEND_FACTOR_CONSTANT_COLOR" };
9
14
  const BLEND_FACTOR_DST_ALPHA: number & { readonly __brand: "graphics.BLEND_FACTOR_DST_ALPHA" };
@@ -47,6 +52,44 @@ declare global {
47
52
  const COMPRESSION_TYPE_DEFAULT: number & { readonly __brand: "graphics.COMPRESSION_TYPE_DEFAULT" };
48
53
  const COMPRESSION_TYPE_WEBP: number & { readonly __brand: "graphics.COMPRESSION_TYPE_WEBP" };
49
54
  const COMPRESSION_TYPE_WEBP_LOSSY: number & { readonly __brand: "graphics.COMPRESSION_TYPE_WEBP_LOSSY" };
55
+ /**
56
+ * Context feature flag indicating support for 3D (volume) textures.
57
+ */
58
+ const CONTEXT_FEATURE_3D_TEXTURES: number & { readonly __brand: "graphics.CONTEXT_FEATURE_3D_TEXTURES" };
59
+ /**
60
+ * Context feature flag indicating support for ASTC compressed 2D array textures.
61
+ * Some WebGL/GLES drivers fail array texture ASTC uploads while 2D ASTC works.
62
+ */
63
+ const CONTEXT_FEATURE_ASTC_ARRAY_TEXTURES: number & { readonly __brand: "graphics.CONTEXT_FEATURE_ASTC_ARRAY_TEXTURES" };
64
+ /**
65
+ * Context feature flag indicating support for min/max blend equations.
66
+ * Requires GLES3+ or EXT_blend_minmax.
67
+ */
68
+ const CONTEXT_FEATURE_BLEND_EQUATION_MIN_MAX: number & { readonly __brand: "graphics.CONTEXT_FEATURE_BLEND_EQUATION_MIN_MAX" };
69
+ /**
70
+ * Context feature flag indicating support for compute shaders.
71
+ */
72
+ const CONTEXT_FEATURE_COMPUTE_SHADER: number & { readonly __brand: "graphics.CONTEXT_FEATURE_COMPUTE_SHADER" };
73
+ /**
74
+ * Context feature flag indicating support for hardware instancing.
75
+ */
76
+ const CONTEXT_FEATURE_INSTANCING: number & { readonly __brand: "graphics.CONTEXT_FEATURE_INSTANCING" };
77
+ /**
78
+ * Context feature flag indicating support for rendering to multiple color targets simultaneously.
79
+ */
80
+ const CONTEXT_FEATURE_MULTI_TARGET_RENDERING: number & { readonly __brand: "graphics.CONTEXT_FEATURE_MULTI_TARGET_RENDERING" };
81
+ /**
82
+ * Context feature flag indicating support for storage buffers.
83
+ */
84
+ const CONTEXT_FEATURE_STORAGE_BUFFER: number & { readonly __brand: "graphics.CONTEXT_FEATURE_STORAGE_BUFFER" };
85
+ /**
86
+ * Context feature flag indicating support for texture arrays.
87
+ */
88
+ const CONTEXT_FEATURE_TEXTURE_ARRAY: number & { readonly __brand: "graphics.CONTEXT_FEATURE_TEXTURE_ARRAY" };
89
+ /**
90
+ * Context feature flag indicating support for vertical sync (vsync).
91
+ */
92
+ const CONTEXT_FEATURE_VSYNC: number & { readonly __brand: "graphics.CONTEXT_FEATURE_VSYNC" };
50
93
  const FACE_TYPE_BACK: number & { readonly __brand: "graphics.FACE_TYPE_BACK" };
51
94
  const FACE_TYPE_FRONT: number & { readonly __brand: "graphics.FACE_TYPE_FRONT" };
52
95
  const FACE_TYPE_FRONT_AND_BACK: number & { readonly __brand: "graphics.FACE_TYPE_FRONT_AND_BACK" };
@@ -220,6 +263,58 @@ declare global {
220
263
  const TEXTURE_WRAP_CLAMP_TO_EDGE: number & { readonly __brand: "graphics.TEXTURE_WRAP_CLAMP_TO_EDGE" };
221
264
  const TEXTURE_WRAP_MIRRORED_REPEAT: number & { readonly __brand: "graphics.TEXTURE_WRAP_MIRRORED_REPEAT" };
222
265
  const TEXTURE_WRAP_REPEAT: number & { readonly __brand: "graphics.TEXTURE_WRAP_REPEAT" };
266
+ /**
267
+ * Returns a table describing the active graphics context: the adapter family,
268
+ * its hardware limits, the list of driver-reported extensions, and the set of
269
+ * optional context features supported by the backend.
270
+ *
271
+ * @returns table with the following fields:
272
+ * `family` string adapter family name (e.g. "opengl", "vulkan")
273
+ * `version_major` number adapter API major version (e.g. 1 for Vulkan 1.4)
274
+ * `version_minor` number adapter API minor version (e.g. 4 for Vulkan 1.4)
275
+ * `limits` table hardware/driver limits:
276
+ *
277
+ * ``max_texture_size_2d` [type:number] max 2D texture dimension in texels
278
+ * `max_texture_size_3d` [type:number] max 3D (volume) texture dimension in texels
279
+ * `max_texture_size_cube` [type:number] max cube map face dimension in texels
280
+ * `max_texture_array_layers` [type:number] max layers in an array texture
281
+ * `max_framebuffer_width` [type:number] max framebuffer width in pixels
282
+ * `max_framebuffer_height` [type:number] max framebuffer height in pixels
283
+ * `max_color_attachments` [type:number] max simultaneous color attachments
284
+ * `max_samplers_per_stage` [type:number] max texture samplers per shader stage
285
+ * `max_textures_per_stage` [type:number] max sampled textures per shader stage
286
+ * `max_vertex_attributes` [type:number] max vertex attributes
287
+ * `max_vertex_buffers` [type:number] max vertex buffer bindings
288
+ * `max_compute_workgroup_size_x` [type:number] max compute workgroup size (X)
289
+ * `max_compute_workgroup_size_y` [type:number] max compute workgroup size (Y)
290
+ * `max_compute_workgroup_size_z` [type:number] max compute workgroup size (Z)
291
+ * `max_compute_workgroup_invocations` [type:number] max invocations per compute workgroup
292
+ * `max_compute_shared_memory_size` [type:number] max shared memory per compute workgroup (bytes)
293
+ * `max_uniform_buffer_range` [type:number] max bindable uniform buffer range (bytes)
294
+ * `max_storage_buffer_range` [type:number] max bindable storage buffer range (bytes)
295
+ * `
296
+ *
297
+ * `extensions` table array of driver-reported extension name strings
298
+ * `features` table array of supported context feature ids:
299
+ *
300
+ * ``graphics.CONTEXT_FEATURE_MULTI_TARGET_RENDERING` multi-target rendering
301
+ * `graphics.CONTEXT_FEATURE_TEXTURE_ARRAY` texture arrays
302
+ * `graphics.CONTEXT_FEATURE_COMPUTE_SHADER` compute shaders
303
+ * `graphics.CONTEXT_FEATURE_STORAGE_BUFFER` storage buffers
304
+ * `graphics.CONTEXT_FEATURE_VSYNC` vertical sync
305
+ * `graphics.CONTEXT_FEATURE_INSTANCING` hardware instancing
306
+ * `graphics.CONTEXT_FEATURE_3D_TEXTURES` 3D (volume) textures
307
+ * `graphics.CONTEXT_FEATURE_ASTC_ARRAY_TEXTURES` ASTC compressed 2D array textures
308
+ * `graphics.CONTEXT_FEATURE_BLEND_EQUATION_MIN_MAX` min/max blend equations
309
+ * `
310
+ */
311
+ function get_adapter_info(): { family: string; version_major: number; version_minor: number; limits: { max_texture_size_2d: number; max_texture_size_3d: number; max_texture_size_cube: number; max_texture_array_layers: number; max_framebuffer_width: number; max_framebuffer_height: number; max_color_attachments: number; max_samplers_per_stage: number; max_textures_per_stage: number; max_vertex_attributes: number; max_vertex_buffers: number; max_compute_workgroup_size_x: number; max_compute_workgroup_size_y: number; max_compute_workgroup_size_z: number; max_compute_workgroup_invocations: number; max_compute_shared_memory_size: number; max_uniform_buffer_range: number; max_storage_buffer_range: number }; extensions: string[]; features: number[] };
312
+ /**
313
+ * get the list of graphics adapters that have been registered with the engine
314
+ *
315
+ * @returns array of adapter family name strings (e.g. "opengl", "vulkan", "webgpu")
316
+ */
317
+ function get_engine_adapters(): string[];
223
318
  }
224
319
  }
225
320
 
@@ -3,9 +3,7 @@ import type { Hash, Opaque, Quaternion, Url, Vector, Vector3, Vector4 } from "..
3
3
 
4
4
  declare global {
5
5
  /**
6
- * GUI core hooks, functions, messages, properties and constants for
7
- * creation and manipulation of GUI nodes. The "gui" namespace is
8
- * accessible only from gui scripts.
6
+ * GUI API documentation
9
7
  */
10
8
  namespace gui {
11
9
  /**
@@ -15,7 +15,7 @@ declare global {
15
15
  * @param json - json data
16
16
  * @param options - table with decode options
17
17
  *
18
- * - boolean `decode_null_as_userdata`: wether to decode a JSON null value as json.null or nil (default is nil)
18
+ * - boolean `decode_null_as_userdata`: whether to decode a JSON null value as json.null or nil (default is nil)
19
19
  * @returns decoded json
20
20
  * @example
21
21
  * ```ts
@@ -49,7 +49,7 @@ declare global {
49
49
  * @param tbl - lua table to encode
50
50
  * @param options - table with encode options
51
51
  *
52
- * - string `encode_empty_table_as_object`: wether to encode an empty table as an JSON object or array (default is object)
52
+ * - string `encode_empty_table_as_object`: whether to encode an empty table as an JSON object or array (default is object)
53
53
  * @returns encoded json
54
54
  * @example
55
55
  * ```ts
@@ -2,10 +2,16 @@
2
2
  /// <reference types="lua-types/special/jit-only" />
3
3
  import "../b2d";
4
4
  import "../b2d_body";
5
+ import "../b2d_chain";
6
+ import "../b2d_fixture";
7
+ import "../b2d_joint";
8
+ import "../b2d_shape";
9
+ import "../b2d_world";
5
10
  import "../buffer";
6
11
  import "../camera";
7
12
  import "../collectionfactory";
8
13
  import "../collectionproxy";
14
+ import "../compute";
9
15
  import "../crash";
10
16
  import "../factory";
11
17
  import "../font";
@@ -19,6 +25,7 @@ import "../image";
19
25
  import "../json";
20
26
  import "../label";
21
27
  import "../liveupdate";
28
+ import "../material";
22
29
  import "../model";
23
30
  import "../msg";
24
31
  import "../particlefx";
@@ -2,10 +2,16 @@
2
2
  /// <reference types="lua-types/special/jit-only" />
3
3
  import "../b2d";
4
4
  import "../b2d_body";
5
+ import "../b2d_chain";
6
+ import "../b2d_fixture";
7
+ import "../b2d_joint";
8
+ import "../b2d_shape";
9
+ import "../b2d_world";
5
10
  import "../buffer";
6
11
  import "../camera";
7
12
  import "../collectionfactory";
8
13
  import "../collectionproxy";
14
+ import "../compute";
9
15
  import "../crash";
10
16
  import "../factory";
11
17
  import "../font";
@@ -19,6 +25,7 @@ import "../image";
19
25
  import "../json";
20
26
  import "../label";
21
27
  import "../liveupdate";
28
+ import "../material";
22
29
  import "../model";
23
30
  import "../msg";
24
31
  import "../particlefx";