@defold-typescript/types 0.39.0 → 0.41.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 (227) hide show
  1. package/api-availability.json +4024 -716
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18118 -10264
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +619 -148
  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 +199 -14
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +33 -29
  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 +31 -34
  23. package/generated/collectionfactory.d.ts +26 -27
  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 +243 -186
  37. package/generated/graphics.d.ts +374 -84
  38. package/generated/gui.d.ts +282 -492
  39. package/generated/html5.d.ts +5 -3
  40. package/generated/http.d.ts +31 -36
  41. package/generated/image.d.ts +127 -85
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +8 -0
  44. package/generated/kinds/render-script.d.ts +8 -0
  45. package/generated/kinds/script.d.ts +8 -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 +72 -42
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +378 -144
  52. package/generated/profiler.d.ts +14 -24
  53. package/generated/render.d.ts +294 -297
  54. package/generated/resource.d.ts +753 -641
  55. package/generated/socket.d.ts +131 -134
  56. package/generated/sound.d.ts +65 -34
  57. package/generated/sprite.d.ts +39 -17
  58. package/generated/sys.d.ts +237 -182
  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 +18 -17
  63. package/generated/versions/defold-1.12.4/camera.d.ts +23 -23
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +21 -19
  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 +15 -17
  69. package/generated/versions/defold-1.12.4/gui.d.ts +111 -193
  70. package/generated/versions/defold-1.12.4/html5.d.ts +4 -2
  71. package/generated/versions/defold-1.12.4/http.d.ts +4 -15
  72. package/generated/versions/defold-1.12.4/image.d.ts +38 -46
  73. package/generated/versions/defold-1.12.4/index.d.ts +2 -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 +34 -13
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +82 -78
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +3 -6
  81. package/generated/versions/defold-1.12.4/render.d.ts +160 -132
  82. package/generated/versions/defold-1.12.4/resource.d.ts +212 -209
  83. package/generated/versions/defold-1.12.4/socket.d.ts +45 -61
  84. package/generated/versions/defold-1.12.4/sound.d.ts +11 -11
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +24 -6
  86. package/generated/versions/defold-1.12.4/sys.d.ts +45 -68
  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 +5 -26
  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 +188 -5
  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 +18 -17
  96. package/generated/versions/defold-1.13.0/camera.d.ts +27 -27
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +21 -19
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +1 -70
  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 +15 -17
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +121 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +111 -193
  107. package/generated/versions/defold-1.13.0/html5.d.ts +4 -2
  108. package/generated/versions/defold-1.13.0/http.d.ts +4 -15
  109. package/generated/versions/defold-1.13.0/image.d.ts +38 -46
  110. package/generated/versions/defold-1.13.0/index.d.ts +2 -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 +69 -107
  115. package/generated/versions/defold-1.13.0/model.d.ts +34 -13
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +82 -78
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +3 -6
  119. package/generated/versions/defold-1.13.0/render.d.ts +160 -132
  120. package/generated/versions/defold-1.13.0/resource.d.ts +217 -210
  121. package/generated/versions/defold-1.13.0/socket.d.ts +45 -61
  122. package/generated/versions/defold-1.13.0/sound.d.ts +11 -11
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +24 -6
  124. package/generated/versions/defold-1.13.0/sys.d.ts +45 -68
  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 +5 -26
  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 +6 -26
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +8 -0
  185. package/package.json +13 -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 +14 -3
  191. package/scripts/import-defold-release.ts +85 -24
  192. package/scripts/prose-constants.ts +157 -0
  193. package/scripts/regen.ts +396 -78
  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 +16 -5
  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/component-properties.d.ts +33 -0
  201. package/src/core-types.ts +28 -3
  202. package/src/correction-pins.ts +49 -0
  203. package/src/custom-messages.d.ts +4 -3
  204. package/src/doc-comment.ts +139 -23
  205. package/src/doc-corrections.ts +108 -0
  206. package/src/editor-vm-globals.d.ts +5 -2
  207. package/src/emit-dts.ts +2474 -281
  208. package/src/emit-messages.ts +52 -0
  209. package/src/engine-globals.d.ts +2 -2
  210. package/src/example-store.ts +125 -14
  211. package/src/field-correction-coverage.ts +204 -0
  212. package/src/fnv1a.ts +16 -0
  213. package/src/go-overloads.d.ts +33 -13
  214. package/src/index-base-table.ts +145 -0
  215. package/src/index-slot-classifications.ts +588 -0
  216. package/src/index.ts +39 -2
  217. package/src/library-index-slot-classifications.ts +332 -0
  218. package/src/lifecycle.ts +61 -199
  219. package/src/luals-type-expr.ts +354 -0
  220. package/src/msg-overloads.d.ts +0 -1
  221. package/src/param-correction-provenance.ts +64 -0
  222. package/src/return-correction-provenance.ts +58 -16
  223. package/src/script-api.ts +3 -1
  224. package/src/sys-overloads.d.ts +48 -0
  225. package/src/vmath-overloads.d.ts +27 -1
  226. package/src/window-event-guard.d.ts +6 -9
  227. package/url-parameters.json +1 -2
