@defold-typescript/types 0.40.0 → 0.42.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 (224) hide show
  1. package/api-availability.json +3963 -772
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18069 -10240
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +560 -89
  6. package/fixtures/messages_doc.json +96 -0
  7. package/generated/b2d.d.ts +680 -4
  8. package/generated/b2d_body.d.ts +29 -103
  9. package/generated/b2d_chain.d.ts +5 -6
  10. package/generated/b2d_fixture.d.ts +34 -38
  11. package/generated/b2d_joint.d.ts +503 -25
  12. package/generated/b2d_shape.d.ts +183 -20
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +16 -15
  15. package/generated/builtin-messages.d.ts +7 -1
  16. package/generated/bullet3d.d.ts +91 -0
  17. package/generated/bullet3d_collision_object.d.ts +433 -0
  18. package/generated/bullet3d_constraint.d.ts +818 -0
  19. package/generated/bullet3d_rigid_body.d.ts +429 -0
  20. package/generated/bullet3d_shape.d.ts +123 -0
  21. package/generated/bullet3d_world.d.ts +492 -0
  22. package/generated/camera.d.ts +29 -32
  23. package/generated/collectionfactory.d.ts +15 -18
  24. package/generated/collectionproxy.d.ts +22 -6
  25. package/generated/compute.d.ts +12 -238
  26. package/generated/crash.d.ts +24 -10
  27. package/generated/editor-vm/http.d.ts +90 -7
  28. package/generated/editor-vm/image.d.ts +7 -7
  29. package/generated/editor-vm/json.d.ts +11 -0
  30. package/generated/editor-vm/localization.d.ts +7 -7
  31. package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
  32. package/generated/editor-vm/zip.d.ts +28 -0
  33. package/generated/editor.d.ts +1496 -430
  34. package/generated/factory.d.ts +21 -25
  35. package/generated/font.d.ts +64 -22
  36. package/generated/go.d.ts +235 -182
  37. package/generated/graphics.d.ts +335 -97
  38. package/generated/gui.d.ts +240 -471
  39. package/generated/html5.d.ts +2 -2
  40. package/generated/http.d.ts +28 -35
  41. package/generated/image.d.ts +105 -72
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +7 -0
  44. package/generated/kinds/render-script.d.ts +7 -0
  45. package/generated/kinds/script.d.ts +7 -0
  46. package/generated/label.d.ts +77 -7
  47. package/generated/liveupdate.d.ts +13 -10
  48. package/generated/material.d.ts +312 -360
  49. package/generated/model.d.ts +40 -39
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +365 -133
  52. package/generated/profiler.d.ts +13 -23
  53. package/generated/render.d.ts +237 -297
  54. package/generated/resource.d.ts +664 -583
  55. package/generated/socket.d.ts +120 -133
  56. package/generated/sound.d.ts +62 -31
  57. package/generated/sprite.d.ts +31 -17
  58. package/generated/sys.d.ts +234 -190
  59. package/generated/tilemap.d.ts +21 -16
  60. package/generated/timer.d.ts +34 -21
  61. package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
  62. package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
  63. package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
  65. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
  68. package/generated/versions/defold-1.12.4/go.d.ts +6 -12
  69. package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
  70. package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/http.d.ts +0 -13
  72. package/generated/versions/defold-1.12.4/image.d.ts +16 -33
  73. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  74. package/generated/versions/defold-1.12.4/json.d.ts +10 -6
  75. package/generated/versions/defold-1.12.4/label.d.ts +2 -3
  76. package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
  77. package/generated/versions/defold-1.12.4/model.d.ts +2 -10
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
  81. package/generated/versions/defold-1.12.4/render.d.ts +99 -128
  82. package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
  83. package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
  84. package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
  86. package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
  87. package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
  88. package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
  89. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
  90. package/generated/versions/defold-1.12.4/window.d.ts +1 -16
  91. package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
  92. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
  93. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
  94. package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
  95. package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
  96. package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
  100. package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
  102. package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
  103. package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
  104. package/generated/versions/defold-1.13.0/go.d.ts +6 -12
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
  107. package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
  108. package/generated/versions/defold-1.13.0/http.d.ts +0 -13
  109. package/generated/versions/defold-1.13.0/image.d.ts +16 -33
  110. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  111. package/generated/versions/defold-1.13.0/json.d.ts +10 -6
  112. package/generated/versions/defold-1.13.0/label.d.ts +2 -3
  113. package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
  114. package/generated/versions/defold-1.13.0/material.d.ts +68 -106
  115. package/generated/versions/defold-1.13.0/model.d.ts +2 -10
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
  119. package/generated/versions/defold-1.13.0/render.d.ts +99 -128
  120. package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
  121. package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
  122. package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
  124. package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
  125. package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
  126. package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
  127. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
  128. package/generated/versions/defold-1.13.0/window.d.ts +1 -16
  129. package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
  130. package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
  131. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
  132. package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
  133. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
  134. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
  135. package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
  136. package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
  137. package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
  138. package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
  139. package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
  140. package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
  141. package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
  142. package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
  143. package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
  144. package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
  145. package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
  146. package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
  147. package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
  148. package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
  149. package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
  150. package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
  151. package/generated/versions/defold-1.13.1/font.d.ts +81 -0
  152. package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
  153. package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
  154. package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
  155. package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
  156. package/generated/versions/defold-1.13.1/http.d.ts +77 -0
  157. package/generated/versions/defold-1.13.1/image.d.ts +131 -0
  158. package/generated/versions/defold-1.13.1/index.d.ts +57 -0
  159. package/generated/versions/defold-1.13.1/json.d.ts +80 -0
  160. package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
  161. package/generated/versions/defold-1.13.1/label.d.ts +93 -0
  162. package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
  163. package/generated/versions/defold-1.13.1/material.d.ts +408 -0
  164. package/generated/versions/defold-1.13.1/model.d.ts +272 -0
  165. package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
  166. package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
  167. package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
  168. package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
  169. package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
  170. package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
  171. package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
  172. package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
  173. package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
  174. package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
  175. package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
  176. package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
  177. package/generated/versions/defold-1.13.1/types.d.ts +61 -0
  178. package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
  179. package/generated/versions/defold-1.13.1/window.d.ts +183 -0
  180. package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
  181. package/generated/vmath.d.ts +1 -21
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +7 -0
  185. package/package.json +18 -2
  186. package/scripts/example-store-io.ts +12 -1
  187. package/scripts/extension-goldens.ts +1 -0
  188. package/scripts/fidelity-baseline.json +146 -46
  189. package/scripts/generate-api-availability.ts +90 -12
  190. package/scripts/generate-api-signatures.ts +12 -2
  191. package/scripts/import-defold-release.ts +106 -26
  192. package/scripts/prose-constants.ts +77 -16
  193. package/scripts/regen.ts +391 -77
  194. package/scripts/shared-handle-methods.ts +53 -0
  195. package/scripts/signature-store-fs.ts +1 -0
  196. package/scripts/sync-api-docs.ts +48 -10
  197. package/src/api-availability.ts +0 -0
  198. package/src/api-doc.ts +201 -3
  199. package/src/api-identity.ts +252 -0
  200. package/src/core-types.ts +26 -3
  201. package/src/correction-pins.ts +49 -0
  202. package/src/doc-comment.ts +104 -11
  203. package/src/doc-corrections.ts +108 -0
  204. package/src/editor-vm-globals.d.ts +5 -2
  205. package/src/emit-dts.ts +2064 -281
  206. package/src/emit-messages.ts +52 -0
  207. package/src/example-store.ts +125 -14
  208. package/src/field-correction-coverage.ts +204 -0
  209. package/src/fnv1a.ts +16 -0
  210. package/src/go-overloads.d.ts +25 -6
  211. package/src/index-base-table.ts +145 -0
  212. package/src/index-slot-classifications.ts +588 -0
  213. package/src/index.ts +38 -5
  214. package/src/library-index-slot-classifications.ts +332 -0
  215. package/src/lifecycle.ts +61 -199
  216. package/src/luals-type-expr.ts +354 -0
  217. package/src/msg-overloads.d.ts +0 -1
  218. package/src/param-correction-provenance.ts +8 -11
  219. package/src/render-overloads.d.ts +0 -15
  220. package/src/return-correction-provenance.ts +58 -16
  221. package/src/sys-overloads.d.ts +48 -0
  222. package/src/vmath-overloads.d.ts +27 -1
  223. package/src/window-event-guard.d.ts +6 -9
  224. package/url-parameters.json +1 -2