@@ -0,0 +1,237 @@
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
+ * - `material.CONSTANT_TYPE_USER_MATRIX4`
22
+ * - `material.CONSTANT_TYPE_VIEWPROJ`
23
+ * - `material.CONSTANT_TYPE_WORLD`
24
+ * - `material.CONSTANT_TYPE_TEXTURE`
25
+ * - `material.CONSTANT_TYPE_VIEW`
26
+ * - `material.CONSTANT_TYPE_PROJECTION`
27
+ * - `material.CONSTANT_TYPE_NORMAL`
28
+ * - `material.CONSTANT_TYPE_WORLDVIEW`
29
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
30
+ * - `material.CONSTANT_TYPE_TIME`
31
+ * - `material.CONSTANT_TYPE_WORLD_INVERSE`
32
+ * - `material.CONSTANT_TYPE_VIEW_INVERSE`
33
+ * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
34
+ * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
35
+ * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
36
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
37
+ *
38
+ * `value`
39
+ * 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`.
40
+ * @example
41
+ * ```ts
42
+ * const constants = compute.get_constants("/my_compute.computec");
43
+ * ```
44
+ */
45
+ function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];
46
+ /**
47
+ * Returns a table of all the texture samplers in the compute program. This function will return all the texture samplers
48
+ * that are available, even the ones that have not been specified in the compute resource.
49
+ *
50
+ * @param path - The path to the resource
51
+ * @returns A table of tables, where each entry contains info about the texture samplers:
52
+ *
53
+ * `name`
54
+ * hash the hashed name of the texture sampler
55
+ * `u_wrap`
56
+ * number the u wrap mode of the texture sampler. Supported values:
57
+ *
58
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
59
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
60
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
61
+ * - `graphics.TEXTURE_WRAP_REPEAT`
62
+ *
63
+ * `v_wrap`
64
+ * number the v wrap mode of the texture sampler. Supported values:
65
+ *
66
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
67
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
68
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
69
+ * - `graphics.TEXTURE_WRAP_REPEAT`
70
+ *
71
+ * `min_filter`
72
+ * number the min filter mode of the texture sampler. Supported values:
73
+ *
74
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
75
+ * - `graphics.TEXTURE_FILTER_NEAREST`
76
+ * - `graphics.TEXTURE_FILTER_LINEAR`
77
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
78
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
79
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
80
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
81
+ *
82
+ * `mag_filter`
83
+ * number the mag filter mode of the texture sampler
84
+ *
85
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
86
+ * - `graphics.TEXTURE_FILTER_NEAREST`
87
+ * - `graphics.TEXTURE_FILTER_LINEAR`
88
+ *
89
+ * `max_anisotropy`
90
+ * number the max anisotropy of the texture sampler
91
+ * @example
92
+ * ```ts
93
+ * const samplers = compute.get_samplers("/my_compute.computec");
94
+ * ```
95
+ */
96
+ function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];
97
+ /**
98
+ * Returns a table of all the textures from the compute program.
99
+ *
100
+ * @param path - The path to the resource
101
+ * @returns A table of tables, where each entry contains info about the compute textures:
102
+ *
103
+ * `path`
104
+ * hash the resource path of the texture. Only available if the texture is a resource.
105
+ * `handle`
106
+ * hash the runtime handle of the texture.
107
+ * `width`
108
+ * number the width of the texture
109
+ * `height`
110
+ * number the height of the texture
111
+ * `depth`
112
+ * number the depth of the texture. Corresponds to the number of layers in an array texture.
113
+ * `mipmaps`
114
+ * number the number of mipmaps in the texture
115
+ * `type`
116
+ * number the type of the texture. Supported values:
117
+ *
118
+ * - `graphics.TEXTURE_TYPE_2D`
119
+ * - `graphics.TEXTURE_TYPE_2D_ARRAY`
120
+ * - `graphics.TEXTURE_TYPE_CUBE_MAP`
121
+ * - `graphics.TEXTURE_TYPE_IMAGE_2D`
122
+ * - `graphics.TEXTURE_TYPE_3D`
123
+ * - `graphics.TEXTURE_TYPE_IMAGE_3D`
124
+ *
125
+ * `flags`
126
+ * number the flags of the texture. This field is a bit mask of these supported flags:
127
+ *
128
+ * - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
129
+ * - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
130
+ * - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
131
+ * - `graphics.TEXTURE_USAGE_FLAG_INPUT`
132
+ * - `graphics.TEXTURE_USAGE_FLAG_COLOR`
133
+ * @example
134
+ * ```ts
135
+ * const textures = compute.get_textures("/my_compute.computec");
136
+ * ```
137
+ */
138
+ function get_textures(path: Hash | string): { path: Hash; handle: Hash; width: number; height: number; depth: number; mipmaps: number; type: number; flags: number }[];
139
+ /**
140
+ * Sets shader constants in a compute program, if the constants exist.
141
+ *
142
+ * @param path - The path to the resource
143
+ * @param constants - A table keyed by constant name with args tables as values. Constants can be partially updated. Supported entries:
144
+ *
145
+ * `type`
146
+ * number the type of the constant. Supported values:
147
+ *
148
+ * - `material.CONSTANT_TYPE_USER`
149
+ * - `material.CONSTANT_TYPE_USER_MATRIX4`
150
+ * - `material.CONSTANT_TYPE_VIEWPROJ`
151
+ * - `material.CONSTANT_TYPE_WORLD`
152
+ * - `material.CONSTANT_TYPE_TEXTURE`
153
+ * - `material.CONSTANT_TYPE_VIEW`
154
+ * - `material.CONSTANT_TYPE_PROJECTION`
155
+ * - `material.CONSTANT_TYPE_NORMAL`
156
+ * - `material.CONSTANT_TYPE_WORLDVIEW`
157
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
158
+ * - `material.CONSTANT_TYPE_TIME`
159
+ * - `material.CONSTANT_TYPE_WORLD_INVERSE`
160
+ * - `material.CONSTANT_TYPE_VIEW_INVERSE`
161
+ * - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
162
+ * - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
163
+ * - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
164
+ * - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
165
+ *
166
+ * `value`
167
+ * 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.
168
+ * @example
169
+ * ```ts
170
+ * compute.set_constants("/my_compute.computec", { tint: { value: vmath.vector4(1, 0, 0, 1) } });
171
+ * ```
172
+ */
173
+ function set_constants(path: Hash | string, constants: Record<string, { type?: number; value?: Vector4 | Vector3 | Matrix4 | number | (Vector4 | Matrix4)[] }>): void;
174
+ /**
175
+ * Sets texture samplers in a compute program, if the samplers exist. Use this function to change the settings of texture samplers.
176
+ * To set actual textures that should be bound to the samplers, use the `compute.set_textures` function instead.
177
+ *
178
+ * @param path - The path to the resource
179
+ * @param samplers - A table keyed by sampler name with args tables as values. Partial updates are supported. Supported entries:
180
+ *
181
+ * `u_wrap`
182
+ * number the u wrap mode of the texture sampler. Supported values:
183
+ *
184
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
185
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
186
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
187
+ * - `graphics.TEXTURE_WRAP_REPEAT`
188
+ *
189
+ * `v_wrap`
190
+ * number the v wrap mode of the texture sampler. Supported values:
191
+ *
192
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
193
+ * - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
194
+ * - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
195
+ * - `graphics.TEXTURE_WRAP_REPEAT`
196
+ *
197
+ * `min_filter`
198
+ * number the min filter mode of the texture sampler. Supported values:
199
+ *
200
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
201
+ * - `graphics.TEXTURE_FILTER_NEAREST`
202
+ * - `graphics.TEXTURE_FILTER_LINEAR`
203
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
204
+ * - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
205
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
206
+ * - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
207
+ *
208
+ * `mag_filter`
209
+ * number the mag filter mode of the texture sampler
210
+ *
211
+ * - `graphics.TEXTURE_FILTER_DEFAULT`
212
+ * - `graphics.TEXTURE_FILTER_NEAREST`
213
+ * - `graphics.TEXTURE_FILTER_LINEAR`
214
+ *
215
+ * `max_anisotropy`
216
+ * number the max anisotropy of the texture sampler
217
+ * @example
218
+ * ```ts
219
+ * compute.set_samplers("/my_compute.computec", { texture_sampler: { u_wrap: graphics.TEXTURE_WRAP_REPEAT, v_wrap: graphics.TEXTURE_WRAP_MIRRORED_REPEAT } });
220
+ * ```
221
+ */
222
+ 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;
223
+ /**
224
+ * Sets textures in a compute program, if the samplers exist.
225
+ *
226
+ * @param path - The path to the resource
227
+ * @param textures - A table keyed by sampler name with texture resources as values.
228
+ * @example
229
+ * ```ts
230
+ * compute.set_textures("/my_compute.computec", { my_texture: resource.texture() });
231
+ * ```
232
+ */
233
+ function set_textures(path: Hash | string, textures: LuaMap<string, Hash> | Record<string, Hash>): void;
234
+ }
235
+ }
236
+
237
+ export {};
@@ -0,0 +1,143 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Native crash logging functions and constants.
5
+ */
6
+ namespace crash {
7
+ /**
8
+ * android build fingerprint
9
+ */
10
+ const SYSFIELD_ANDROID_BUILD_FINGERPRINT: number & { readonly __brand: "crash.SYSFIELD_ANDROID_BUILD_FINGERPRINT" };
11
+ /**
12
+ * system device language as reported by sys.get_sys_info
13
+ */
14
+ const SYSFIELD_DEVICE_LANGUAGE: number & { readonly __brand: "crash.SYSFIELD_DEVICE_LANGUAGE" };
15
+ /**
16
+ * device model as reported by sys.get_sys_info
17
+ */
18
+ const SYSFIELD_DEVICE_MODEL: number & { readonly __brand: "crash.SYSFIELD_DEVICE_MODEL" };
19
+ /**
20
+ * engine version as hash
21
+ */
22
+ const SYSFIELD_ENGINE_HASH: number & { readonly __brand: "crash.SYSFIELD_ENGINE_HASH" };
23
+ /**
24
+ * engine version as release number
25
+ */
26
+ const SYSFIELD_ENGINE_VERSION: number & { readonly __brand: "crash.SYSFIELD_ENGINE_VERSION" };
27
+ /**
28
+ * system language as reported by sys.get_sys_info
29
+ */
30
+ const SYSFIELD_LANGUAGE: number & { readonly __brand: "crash.SYSFIELD_LANGUAGE" };
31
+ /**
32
+ * device manufacturer as reported by sys.get_sys_info
33
+ */
34
+ const SYSFIELD_MANUFACTURER: number & { readonly __brand: "crash.SYSFIELD_MANUFACTURER" };
35
+ /**
36
+ * The max number of sysfields.
37
+ */
38
+ const SYSFIELD_MAX: number & { readonly __brand: "crash.SYSFIELD_MAX" };
39
+ /**
40
+ * system name as reported by sys.get_sys_info
41
+ */
42
+ const SYSFIELD_SYSTEM_NAME: number & { readonly __brand: "crash.SYSFIELD_SYSTEM_NAME" };
43
+ /**
44
+ * system version as reported by sys.get_sys_info
45
+ */
46
+ const SYSFIELD_SYSTEM_VERSION: number & { readonly __brand: "crash.SYSFIELD_SYSTEM_VERSION" };
47
+ /**
48
+ * system territory as reported by sys.get_sys_info
49
+ */
50
+ const SYSFIELD_TERRITORY: number & { readonly __brand: "crash.SYSFIELD_TERRITORY" };
51
+ /**
52
+ * The max number of user fields.
53
+ */
54
+ const USERFIELD_MAX: number & { readonly __brand: "crash.USERFIELD_MAX" };
55
+ /**
56
+ * The max size of a single user field.
57
+ */
58
+ const USERFIELD_SIZE: number & { readonly __brand: "crash.USERFIELD_SIZE" };
59
+ /**
60
+ * A table is returned containing the addresses of the call stack.
61
+ *
62
+ * @param handle - crash dump handle
63
+ * @returns table containing the backtrace
64
+ */
65
+ function get_backtrace(handle: number): Record<string | number, unknown>;
66
+ /**
67
+ * The format of read text blob is platform specific
68
+ * and not guaranteed
69
+ * but can be useful for manual inspection.
70
+ *
71
+ * @param handle - crash dump handle
72
+ * @returns string with the platform specific data
73
+ */
74
+ function get_extra_data(handle: number): string;
75
+ /**
76
+ * The function returns a table containing entries with sub-tables that
77
+ * have fields 'name' and 'address' set for all loaded modules.
78
+ *
79
+ * @param handle - crash dump handle
80
+ * @returns module table
81
+ */
82
+ function get_modules(handle: number): Record<string | number, unknown>;
83
+ /**
84
+ * read signal number from a crash report
85
+ *
86
+ * @param handle - crash dump handle
87
+ * @returns signal number
88
+ */
89
+ function get_signum(handle: number): number;
90
+ /**
91
+ * reads a system field from a loaded crash dump
92
+ *
93
+ * @param handle - crash dump handle
94
+ * @param index - system field enum. Must be less than crash.SYSFIELD_MAX
95
+ * @returns value recorded in the crash dump, or `nil` if it didn't exist
96
+ */
97
+ function get_sys_field(handle: number, index: number): string | undefined;
98
+ /**
99
+ * reads user field from a loaded crash dump
100
+ *
101
+ * @param handle - crash dump handle
102
+ * @param index - user data slot index. **0️⃣ 0-based; passed to Defold unchanged.**
103
+ * @returns user data value recorded in the crash dump
104
+ */
105
+ function get_user_field(handle: number, index: number): string;
106
+ /**
107
+ * The crash dump will be removed from disk upon a successful
108
+ * load, so loading is one-shot.
109
+ *
110
+ * @returns handle to the loaded dump, or `nil` if no dump was found
111
+ */
112
+ function load_previous(): number | undefined;
113
+ /**
114
+ * releases a previously loaded crash dump
115
+ *
116
+ * @param handle - handle to loaded crash dump
117
+ */
118
+ function release(handle: number): void;
119
+ /**
120
+ * Crashes occuring before the path is set will be stored to a default engine location.
121
+ *
122
+ * @param path - file path to use
123
+ */
124
+ function set_file_path(path: string): void;
125
+ /**
126
+ * Store a user value that will get written to a crash dump when
127
+ * a crash occurs. This can be user id:s, breadcrumb data etc.
128
+ * There are 32 slots indexed from 0. Each slot stores at most 255 characters.
129
+ *
130
+ * @param index - slot index. 0-indexed. **0️⃣ 0-based; passed to Defold unchanged.**
131
+ * @param value - string value to store
132
+ */
133
+ function set_user_field(index: number, value: string): void;
134
+ /**
135
+ * Performs the same steps as if a crash had just occured but
136
+ * allows the program to continue.
137
+ * The generated dump can be read by crash.load_previous
138
+ */
139
+ function write_dump(): void;
140
+ }
141
+ }
142
+
143
+ export {};
@@ -0,0 +1,56 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace http {
7
+ /**
8
+ * Perform an HTTP request
9
+ *
10
+ * @param url - request URL
11
+ * @param opts - Additional request options, a table with the following keys:`method string`request method, defaults to `"GET"``headers table`request headers, a table with string keys and values`body string`request body`as string`response body converter, either `"string"` or `"json"`; mutually exclusive with `path``path string`destination file path, resolved against project root if relative; mutually exclusive with `as`
12
+ * @returns HTTP response, a table with the following keys:`status integer`response code`headers table`response headers, a table where each key is a lower-cased string, and each value is either a string or an array of strings if the header was repeated`body string, any, nil`response body, present only when `as` option was provided, either a string or a parsed json value`path string, nil`resolved absolute destination path, present only after a successful response was written when the `path` option was provided
13
+ */
14
+ function request(url: string, opts?: Record<string | number, unknown>): Record<string | number, unknown>;
15
+ namespace server {
16
+ /**
17
+ * Create HTTP response that will stream the content of a file defined by the path
18
+ *
19
+ * @param path - External file path, resolved against project root if relative
20
+ * @param status - HTTP status code, an integer, default 200
21
+ * @param headers - HTTP response headers, a table from lower-case header names to header values
22
+ * @returns HTTP response value, userdata
23
+ */
24
+ function external_file_response(path: string, status?: number, headers?: unknown): unknown;
25
+ /**
26
+ * Create HTTP response with a JSON value
27
+ *
28
+ * @param value - Any Lua value that may be represented as JSON
29
+ * @param status - HTTP status code, an integer, default 200
30
+ * @param headers - HTTP response headers, a table from lower-case header names to header values
31
+ * @returns HTTP response value, userdata
32
+ */
33
+ function json_response(value: unknown, status?: number, headers?: unknown): unknown;
34
+ /**
35
+ * Create HTTP response that will stream the content of a resource defined by the resource path
36
+ *
37
+ * @param resource_path - Resource path (starting with `/`)
38
+ * @param status - HTTP status code, an integer, default 200
39
+ * @param headers - HTTP response headers, a table from lower-case header names to header values
40
+ * @returns HTTP response value, userdata
41
+ */
42
+ function resource_response(resource_path: string, status?: number, headers?: unknown): unknown;
43
+ /**
44
+ * Create HTTP response
45
+ *
46
+ * @param status - HTTP status code, an integer, default 200
47
+ * @param headers - HTTP response headers, a table from lower-case header names to header values
48
+ * @param body - HTTP response body
49
+ * @returns HTTP response value, userdata
50
+ */
51
+ function response(status?: number, headers?: unknown, body?: string): unknown;
52
+ }
53
+ }
54
+ }
55
+
56
+ export {};
@@ -0,0 +1,48 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace image {
7
+ /**
8
+ * Load an image file for reading
9
+ *
10
+ * @param path - External file path, resolved against project root if relative
11
+ * @returns image userdata
12
+ */
13
+ function load_file(path: string): unknown;
14
+ /**
15
+ * Return the color of a pixel from a loaded image.
16
+ * Coordinates are 1-based, with `1, 1` at the top-left corner.
17
+ *
18
+ * @param image - image userdata returned by `image.load_file()`
19
+ * @param x - 1-based horizontal pixel coordinate. **⚠️ 1-based; passed to Defold unchanged.**
20
+ * @param y - 1-based vertical pixel coordinate. **⚠️ 1-based; passed to Defold unchanged.**
21
+ */
22
+ function pixel(image: unknown, x: number, y: number): LuaMultiReturn<[number, number, number, number]>;
23
+ /**
24
+ * Iterate over pixels in a loaded image.
25
+ * The iterator returns pixels row by row from top-left to bottom-right. Coordinates are 1-based.
26
+ *
27
+ * @param image - image userdata returned by `image.load_file()`
28
+ * @returns iterator function returning `x, y, r, g, b, a` for each pixel. **⚠️ 1-based; passed to Defold unchanged.**
29
+ * @example
30
+ * ```lua
31
+ * local img = image.load_file("assets/source.png")
32
+ * local width, height = image.size(img)
33
+ * for x, y, r, g, b, a in image.pixels(img) do
34
+ * print(x, y, r, g, b, a)
35
+ * end
36
+ * ```
37
+ */
38
+ function pixels(image: unknown): (...args: unknown[]) => unknown;
39
+ /**
40
+ * Return the width and height of a loaded image.
41
+ *
42
+ * @param image - image userdata returned by `image.load_file()`
43
+ */
44
+ function size(image: unknown): LuaMultiReturn<[number, number]>;
45
+ }
46
+ }
47
+
48
+ export {};
@@ -0,0 +1,10 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace json {
7
+ }
8
+ }
9
+
10
+ export {};
@@ -0,0 +1,42 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque } from "../../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Editor scripting documentation
7
+ */
8
+ namespace localization {
9
+ /**
10
+ * Create a message pattern that renders a list with the "and" conjunction (for example: a, b, and c) once it is stringified
11
+ *
12
+ * @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
13
+ * @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
14
+ */
15
+ function and_list(items: unknown[]): Opaque<"message">;
16
+ /**
17
+ * Create a message pattern that concatenates values (similar to `table.concat`) and performs the actual concatenation when stringified
18
+ *
19
+ * @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
20
+ * @param separator - optional separator inserted between values; defaults to an empty string
21
+ * @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
22
+ */
23
+ function concat(items: unknown[], separator?: boolean | number | string | Opaque<"message">): Opaque<"message">;
24
+ /**
25
+ * Create a message pattern for a localization key defined in an `.editor_localization` file; the actual localization happens when the returned value is stringified
26
+ *
27
+ * @param key - localization key defined in an `.editor_localization` file
28
+ * @param vars - optional table with variables to be substituted in the localized string that uses ICU Message Format syntax; keys must be strings; values must be either `nil`, `boolean`, `number`, `string`, or another `message` instance
29
+ * @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
30
+ */
31
+ function message(key: string, vars?: Record<string | number, unknown>): Opaque<"message">;
32
+ /**
33
+ * Create a message pattern that renders a list with the "or" conjunction (for example: a, b, or c) once it is stringified
34
+ *
35
+ * @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
36
+ * @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
37
+ */
38
+ function or_list(items: unknown[]): Opaque<"message">;
39
+ }
40
+ }
41
+
42
+ export {};
@@ -0,0 +1,80 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace tilemap.tiles {
7
+ /**
8
+ * Remove all tiles
9
+ *
10
+ * @param tiles - unbounded 2d grid of tiles
11
+ * @returns unbounded 2d grid of tiles
12
+ */
13
+ export function clear(tiles: unknown): unknown;
14
+ /**
15
+ * Get full information from a tile at a particular coordinate
16
+ *
17
+ * @param tiles - unbounded 2d grid of tiles
18
+ * @param x - x coordinate of a tile
19
+ * @param y - y coordinate of a tile
20
+ * @returns full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ `index` is 1-based; passed to Defold unchanged.**
21
+ */
22
+ export function get_info(tiles: unknown, x: number, y: number): Record<string | number, unknown>;
23
+ /**
24
+ * Get a tile index at a particular coordinate
25
+ *
26
+ * @param tiles - unbounded 2d grid of tiles
27
+ * @param x - x coordinate of a tile
28
+ * @param y - y coordinate of a tile
29
+ * @returns 1-indexed tile index of a tilemap's tilesource. **⚠️ 1-based; passed to Defold unchanged.**
30
+ */
31
+ export function get_tile(tiles: unknown, x: number, y: number): number;
32
+ /**
33
+ * Create an iterator over all tiles in a tiles data structure
34
+ * When iterating using for loop, each iteration returns x, y and tile index of a tile in a tile map
35
+ *
36
+ * @param tiles - unbounded 2d grid of tiles
37
+ * @returns iterator
38
+ * @example
39
+ * ```lua
40
+ * Iterate over all tiles in a tile map:
41
+ * local layers = editor.get("/level.tilemap", "layers")
42
+ * for i = 1, #layers do
43
+ * local tiles = editor.get(layers[i], "tiles")
44
+ * for x, y, i in tilemap.tiles.iterator(tiles) do
45
+ * print(x, y, i)
46
+ * end
47
+ * end
48
+ * ```
49
+ */
50
+ export function iterator(tiles: unknown): (...args: unknown[]) => unknown;
51
+ /**
52
+ * Create a new unbounded 2d grid data structure for storing tilemap layer tiles
53
+ *
54
+ * @returns unbounded 2d grid of tiles
55
+ */
56
+ function _new(): unknown;
57
+ /**
58
+ * Remove a tile at a particular coordinate
59
+ *
60
+ * @param tiles - unbounded 2d grid of tiles
61
+ * @param x - x coordinate of a tile
62
+ * @param y - y coordinate of a tile
63
+ * @returns unbounded 2d grid of tiles
64
+ */
65
+ export function remove(tiles: unknown, x: number, y: number): unknown;
66
+ /**
67
+ * Set a tile at a particular coordinate
68
+ *
69
+ * @param tiles - unbounded 2d grid of tiles
70
+ * @param x - x coordinate of a tile
71
+ * @param y - y coordinate of a tile
72
+ * @param tile_or_info - Either 1-indexed tile index of a tilemap's tilesource or full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ 1-based; passed to Defold unchanged.** **⚠️ `index` is 1-based; passed to Defold unchanged.**
73
+ * @returns unbounded 2d grid of tiles
74
+ */
75
+ export function set(tiles: unknown, x: number, y: number, tile_or_info: number | Record<string | number, unknown>): unknown;
76
+ export { _new as new };
77
+ }
78
+ }
79
+
80
+ export {};
@@ -0,0 +1,10 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace zip {
7
+ }
8
+ }
9
+
10
+ export {};
@@ -0,0 +1,24 @@
1
+ /** @noSelfInFile */
2
+ declare global {
3
+ /**
4
+ * Editor scripting documentation
5
+ */
6
+ namespace zlib {
7
+ /**
8
+ * Deflate (compress) a buffer
9
+ *
10
+ * @param buf - buffer to deflate
11
+ * @returns deflated buffer
12
+ */
13
+ function deflate(buf: string): string;
14
+ /**
15
+ * Inflate (decompress) a buffer
16
+ *
17
+ * @param buf - buffer to inflate
18
+ * @returns inflated buffer
19
+ */
20
+ function inflate(buf: string): string;
21
+ }
22
+ }
23
+
24
+ export {};