@@ -1,366 +1,377 @@
1
1
  /** @noSelfInFile */
2
- import type { Hash, Matrix4, Vector3, Vector4 } from "../src/core-types";
2
+ import type { Hash, Matrix4, Opaque, Vector3, Vector4 } from "../src/core-types";
3
3
 
4
4
  declare global {
5
5
  /**
6
6
  * Functions for interacting with materials.
7
7
  */
8
8
  namespace material {
9
+ /**
10
+ * Shader constant information
11
+ */
12
+ interface constant_info {
13
+ /**
14
+ * Constant name.
15
+ */
16
+ name: Hash;
17
+ /**
18
+ * Constant type.
19
+ */
20
+ type: material.CONSTANT_TYPE;
21
+ /**
22
+ * Constant value or values. Present for user constants.
23
+ */
24
+ value?: material.constant_info_value;
25
+ }
26
+ type constant_info_value = Vector4 | Matrix4 | Vector4[] | Matrix4[];
27
+ /**
28
+ * Shader constant update
29
+ */
30
+ interface constant_options {
31
+ /**
32
+ * Constant type.
33
+ */
34
+ type?: material.CONSTANT_TYPE;
35
+ /**
36
+ * Constant value or values.
37
+ */
38
+ value?: material.constant_value;
39
+ }
40
+ type constant_value = number | Vector3 | Vector4 | Matrix4 | (number | Vector3 | Vector4 | Matrix4)[];
41
+ /**
42
+ * Named material vertex attribute update
43
+ */
44
+ interface named_vertex_attribute_options {
45
+ /**
46
+ * Attribute name.
47
+ */
48
+ name: string | Hash;
49
+ /**
50
+ * Attribute value.
51
+ */
52
+ value?: material.vertex_attribute_value;
53
+ /**
54
+ * Whether integer data is normalized.
55
+ */
56
+ normalize?: boolean;
57
+ /**
58
+ * Attribute data type.
59
+ */
60
+ data_type?: graphics.DATA_TYPE;
61
+ /**
62
+ * Attribute coordinate space.
63
+ */
64
+ coordinate_space?: graphics.COORDINATE_SPACE;
65
+ /**
66
+ * Attribute semantic.
67
+ */
68
+ semantic_type?: graphics.SEMANTIC_TYPE;
69
+ }
70
+ /**
71
+ * Texture sampler information
72
+ */
73
+ interface sampler_info {
74
+ /**
75
+ * Sampler name.
76
+ */
77
+ name: Hash;
78
+ /**
79
+ * Sampler texture type.
80
+ */
81
+ type: graphics.TEXTURE_TYPE;
82
+ /**
83
+ * Horizontal wrap mode.
84
+ */
85
+ u_wrap: graphics.TEXTURE_WRAP;
86
+ /**
87
+ * Vertical wrap mode.
88
+ */
89
+ v_wrap: graphics.TEXTURE_WRAP;
90
+ /**
91
+ * Depth wrap mode.
92
+ */
93
+ w_wrap: graphics.TEXTURE_WRAP;
94
+ /**
95
+ * Minification filter.
96
+ */
97
+ min_filter: graphics.TEXTURE_FILTER;
98
+ /**
99
+ * Magnification filter.
100
+ */
101
+ mag_filter: graphics.TEXTURE_FILTER;
102
+ /**
103
+ * Maximum anisotropy.
104
+ */
105
+ max_anisotropy: number;
106
+ }
107
+ /**
108
+ * Texture sampler update
109
+ */
110
+ interface sampler_options {
111
+ /**
112
+ * Horizontal wrap mode.
113
+ */
114
+ u_wrap?: graphics.TEXTURE_WRAP;
115
+ /**
116
+ * Vertical wrap mode.
117
+ */
118
+ v_wrap?: graphics.TEXTURE_WRAP;
119
+ /**
120
+ * Depth wrap mode.
121
+ */
122
+ w_wrap?: graphics.TEXTURE_WRAP;
123
+ /**
124
+ * Minification filter.
125
+ */
126
+ min_filter?: graphics.TEXTURE_FILTER;
127
+ /**
128
+ * Magnification filter.
129
+ */
130
+ mag_filter?: graphics.TEXTURE_FILTER;
131
+ /**
132
+ * Maximum anisotropy.
133
+ */
134
+ max_anisotropy?: number;
135
+ }
136
+ /**
137
+ * Texture information
138
+ */
139
+ interface texture_info {
140
+ /**
141
+ * Texture resource path, if backed by a resource.
142
+ */
143
+ path?: Hash;
144
+ /**
145
+ * Runtime texture handle.
146
+ */
147
+ handle: Opaque<"texture">;
148
+ /**
149
+ * Texture width.
150
+ */
151
+ width: number;
152
+ /**
153
+ * Texture height.
154
+ */
155
+ height: number;
156
+ /**
157
+ * Texture depth or layer count.
158
+ */
159
+ depth: number;
160
+ /**
161
+ * Texture page count.
162
+ */
163
+ page_count: number;
164
+ /**
165
+ * Mipmap count.
166
+ */
167
+ mipmaps: number;
168
+ /**
169
+ * Texture type.
170
+ */
171
+ type: graphics.TEXTURE_TYPE;
172
+ /**
173
+ * Texture usage flags.
174
+ */
175
+ flags: graphics.TEXTURE_USAGE_FLAG | number;
176
+ }
177
+ /**
178
+ * Material vertex attribute information
179
+ */
180
+ interface vertex_attribute_info {
181
+ /**
182
+ * Attribute name.
183
+ */
184
+ name: Hash;
185
+ /**
186
+ * Attribute value.
187
+ */
188
+ value: material.vertex_attribute_value;
189
+ /**
190
+ * Whether integer data is normalized.
191
+ */
192
+ normalize: boolean;
193
+ /**
194
+ * Attribute data type.
195
+ */
196
+ data_type: graphics.DATA_TYPE;
197
+ /**
198
+ * Attribute coordinate space.
199
+ */
200
+ coordinate_space: graphics.COORDINATE_SPACE;
201
+ /**
202
+ * Attribute semantic.
203
+ */
204
+ semantic_type: graphics.SEMANTIC_TYPE;
205
+ }
206
+ /**
207
+ * Material vertex attribute update
208
+ */
209
+ interface vertex_attribute_options {
210
+ /**
211
+ * Attribute value.
212
+ */
213
+ value?: material.vertex_attribute_value;
214
+ /**
215
+ * Whether integer data is normalized.
216
+ */
217
+ normalize?: boolean;
218
+ /**
219
+ * Attribute data type.
220
+ */
221
+ data_type?: graphics.DATA_TYPE;
222
+ /**
223
+ * Attribute coordinate space.
224
+ */
225
+ coordinate_space?: graphics.COORDINATE_SPACE;
226
+ /**
227
+ * Attribute semantic.
228
+ */
229
+ semantic_type?: graphics.SEMANTIC_TYPE;
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;
233
+ /**
234
+ * Normal matrix constant.
235
+ */
236
+ const CONSTANT_TYPE_NORMAL: number & { readonly __brand: "material.CONSTANT_TYPE_NORMAL" };
237
+ /**
238
+ * Projection matrix constant.
239
+ */
240
+ const CONSTANT_TYPE_PROJECTION: number & { readonly __brand: "material.CONSTANT_TYPE_PROJECTION" };
241
+ /**
242
+ * Inverse projection matrix constant.
243
+ */
244
+ const CONSTANT_TYPE_PROJECTION_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_PROJECTION_INVERSE" };
245
+ /**
246
+ * Texture matrix constant.
247
+ */
248
+ const CONSTANT_TYPE_TEXTURE: number & { readonly __brand: "material.CONSTANT_TYPE_TEXTURE" };
249
+ /**
250
+ * Time constant.
251
+ */
252
+ const CONSTANT_TYPE_TIME: number & { readonly __brand: "material.CONSTANT_TYPE_TIME" };
253
+ /**
254
+ * User vector constant.
255
+ */
256
+ const CONSTANT_TYPE_USER: number & { readonly __brand: "material.CONSTANT_TYPE_USER" };
257
+ /**
258
+ * User color constant.
259
+ */
260
+ const CONSTANT_TYPE_USER_COLOR: number & { readonly __brand: "material.CONSTANT_TYPE_USER_COLOR" };
261
+ /**
262
+ * User matrix constant.
263
+ */
264
+ const CONSTANT_TYPE_USER_MATRIX4: number & { readonly __brand: "material.CONSTANT_TYPE_USER_MATRIX4" };
265
+ /**
266
+ * View matrix constant.
267
+ */
268
+ const CONSTANT_TYPE_VIEW: number & { readonly __brand: "material.CONSTANT_TYPE_VIEW" };
269
+ /**
270
+ * Inverse view matrix constant.
271
+ */
272
+ const CONSTANT_TYPE_VIEW_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_VIEW_INVERSE" };
273
+ /**
274
+ * View-projection matrix constant.
275
+ */
276
+ const CONSTANT_TYPE_VIEWPROJ: number & { readonly __brand: "material.CONSTANT_TYPE_VIEWPROJ" };
277
+ /**
278
+ * Inverse view-projection matrix constant.
279
+ */
280
+ const CONSTANT_TYPE_VIEWPROJ_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_VIEWPROJ_INVERSE" };
281
+ /**
282
+ * World matrix constant.
283
+ */
284
+ const CONSTANT_TYPE_WORLD: number & { readonly __brand: "material.CONSTANT_TYPE_WORLD" };
285
+ /**
286
+ * Inverse world matrix constant.
287
+ */
288
+ const CONSTANT_TYPE_WORLD_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_WORLD_INVERSE" };
289
+ /**
290
+ * World-view matrix constant.
291
+ */
292
+ const CONSTANT_TYPE_WORLDVIEW: number & { readonly __brand: "material.CONSTANT_TYPE_WORLDVIEW" };
293
+ /**
294
+ * Inverse world-view matrix constant.
295
+ */
296
+ const CONSTANT_TYPE_WORLDVIEW_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_WORLDVIEW_INVERSE" };
297
+ /**
298
+ * World-view-projection matrix constant.
299
+ */
300
+ const CONSTANT_TYPE_WORLDVIEWPROJ: number & { readonly __brand: "material.CONSTANT_TYPE_WORLDVIEWPROJ" };
301
+ /**
302
+ * Inverse world-view-projection matrix constant.
303
+ */
304
+ const CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE: number & { readonly __brand: "material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE" };
9
305
  /**
10
306
  * Returns a table of all the shader constants in the material. This function will return all the shader constants
11
307
  * that are used in both the vertex and the fragment shaders.
12
308
  *
13
309
  * @param path - The path to the resource
14
- * @returns A table of tables, where each entry contains info about the shader constants:
15
- *
16
- * `name`
17
- * hash the hashed name of the constant
18
- * `type`
19
- * number the type of the constant. Supported values:
20
- *
21
- * - `material.CONSTANT_TYPE_USER`
22
- *
23
- * - `material.CONSTANT_TYPE_USER_MATRIX4`
24
- *
25
- * - `material.CONSTANT_TYPE_VIEWPROJ`
26
- *
27
- * - `material.CONSTANT_TYPE_WORLD`
28
- *
29
- * - `material.CONSTANT_TYPE_TEXTURE`
30
- *
31
- * - `material.CONSTANT_TYPE_VIEW`
32
- *
33
- * - `material.CONSTANT_TYPE_PROJECTION`
34
- *
35
- * - `material.CONSTANT_TYPE_NORMAL`
36
- *
37
- * - `material.CONSTANT_TYPE_WORLDVIEW`
38
- *
39
- * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
40
- *
41
- * - `material.CONSTANT_TYPE_TIME`
42
- *
43
- * - `material.CONSTANT_TYPE_WORLD_INVERSE`
44
- *
45
- * - `material.CONSTANT_TYPE_VIEW_INVERSE`
46
- *
47
- * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
48
- *
49
- * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
50
- *
51
- * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
52
- *
53
- * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
54
- *
55
- * `value`
56
- * 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`.
310
+ * @returns Shader constant information.
57
311
  * @example
58
312
  * ```ts
59
313
  * const constants = material.get_constants(resource.material("/my_material.materialc"));
60
314
  * ```
61
315
  */
62
- function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];
316
+ function get_constants(path: Hash | string): material.constant_info[];
63
317
  /**
64
318
  * Returns a table of all the texture samplers in the material. This function will return all the texture samplers
65
319
  * that are used in both the vertex and the fragment shaders.
66
320
  *
67
321
  * @param path - The path to the resource
68
- * @returns A table of tables, where each entry contains info about the texture samplers:
69
- *
70
- * `name`
71
- * hash the hashed name of the texture sampler
72
- * `u_wrap`
73
- * number the u wrap mode of the texture sampler. Supported values:
74
- *
75
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
76
- *
77
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
78
- *
79
- * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
80
- *
81
- * - `graphics.TEXTURE_WRAP_REPEAT`
82
- *
83
- * `v_wrap`
84
- * number the v wrap mode of the texture sampler. Supported values:
85
- *
86
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
87
- *
88
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
89
- *
90
- * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
91
- *
92
- * - `graphics.TEXTURE_WRAP_REPEAT`
93
- *
94
- * `min_filter`
95
- * number the min filter mode of the texture sampler. Supported values:
96
- *
97
- * - `graphics.TEXTURE_FILTER_DEFAULT`
98
- *
99
- * - `graphics.TEXTURE_FILTER_NEAREST`
100
- *
101
- * - `graphics.TEXTURE_FILTER_LINEAR`
102
- *
103
- * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
104
- *
105
- * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
106
- *
107
- * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
108
- *
109
- * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
110
- *
111
- * `mag_filter`
112
- * number the mag filter mode of the texture sampler
113
- *
114
- * - `graphics.TEXTURE_FILTER_DEFAULT`
115
- *
116
- * - `graphics.TEXTURE_FILTER_NEAREST`
117
- *
118
- * - `graphics.TEXTURE_FILTER_LINEAR`
119
- *
120
- * `max_anisotropy`
121
- * number the max anisotropy of the texture sampler
322
+ * @returns texture sampler information
122
323
  * @example
123
324
  * ```ts
124
325
  * const samplers = material.get_samplers(resource.material("/my_material.materialc"));
125
326
  * ```
126
327
  */
127
- function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];
328
+ function get_samplers(path: Hash | string): material.sampler_info[];
128
329
  /**
129
330
  * Returns a table of all the textures from the material.
130
331
  *
131
332
  * @param path - The path to the resource
132
- * @returns A table of tables, where each entry contains info about the material textures:
133
- *
134
- * `path`
135
- * hash the resource path of the texture. Only available if the texture is a resource.
136
- * `handle`
137
- * hash the runtime handle of the texture.
138
- * `width`
139
- * number the width of the texture
140
- * `height`
141
- * number the height of the texture
142
- * `depth`
143
- * number the depth of the texture. Corresponds to the number of layers in an array texture.
144
- * `mipmaps`
145
- * number the number of mipmaps in the texture
146
- * `type`
147
- * number the type of the texture. Supported values:
148
- *
149
- * - `graphics.TEXTURE_TYPE_2D`
150
- *
151
- * - `graphics.TEXTURE_TYPE_2D_ARRAY`
152
- *
153
- * - `graphics.TEXTURE_TYPE_CUBE_MAP`
154
- *
155
- * - `graphics.TEXTURE_TYPE_IMAGE_2D`
156
- *
157
- * - `graphics.TEXTURE_TYPE_3D`
158
- *
159
- * - `graphics.TEXTURE_TYPE_IMAGE_3D`
160
- *
161
- * `flags`
162
- * number the flags of the texture. This field is a bit mask of these supported flags:
163
- *
164
- * - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
165
- *
166
- * - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
167
- *
168
- * - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
169
- *
170
- * - `graphics.TEXTURE_USAGE_FLAG_INPUT`
171
- *
172
- * - `graphics.TEXTURE_USAGE_FLAG_COLOR`
333
+ * @returns material texture information
173
334
  * @example
174
335
  * ```ts
175
336
  * const textures = material.get_textures(resource.material("/my_material.materialc"));
176
337
  * ```
177
338
  */
178
- function get_textures(path: Hash | string): { path: Hash; handle: Hash; width: number; height: number; depth: number; mipmaps: number; type: number; flags: number }[];
339
+ function get_textures(path: Hash | string): material.texture_info[];
179
340
  /**
180
341
  * Returns a table of all the vertex attributes in the material. This function will return all the vertex attributes
181
342
  * that are used in the vertex shader of the material.
182
343
  *
183
344
  * @param path - The path to the resource
184
- * @returns A table of tables, where each entry contains info about the vertex attributes:
185
- *
186
- * `name`
187
- * hash the hashed name of the vertex attribute
188
- * `value`
189
- * vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value of the vertex attribute. Matrix attributes that do not map to `vmath.matrix4` are returned as a table of numbers.
190
- * `normalize`
191
- * boolean whether the value is normalized when passed into the shader
192
- * `data_type`
193
- * number the data type of the vertex attribute. Supported values:
194
- *
195
- * - `graphics.DATA_TYPE_BYTE`
196
- *
197
- * - `graphics.DATA_TYPE_UNSIGNED_BYTE`
198
- *
199
- * - `graphics.DATA_TYPE_SHORT`
200
- *
201
- * - `graphics.DATA_TYPE_UNSIGNED_SHORT`
202
- *
203
- * - `graphics.DATA_TYPE_INT`
204
- *
205
- * - `graphics.DATA_TYPE_UNSIGNED_INT`
206
- *
207
- * - `graphics.DATA_TYPE_FLOAT`
208
- *
209
- * `coordinate_space`
210
- * number the coordinate space of the vertex attribute. Supported values:
211
- *
212
- * - `graphics.COORDINATE_SPACE_WORLD`
213
- *
214
- * - `graphics.COORDINATE_SPACE_LOCAL`
215
- *
216
- * `semantic_type`
217
- * number the semantic type of the vertex attribute. Supported values:
218
- *
219
- * - `graphics.SEMANTIC_TYPE_NONE`
220
- *
221
- * - `graphics.SEMANTIC_TYPE_POSITION`
222
- *
223
- * - `graphics.SEMANTIC_TYPE_TEXCOORD`
224
- *
225
- * - `graphics.SEMANTIC_TYPE_PAGE_INDEX`
226
- *
227
- * - `graphics.SEMANTIC_TYPE_COLOR`
228
- *
229
- * - `graphics.SEMANTIC_TYPE_NORMAL`
230
- *
231
- * - `graphics.SEMANTIC_TYPE_TANGENT`
232
- *
233
- * - `graphics.SEMANTIC_TYPE_WORLD_MATRIX`
234
- *
235
- * - `graphics.SEMANTIC_TYPE_NORMAL_MATRIX`
236
- *
237
- * - `graphics.SEMANTIC_TYPE_BONE_WEIGHTS`
238
- *
239
- * - `graphics.SEMANTIC_TYPE_BONE_INDICES`
240
- *
241
- * - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
242
- *
243
- * - `graphics.SEMANTIC_TYPE_MORPH_TARGET_WEIGHTS`
345
+ * @returns vertex attribute information
244
346
  * @example
245
347
  * ```ts
246
348
  * const vertex_attributes = material.get_vertex_attributes(resource.material("/my_material.materialc"));
247
349
  * ```
248
350
  */
249
- function get_vertex_attributes(path: Hash | string): { name: Hash; value: Vector4 | Vector3 | Matrix4 | number | number[]; normalize: boolean; data_type: number; coordinate_space: number; semantic_type: number }[];
351
+ function get_vertex_attributes(path: Hash | string): material.vertex_attribute_info[];
250
352
  /**
251
353
  * Sets shader constants in a material, if the constants exist.
252
354
  *
253
355
  * @param path - The path to the resource
254
- * @param constants - A table keyed by constant name with args tables as values. Constants can be partially updated. Supported entries:
255
- *
256
- * `type`
257
- * number the type of the constant. Supported values:
258
- *
259
- * - `material.CONSTANT_TYPE_USER`
260
- *
261
- * - `material.CONSTANT_TYPE_USER_MATRIX4`
262
- *
263
- * - `material.CONSTANT_TYPE_VIEWPROJ`
264
- *
265
- * - `material.CONSTANT_TYPE_WORLD`
266
- *
267
- * - `material.CONSTANT_TYPE_TEXTURE`
268
- *
269
- * - `material.CONSTANT_TYPE_VIEW`
270
- *
271
- * - `material.CONSTANT_TYPE_PROJECTION`
272
- *
273
- * - `material.CONSTANT_TYPE_NORMAL`
274
- *
275
- * - `material.CONSTANT_TYPE_WORLDVIEW`
276
- *
277
- * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
278
- *
279
- * - `material.CONSTANT_TYPE_TIME`
280
- *
281
- * - `material.CONSTANT_TYPE_WORLD_INVERSE`
282
- *
283
- * - `material.CONSTANT_TYPE_VIEW_INVERSE`
284
- *
285
- * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
286
- *
287
- * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
288
- *
289
- * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
290
- *
291
- * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
292
- *
293
- * `value`
294
- * 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.
356
+ * @param constants - Shader constant updates keyed by constant name. Partial updates are supported.
295
357
  * @example
296
358
  * ```ts
297
359
  * material.set_constants(resource.material("/my_material.materialc"), { tint: { value: vmath.vector4(1, 0, 0, 1) } });
298
360
  * ```
299
361
  */
300
- function set_constants(path: Hash | string, constants: Record<string, { type?: number; value?: Vector4 | Vector3 | Matrix4 | number | (Vector4 | Matrix4)[] }>): void;
362
+ function set_constants(path: Hash | string, constants: LuaMap<string | Hash, material.constant_options> | Record<string, material.constant_options>): void;
301
363
  /**
302
364
  * Sets texture samplers in a material, if the samplers exist. Use this function to change the settings of texture samplers.
303
365
  * To set actual textures that should be bound to the samplers, use the `material.set_textures` function instead.
304
366
  *
305
367
  * @param path - The path to the resource
306
- * @param samplers - A table keyed by sampler name with args tables as values. Partial updates are supported. Supported entries:
307
- *
308
- * `u_wrap`
309
- * number the u wrap mode of the texture sampler. Supported values:
310
- *
311
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
312
- *
313
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
314
- *
315
- * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
316
- *
317
- * - `graphics.TEXTURE_WRAP_REPEAT`
318
- *
319
- * `v_wrap`
320
- * number the v wrap mode of the texture sampler. Supported values:
321
- *
322
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
323
- *
324
- * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
325
- *
326
- * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
327
- *
328
- * - `graphics.TEXTURE_WRAP_REPEAT`
329
- *
330
- * `min_filter`
331
- * number the min filter mode of the texture sampler. Supported values:
332
- *
333
- * - `graphics.TEXTURE_FILTER_DEFAULT`
334
- *
335
- * - `graphics.TEXTURE_FILTER_NEAREST`
336
- *
337
- * - `graphics.TEXTURE_FILTER_LINEAR`
338
- *
339
- * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
340
- *
341
- * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
342
- *
343
- * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
344
- *
345
- * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
346
- *
347
- * `mag_filter`
348
- * number the mag filter mode of the texture sampler
349
- *
350
- * - `graphics.TEXTURE_FILTER_DEFAULT`
351
- *
352
- * - `graphics.TEXTURE_FILTER_NEAREST`
353
- *
354
- * - `graphics.TEXTURE_FILTER_LINEAR`
355
- *
356
- * `max_anisotropy`
357
- * number the max anisotropy of the texture sampler
368
+ * @param samplers - Sampler updates keyed by sampler name. Partial updates are supported.
358
369
  * @example
359
370
  * ```ts
360
371
  * material.set_samplers(resource.material("/my_material.materialc"), { texture_sampler: { u_wrap: graphics.TEXTURE_WRAP_REPEAT, v_wrap: graphics.TEXTURE_WRAP_MIRRORED_REPEAT } });
361
372
  * ```
362
373
  */
363
- 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;
374
+ function set_samplers(path: Hash | string, samplers: LuaMap<string | Hash, material.sampler_options> | Record<string, material.sampler_options>): void;
364
375
  /**
365
376
  * Sets textures in a material, if the samplers exist.
366
377
  *
@@ -371,77 +382,18 @@ declare global {
371
382
  * material.set_textures(resource.material("/my_material.materialc"), { my_texture: resource.texture() });
372
383
  * ```
373
384
  */
374
- function set_textures(path: Hash | string, textures: LuaMap<string, Hash> | Record<string, Hash>): void;
385
+ function set_textures(path: Hash | string, textures: LuaMap<string | Hash, string | Hash> | Record<string, string | Hash>): void;
375
386
  /**
376
387
  * Sets vertex attributes in a material, if the vertex attributes exist.
377
388
  *
378
389
  * @param path - The path to the resource
379
- * @param attributes - A table keyed by vertex attribute name with args tables as values. Partial updates are supported. Supported entries:
380
- *
381
- * `value`
382
- * vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value of the vertex attribute. Use a table of numbers for matrix attributes that do not map to `vmath.matrix4`.
383
- * `normalize`
384
- * boolean whether the value is normalized when passed into the shader
385
- * `data_type`
386
- * number the data type of the vertex attribute. Supported values:
387
- *
388
- * - `graphics.DATA_TYPE_BYTE`
389
- *
390
- * - `graphics.DATA_TYPE_UNSIGNED_BYTE`
391
- *
392
- * - `graphics.DATA_TYPE_SHORT`
393
- *
394
- * - `graphics.DATA_TYPE_UNSIGNED_SHORT`
395
- *
396
- * - `graphics.DATA_TYPE_INT`
397
- *
398
- * - `graphics.DATA_TYPE_UNSIGNED_INT`
399
- *
400
- * - `graphics.DATA_TYPE_FLOAT`
401
- *
402
- * `coordinate_space`
403
- * number the coordinate space of the vertex attribute. Supported values:
404
- *
405
- * - `graphics.COORDINATE_SPACE_DEFAULT`
406
- *
407
- * - `graphics.COORDINATE_SPACE_WORLD`
408
- *
409
- * - `graphics.COORDINATE_SPACE_LOCAL`
410
- *
411
- * `semantic_type`
412
- * number the semantic type of the vertex attribute. Supported values:
413
- *
414
- * - `graphics.SEMANTIC_TYPE_NONE`
415
- *
416
- * - `graphics.SEMANTIC_TYPE_POSITION`
417
- *
418
- * - `graphics.SEMANTIC_TYPE_TEXCOORD`
419
- *
420
- * - `graphics.SEMANTIC_TYPE_PAGE_INDEX`
421
- *
422
- * - `graphics.SEMANTIC_TYPE_COLOR`
423
- *
424
- * - `graphics.SEMANTIC_TYPE_NORMAL`
425
- *
426
- * - `graphics.SEMANTIC_TYPE_TANGENT`
427
- *
428
- * - `graphics.SEMANTIC_TYPE_WORLD_MATRIX`
429
- *
430
- * - `graphics.SEMANTIC_TYPE_NORMAL_MATRIX`
431
- *
432
- * - `graphics.SEMANTIC_TYPE_BONE_WEIGHTS`
433
- *
434
- * - `graphics.SEMANTIC_TYPE_BONE_INDICES`
435
- *
436
- * - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
437
- *
438
- * - `graphics.SEMANTIC_TYPE_MORPH_TARGET_WEIGHTS`
390
+ * @param attributes - Vertex attributes keyed by name, or an array with explicit `name` fields. Partial updates are supported.
439
391
  * @example
440
392
  * ```ts
441
393
  * material.set_vertex_attributes(resource.material("/my_material.materialc"), { tint_attribute: { value: vmath.vector4(1, 0, 0, 1), semantic_type: graphics.SEMANTIC_TYPE_COLOR } });
442
394
  * ```
443
395
  */
444
- function set_vertex_attributes(path: Hash | string, attributes: Record<string, { value?: Vector4 | Vector3 | Matrix4 | number | number[]; normalize?: boolean; data_type?: number; coordinate_space?: number; semantic_type?: number }>): void;
396
+ 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;
445
397
  }
446
398
  }
447
399