@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,1190 @@
1
+ /** @noSelfInFile */
2
+ import type { Hash, Matrix4, Opaque, Url, Vector4 } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Rendering API documentation
7
+ */
8
+ namespace render {
9
+ type constant_buffer = Opaque<"constant_buffer"> & { [name: string]: Vector4 | Matrix4 | Vector4[] | Matrix4[] };
10
+ type render_target = Opaque<"render_target">;
11
+ type texture = Opaque<"texture">;
12
+ type ClearBufferKey = typeof graphics.BUFFER_TYPE_COLOR0_BIT | typeof graphics.BUFFER_TYPE_DEPTH_BIT | typeof graphics.BUFFER_TYPE_STENCIL_BIT;
13
+ /**
14
+ * The rendering context was lost. Rendering is paused and all graphics resources become invalid. Passed to the `render.set_listener` callback.
15
+ */
16
+ const CONTEXT_EVENT_CONTEXT_LOST: number & { readonly __brand: "render.CONTEXT_EVENT_CONTEXT_LOST" };
17
+ /**
18
+ * The rendering context was restored. Rendering is still paused and graphics resources are still invalid, but can be reloaded. Passed to the `render.set_listener` callback.
19
+ */
20
+ const CONTEXT_EVENT_CONTEXT_RESTORED: number & { readonly __brand: "render.CONTEXT_EVENT_CONTEXT_RESTORED" };
21
+ const FRUSTUM_PLANES_ALL: number & { readonly __brand: "render.FRUSTUM_PLANES_ALL" };
22
+ const FRUSTUM_PLANES_SIDES: number & { readonly __brand: "render.FRUSTUM_PLANES_SIDES" };
23
+ const RENDER_TARGET_DEFAULT: undefined;
24
+ /**
25
+ * Depth sort far-to-near (default; good for transparent passes).
26
+ */
27
+ const SORT_BACK_TO_FRONT: number & { readonly __brand: "render.SORT_BACK_TO_FRONT" };
28
+ /**
29
+ * Depth sort near-to-far (good for opaque passes to reduce overdraw).
30
+ */
31
+ const SORT_FRONT_TO_BACK: number & { readonly __brand: "render.SORT_FRONT_TO_BACK" };
32
+ /**
33
+ * No per-call sorting; draw entries in insertion order.
34
+ */
35
+ const SORT_NONE: number & { readonly __brand: "render.SORT_NONE" };
36
+ /**
37
+ * Render target buffer flag that samples a depth or stencil buffer as a texture, for `render.render_target`.
38
+ */
39
+ const TEXTURE_BIT: number & { readonly __brand: "render.TEXTURE_BIT" };
40
+ /**
41
+ * Clear buffers in the currently enabled render target with specified value. If the render target has been created with multiple
42
+ * color attachments, all buffers will be cleared with the same value.
43
+ *
44
+ * @param buffers - table with keys specifying which buffers to clear and values set to clear values. Available keys are:
45
+ *
46
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
47
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
48
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
49
+ * @example
50
+ * ```ts
51
+ * // Clear the color buffer and the depth buffer.
52
+ * const buffers = new LuaMap<render.ClearBufferKey, number | Vector4>();
53
+ * buffers.set(graphics.BUFFER_TYPE_COLOR0_BIT, vmath.vector4(0, 0, 0, 0));
54
+ * buffers.set(graphics.BUFFER_TYPE_DEPTH_BIT, 1);
55
+ * render.clear(buffers);
56
+ * ```
57
+ */
58
+ function clear(buffers: LuaMap<render.ClearBufferKey, number | Vector4>): void;
59
+ /**
60
+ * Constant buffers are used to set shader program variables and are optionally passed to the `render.draw()` function.
61
+ * The buffer's constant elements can be indexed like an ordinary Lua table, but you can't iterate over them with pairs() or ipairs().
62
+ *
63
+ * @returns new constant buffer
64
+ * @example
65
+ * Set a "tint" constant in a constant buffer in the render script:
66
+ * ```ts
67
+ * const constants = render.constant_buffer();
68
+ * constants.tint = vmath.vector4(1, 1, 1, 1);
69
+ * ```
70
+ * @example
71
+ * Then use the constant buffer when drawing a predicate:
72
+ * ```ts
73
+ * function draw_tinted(self: { my_pred: Opaque<"render_predicate"> }) {
74
+ * const constants = render.constant_buffer();
75
+ * constants.tint = vmath.vector4(1, 1, 1, 1);
76
+ * render.draw(self.my_pred, { constants });
77
+ * }
78
+ * ```
79
+ * @example
80
+ * The constant buffer also supports array values by specifying constants in a table:
81
+ * ```ts
82
+ * const constants = render.constant_buffer();
83
+ * constants.light_colors = [];
84
+ * constants.light_colors[0] = vmath.vector4(1, 0, 0, 1);
85
+ * constants.light_colors[1] = vmath.vector4(0, 1, 0, 1);
86
+ * constants.light_colors[2] = vmath.vector4(0, 0, 1, 1);
87
+ * ```
88
+ * @example
89
+ * You can also create the table by passing the vectors directly when creating the table:
90
+ * ```ts
91
+ * const constants = render.constant_buffer();
92
+ * constants.light_colors = [
93
+ * vmath.vector4(1, 0, 0, 1),
94
+ * vmath.vector4(0, 1, 0, 1),
95
+ * vmath.vector4(0, 0, 1, 1),
96
+ * ];
97
+ *
98
+ * // Add more constants to the array
99
+ * constants.light_colors[3] = vmath.vector4(1, 1, 1, 1);
100
+ * ```
101
+ */
102
+ function constant_buffer(): Opaque<"constant_buffer"> & { [name: string]: Vector4 | Matrix4 | Vector4[] | Matrix4[] };
103
+ /**
104
+ * Deletes a render target created by a render script.
105
+ * You cannot delete a render target resource.
106
+ *
107
+ * @param render_target - render target to delete
108
+ * @example
109
+ * ```ts
110
+ * export default defineRenderScript({
111
+ * init() {
112
+ * return { my_render_target: render.render_target("my_target", {}) };
113
+ * },
114
+ *
115
+ * final(self) {
116
+ * // How to delete a render target:
117
+ * render.delete_render_target(self.my_render_target);
118
+ * },
119
+ * });
120
+ * ```
121
+ */
122
+ function delete_render_target(render_target: Opaque<"render_target">): void;
123
+ /**
124
+ * If a material is currently enabled, disable it.
125
+ * The name of the material must be specified in the ".render" resource set
126
+ * in the "game.project" setting.
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * export default defineRenderScript({
131
+ * init() {
132
+ * return { my_pred: render.predicate([hash("my_tag")]) };
133
+ * },
134
+ *
135
+ * update(self, dt) {
136
+ * // Enable material named "glow", then draw my_pred with it.
137
+ * render.enable_material("glow");
138
+ * render.draw(self.my_pred);
139
+ * render.disable_material();
140
+ * },
141
+ * });
142
+ * ```
143
+ */
144
+ function disable_material(): void;
145
+ /**
146
+ * Disables a render state.
147
+ *
148
+ * @param state - state to disable
149
+ *
150
+ * - `graphics.STATE_DEPTH_TEST`
151
+ * - `graphics.STATE_STENCIL_TEST`
152
+ * - `graphics.STATE_BLEND`
153
+ * - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
154
+ * - `graphics.STATE_CULL_FACE`
155
+ * - `graphics.STATE_POLYGON_OFFSET_FILL`
156
+ * @example
157
+ * ```ts
158
+ * export default defineRenderScript({
159
+ * init() {
160
+ * return { tile_pred: render.predicate([hash("tile")]) };
161
+ * },
162
+ *
163
+ * update(self, dt) {
164
+ * // Disable face culling when drawing the tile predicate:
165
+ * render.disable_state(graphics.STATE_CULL_FACE);
166
+ * render.draw(self.tile_pred);
167
+ * },
168
+ * });
169
+ * ```
170
+ */
171
+ function disable_state(state: graphics.State): void;
172
+ /**
173
+ * Disables a texture that has previourly been enabled.
174
+ *
175
+ * @param binding - texture binding, either by texture unit, string or hash that should be disabled
176
+ * @example
177
+ * ```ts
178
+ * export default defineRenderScript({
179
+ * init() {
180
+ * const color_params = {
181
+ * format: graphics.TEXTURE_FORMAT_RGBA,
182
+ * width: render.get_window_width(),
183
+ * height: render.get_window_height(),
184
+ * };
185
+ * return {
186
+ * my_render_target: render.render_target({ [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params }),
187
+ * my_pred: render.predicate([hash("my_tag")]),
188
+ * };
189
+ * },
190
+ *
191
+ * update(self, dt) {
192
+ * render.enable_texture(0, self.my_render_target, graphics.BUFFER_TYPE_COLOR0_BIT);
193
+ * // draw a predicate with the render target available as texture 0 in the predicate
194
+ * // material shader.
195
+ * render.draw(self.my_pred);
196
+ * // done, disable the texture
197
+ * render.disable_texture(0);
198
+ * },
199
+ * });
200
+ * ```
201
+ */
202
+ function disable_texture(binding: Opaque<"texture"> | string | Hash | number): void;
203
+ /**
204
+ * Dispatches the currently enabled compute program. The dispatch call takes three arguments x,y,z which constitutes
205
+ * the 'global working group' of the compute dispatch. Together with the 'local working group' specified in the compute shader
206
+ * as a layout qualifier, these two sets of parameters forms the number of invocations the compute shader will execute.
207
+ * An optional constant buffer can be provided to override the default constants. If no constants buffer is provided, a default
208
+ * system constants buffer is used containing constants as defined in the compute program.
209
+ *
210
+ * @param x - global work group size X
211
+ * @param y - global work group size Y
212
+ * @param z - global work group size Z
213
+ * @param options - optional table with properties:
214
+ *
215
+ * `constants`
216
+ * constant_buffer optional constants to use while rendering
217
+ * @example
218
+ * ```ts
219
+ * export default defineRenderScript({
220
+ * init() {
221
+ * const color_params = {
222
+ * format: graphics.TEXTURE_FORMAT_RGBA,
223
+ * width: render.get_window_width(),
224
+ * height: render.get_window_height(),
225
+ * };
226
+ * return {
227
+ * backing_texture: resource.get_texture_info("/main/backing.texturec").handle,
228
+ * scene_rt: render.render_target({ [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params }),
229
+ * };
230
+ * },
231
+ *
232
+ * update(self, dt) {
233
+ * render.set_compute("bloom");
234
+ * render.enable_texture(0, self.backing_texture);
235
+ * render.enable_texture(1, self.scene_rt);
236
+ * render.dispatch_compute(128, 128, 1);
237
+ * render.set_compute();
238
+ * },
239
+ * });
240
+ * ```
241
+ * @example
242
+ * Dispatch a compute program with a constant buffer:
243
+ * ```ts
244
+ * const constants = render.constant_buffer();
245
+ * constants.tint = vmath.vector4(1, 1, 1, 1);
246
+ * render.dispatch_compute(32, 32, 32, { constants });
247
+ * ```
248
+ */
249
+ function dispatch_compute(x: number, y: number, z: number, options?: { constants?: Opaque<"constant_buffer"> & { [name: string]: Vector4 | Matrix4 | Vector4[] | Matrix4[] } }): void;
250
+ /**
251
+ * Draws all objects that match a specified predicate. An optional constant buffer can be
252
+ * provided to override the default constants. If no constants buffer is provided, a default
253
+ * system constants buffer is used containing constants as defined in materials and set through
254
+ * go.set (or particlefx.set_constant) on visual components.
255
+ *
256
+ * @param predicate - predicate to draw for
257
+ * @param options - optional table with properties:
258
+ *
259
+ * `frustum`
260
+ * matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). default=nil
261
+ * `frustum_planes`
262
+ * int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
263
+ *
264
+ * - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
265
+ * - render.FRUSTUM_PLANES_ALL : All 6 sides of the frustum.
266
+ *
267
+ * `constants`
268
+ * constant_buffer optional constants to use while rendering
269
+ * `sort_order`
270
+ * int How to sort draw order for world-ordered entries. Default uses the renderer's preferred world sorting (back-to-front).
271
+ * @example
272
+ * ```ts
273
+ * export default defineRenderScript({
274
+ * init() {
275
+ * // define a predicate matching anything with material tag "my_tag"
276
+ * return { my_pred: render.predicate([hash("my_tag")]) };
277
+ * },
278
+ *
279
+ * update(self, dt) {
280
+ * // draw everything in the my_pred predicate
281
+ * render.draw(self.my_pred);
282
+ * },
283
+ * });
284
+ * ```
285
+ * @example
286
+ * Draw predicate with constants:
287
+ * ```ts
288
+ * function draw_tinted(self: { my_pred: Opaque<"render_predicate"> }) {
289
+ * const constants = render.constant_buffer();
290
+ * constants.tint = vmath.vector4(1, 1, 1, 1);
291
+ * render.draw(self.my_pred, { constants });
292
+ * }
293
+ * ```
294
+ * @example
295
+ * Draw with predicate and frustum culling (without near+far planes):
296
+ * ```ts
297
+ * function draw_culled(self: { my_pred: Opaque<"render_predicate">; proj: Matrix4; view: Matrix4 }) {
298
+ * const frustum = self.proj.mul(self.view);
299
+ * render.draw(self.my_pred, { frustum });
300
+ * }
301
+ * ```
302
+ * @example
303
+ * Draw with predicate and frustum culling (with near+far planes):
304
+ * ```ts
305
+ * function draw_culled(self: { my_pred: Opaque<"render_predicate">; proj: Matrix4; view: Matrix4 }) {
306
+ * const frustum = self.proj.mul(self.view);
307
+ * render.draw(self.my_pred, { frustum, frustum_planes: render.FRUSTUM_PLANES_ALL });
308
+ * }
309
+ * ```
310
+ */
311
+ function draw(predicate: Opaque<"render_predicate">, options?: { frustum?: Matrix4; frustum_planes?: number; constants?: Opaque<"constant_buffer"> & { [name: string]: Vector4 | Matrix4 | Vector4[] | Matrix4[] }; sort_order?: number }): void;
312
+ /**
313
+ * Draws all 3d debug graphics such as lines drawn with "draw_line" messages and physics visualization.
314
+ *
315
+ * @param options - optional table with properties:
316
+ *
317
+ * `frustum`
318
+ * matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
319
+ * `frustum_planes`
320
+ * int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
321
+ *
322
+ * - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
323
+ * - render.FRUSTUM_PLANES_ALL : All sides of the frustum.
324
+ * @example
325
+ * ```ts
326
+ * export default defineRenderScript({
327
+ * update(self, dt) {
328
+ * // draw debug visualization
329
+ * render.draw_debug3d();
330
+ * },
331
+ * });
332
+ * ```
333
+ */
334
+ function draw_debug3d(options?: { frustum?: Matrix4; frustum_planes?: number }): void;
335
+ /**
336
+ * If another material was already enabled, it will be automatically disabled
337
+ * and the specified material is used instead.
338
+ * The name of the material must be specified in the ".render" resource set
339
+ * in the "game.project" setting.
340
+ *
341
+ * @param material_id - material id to enable
342
+ * @example
343
+ * ```ts
344
+ * export default defineRenderScript({
345
+ * init() {
346
+ * return { my_pred: render.predicate([hash("my_tag")]) };
347
+ * },
348
+ *
349
+ * update(self, dt) {
350
+ * // Enable material named "glow", then draw my_pred with it.
351
+ * render.enable_material("glow");
352
+ * render.draw(self.my_pred);
353
+ * render.disable_material();
354
+ * },
355
+ * });
356
+ * ```
357
+ */
358
+ function enable_material(material_id: string | Hash): void;
359
+ /**
360
+ * Enables a particular render state. The state will be enabled until disabled.
361
+ *
362
+ * @param state - state to enable
363
+ *
364
+ * - `graphics.STATE_DEPTH_TEST`
365
+ * - `graphics.STATE_STENCIL_TEST`
366
+ * - `graphics.STATE_BLEND`
367
+ * - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
368
+ * - `graphics.STATE_CULL_FACE`
369
+ * - `graphics.STATE_POLYGON_OFFSET_FILL`
370
+ * @example
371
+ * ```ts
372
+ * export default defineRenderScript({
373
+ * init() {
374
+ * return { gui_pred: render.predicate([hash("gui")]) };
375
+ * },
376
+ *
377
+ * update(self, dt) {
378
+ * // Enable stencil test when drawing the gui predicate, then disable it:
379
+ * render.enable_state(graphics.STATE_STENCIL_TEST);
380
+ * render.draw(self.gui_pred);
381
+ * render.disable_state(graphics.STATE_STENCIL_TEST);
382
+ * },
383
+ * });
384
+ * ```
385
+ */
386
+ function enable_state(state: graphics.State): void;
387
+ /**
388
+ * Sets the specified texture handle for a render target attachment or a regular texture
389
+ * that should be used for rendering. The texture can be bound to either a texture unit
390
+ * or to a sampler name by a hash or a string.
391
+ * A texture can be bound to multiple units and sampler names at the same time,
392
+ * the actual binding will be applied to the shaders when a shader program is bound.
393
+ * When mixing binding using both units and sampler names, you might end up in situations
394
+ * where two different textures will be applied to the same bind location in the shader.
395
+ * In this case, the texture set to the named sampler will take precedence over the unit.
396
+ * Note that you can bind multiple sampler names to the same texture, in case you want to reuse
397
+ * the same texture for differnt use-cases. It is however recommended that you use the same name
398
+ * everywhere for the textures that should be shared across different materials.
399
+ *
400
+ * @param binding - texture binding, either by texture unit, string or hash for the sampler name that the texture should be bound to
401
+ * @param handle_or_name - render target or texture handle that should be bound, or a named resource in the "Render Resource" table in the currently assigned .render file
402
+ * @param buffer_type - optional buffer type from which to enable the texture. Note that this argument only applies to render targets. Defaults to `graphics.BUFFER_TYPE_COLOR0_BIT`. These values are supported:
403
+ *
404
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
405
+ *
406
+ * If The render target has been created as depth and/or stencil textures, these buffer types can be used:
407
+ *
408
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
409
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
410
+ *
411
+ * If the render target has been created with multiple color attachments, these buffer types can be used
412
+ * to enable those textures as well. Currently 4 color attachments are supported:
413
+ *
414
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
415
+ * - `graphics.BUFFER_TYPE_COLOR1_BIT`
416
+ * - `graphics.BUFFER_TYPE_COLOR2_BIT`
417
+ * - `graphics.BUFFER_TYPE_COLOR3_BIT`
418
+ * @example
419
+ * ```ts
420
+ * export default defineRenderScript({
421
+ * init() {
422
+ * const color_params = {
423
+ * format: graphics.TEXTURE_FORMAT_RGBA,
424
+ * width: render.get_window_width(),
425
+ * height: render.get_window_height(),
426
+ * };
427
+ * return {
428
+ * my_render_target: render.render_target({ [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params }),
429
+ * my_pred: render.predicate([hash("my_tag")]),
430
+ * };
431
+ * },
432
+ *
433
+ * update(self, dt) {
434
+ * // enable target so all drawing is done to it
435
+ * render.set_render_target(self.my_render_target);
436
+ *
437
+ * // draw a predicate to the render target
438
+ * render.draw(self.my_pred);
439
+ *
440
+ * // disable target
441
+ * render.set_render_target(render.RENDER_TARGET_DEFAULT);
442
+ *
443
+ * render.enable_texture(0, self.my_render_target, graphics.BUFFER_TYPE_COLOR0_BIT);
444
+ * // draw a predicate with the render target available as texture 0 in the predicate
445
+ * // material shader.
446
+ * render.draw(self.my_pred);
447
+ * },
448
+ * });
449
+ * ```
450
+ * @example
451
+ * ```ts
452
+ * // Or enable a render target by resource id:
453
+ * export default defineRenderScript({
454
+ * init() {
455
+ * return { my_pred: render.predicate([hash("my_tag")]) };
456
+ * },
457
+ *
458
+ * update(self, dt) {
459
+ * render.set_render_target("my_rt_resource");
460
+ * render.draw(self.my_pred);
461
+ * render.set_render_target(render.RENDER_TARGET_DEFAULT);
462
+ *
463
+ * render.enable_texture(0, "my_rt_resource", graphics.BUFFER_TYPE_COLOR0_BIT);
464
+ * // draw a predicate with the render target available as texture 0 in the predicate
465
+ * // material shader.
466
+ * render.draw(self.my_pred);
467
+ * },
468
+ * });
469
+ * ```
470
+ * @example
471
+ * ```ts
472
+ * // Or bind a texture handle directly:
473
+ * export default defineRenderScript({
474
+ * init() {
475
+ * return { my_texture_handle: resource.get_texture_info("/main/my_texture.texturec").handle };
476
+ * },
477
+ *
478
+ * update(self, dt) {
479
+ * // bind a texture to the texture unit 0
480
+ * render.enable_texture(0, self.my_texture_handle);
481
+ * // bind the same texture to a named sampler
482
+ * render.enable_texture("my_texture_sampler", self.my_texture_handle);
483
+ * },
484
+ * });
485
+ * ```
486
+ */
487
+ function enable_texture(binding: number | string | Hash, handle_or_name: Opaque<"texture"> | string | Hash | Opaque<"render_target"> | number, buffer_type?: graphics.BufferType): void;
488
+ /**
489
+ * Returns the logical window height that is set in the "game.project" settings.
490
+ * Note that the actual window pixel size can change, either by device constraints
491
+ * or user input.
492
+ *
493
+ * @returns specified window height
494
+ * @example
495
+ * ```ts
496
+ * // Get the height of the window
497
+ * const h = render.get_height();
498
+ * ```
499
+ */
500
+ function get_height(): number;
501
+ /**
502
+ * Returns the specified buffer height from a render target.
503
+ *
504
+ * @param render_target - render target from which to retrieve the buffer height
505
+ * @param buffer_type - which type of buffer to retrieve the height from
506
+ *
507
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
508
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
509
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
510
+ * @returns the height of the render target buffer texture
511
+ * @example
512
+ * ```ts
513
+ * export default defineRenderScript({
514
+ * init() {
515
+ * // render target buffer parameters
516
+ * const color_params = {
517
+ * format: graphics.TEXTURE_FORMAT_RGBA,
518
+ * width: render.get_window_width(),
519
+ * height: render.get_window_height(),
520
+ * min_filter: graphics.TEXTURE_FILTER_LINEAR,
521
+ * mag_filter: graphics.TEXTURE_FILTER_LINEAR,
522
+ * u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
523
+ * v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
524
+ * };
525
+ * return {
526
+ * target_right: render.render_target("right", {
527
+ * [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params,
528
+ * }),
529
+ * };
530
+ * },
531
+ *
532
+ * update(self, dt) {
533
+ * // get the height of the render target color buffer
534
+ * const h = render.get_render_target_height(self.target_right, graphics.BUFFER_TYPE_COLOR0_BIT);
535
+ * // get the height of a render target resource
536
+ * const w = render.get_render_target_height("my_rt_resource", graphics.BUFFER_TYPE_COLOR0_BIT);
537
+ * },
538
+ * });
539
+ * ```
540
+ */
541
+ function get_render_target_height(render_target: Opaque<"render_target"> | string | Hash, buffer_type: graphics.BufferType): number;
542
+ /**
543
+ * Returns the specified buffer width from a render target.
544
+ *
545
+ * @param render_target - render target from which to retrieve the buffer width
546
+ * @param buffer_type - which type of buffer to retrieve the width from
547
+ *
548
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
549
+ * - `graphics.BUFFER_TYPE_COLOR[x]_BIT` (x: [0..3], if supported!)
550
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
551
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
552
+ * @returns the width of the render target buffer texture
553
+ * @example
554
+ * ```ts
555
+ * export default defineRenderScript({
556
+ * init() {
557
+ * // render target buffer parameters
558
+ * const color_params = {
559
+ * format: graphics.TEXTURE_FORMAT_RGBA,
560
+ * width: render.get_window_width(),
561
+ * height: render.get_window_height(),
562
+ * min_filter: graphics.TEXTURE_FILTER_LINEAR,
563
+ * mag_filter: graphics.TEXTURE_FILTER_LINEAR,
564
+ * u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
565
+ * v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
566
+ * };
567
+ * return {
568
+ * target_right: render.render_target("right", {
569
+ * [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params,
570
+ * }),
571
+ * };
572
+ * },
573
+ *
574
+ * update(self, dt) {
575
+ * // get the width of the render target color buffer
576
+ * const w = render.get_render_target_width(self.target_right, graphics.BUFFER_TYPE_COLOR0_BIT);
577
+ * // get the width of a render target resource
578
+ * const w2 = render.get_render_target_width("my_rt_resource", graphics.BUFFER_TYPE_COLOR0_BIT);
579
+ * },
580
+ * });
581
+ * ```
582
+ */
583
+ function get_render_target_width(render_target: Opaque<"render_target"> | string | Hash, buffer_type: graphics.BufferType): number;
584
+ /**
585
+ * Returns the logical window width that is set in the "game.project" settings.
586
+ * Note that the actual window pixel size can change, either by device constraints
587
+ * or user input.
588
+ *
589
+ * @returns specified window width (number)
590
+ * @example
591
+ * ```ts
592
+ * // Get the width of the window.
593
+ * const w = render.get_width();
594
+ * ```
595
+ */
596
+ function get_width(): number;
597
+ /**
598
+ * Returns the actual physical window height.
599
+ * Note that this value might differ from the logical height that is set in the
600
+ * "game.project" settings.
601
+ *
602
+ * @returns actual window height
603
+ * @example
604
+ * ```ts
605
+ * // Get the actual height of the window
606
+ * const h = render.get_window_height();
607
+ * ```
608
+ */
609
+ function get_window_height(): number;
610
+ /**
611
+ * Returns the actual physical window width.
612
+ * Note that this value might differ from the logical width that is set in the
613
+ * "game.project" settings.
614
+ *
615
+ * @returns actual window width
616
+ * @example
617
+ * ```ts
618
+ * // Get the actual width of the window
619
+ * const w = render.get_window_width();
620
+ * ```
621
+ */
622
+ function get_window_width(): number;
623
+ /**
624
+ * This function returns a new render predicate for objects with materials matching
625
+ * the provided material tags. The provided tags are combined into a bit mask
626
+ * for the predicate. If multiple tags are provided, the predicate matches materials
627
+ * with all tags ANDed together.
628
+ * The current limit to the number of tags that can be defined is `64`.
629
+ *
630
+ * @param tags - table of tags that the predicate should match. The tags can be of either hash or string type
631
+ * @returns new predicate
632
+ * @example
633
+ * ```ts
634
+ * // Create a new render predicate containing all visual objects that
635
+ * // have a material with material tags "opaque" AND "smoke".
636
+ * const p = render.predicate([hash("opaque"), hash("smoke")]);
637
+ * ```
638
+ */
639
+ function predicate(tags: (string | Hash)[]): Opaque<"render_predicate">;
640
+ /**
641
+ * Sets the blend equation with separate equations for the color and alpha channels.
642
+ *
643
+ * @param equation_color - color blend equation
644
+ * @param equation_alpha - alpha blend equation
645
+ * @example
646
+ * ```ts
647
+ * render.set_blend_equation_separate(graphics.BLEND_EQUATION_ADD, graphics.BLEND_EQUATION_REVERSE_SUBTRACT);
648
+ * ```
649
+ */
650
+ function set_blend_equation_separate(equation_color: number, equation_alpha: number): void;
651
+ /**
652
+ * Specifies the arithmetic used when computing pixel values that are written to the frame
653
+ * buffer. In RGBA mode, pixels can be drawn using a function that blends the source RGBA
654
+ * pixel values with the destination pixel values already in the frame buffer.
655
+ * Blending is initially disabled.
656
+ * `source_factor` specifies which method is used to scale the source color components.
657
+ * `destination_factor` specifies which method is used to scale the destination color
658
+ * components.
659
+ * Source color components are referred to as (Rs,Gs,Bs,As).
660
+ * Destination color components are referred to as (Rd,Gd,Bd,Ad).
661
+ * The color specified by setting the blendcolor is referred to as (Rc,Gc,Bc,Ac).
662
+ * The source scale factor is referred to as (sR,sG,sB,sA).
663
+ * The destination scale factor is referred to as (dR,dG,dB,dA).
664
+ * The color values have integer values between 0 and (kR,kG,kB,kA), where kc = 2mc - 1 and mc is the number of bitplanes for that color. I.e for 8 bit color depth, color values are between `0` and `255`.
665
+ * Available factor constants and corresponding scale factors:
666
+ *
667
+ * Factor constant
668
+ * Scale factor (fR,fG,fB,fA)
669
+ *
670
+ * `graphics.BLEND_FACTOR_ZERO`
671
+ * (0,0,0,0)
672
+ *
673
+ * `graphics.BLEND_FACTOR_ONE`
674
+ * (1,1,1,1)
675
+ *
676
+ * `graphics.BLEND_FACTOR_SRC_COLOR`
677
+ * (Rs/kR,Gs/kG,Bs/kB,As/kA)
678
+ *
679
+ * `graphics.BLEND_FACTOR_ONE_MINUS_SRC_COLOR`
680
+ * (1,1,1,1) - (Rs/kR,Gs/kG,Bs/kB,As/kA)
681
+ *
682
+ * `graphics.BLEND_FACTOR_DST_COLOR`
683
+ * (Rd/kR,Gd/kG,Bd/kB,Ad/kA)
684
+ *
685
+ * `graphics.BLEND_FACTOR_ONE_MINUS_DST_COLOR`
686
+ * (1,1,1,1) - (Rd/kR,Gd/kG,Bd/kB,Ad/kA)
687
+ *
688
+ * `graphics.BLEND_FACTOR_SRC_ALPHA`
689
+ * (As/kA,As/kA,As/kA,As/kA)
690
+ *
691
+ * `graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA`
692
+ * (1,1,1,1) - (As/kA,As/kA,As/kA,As/kA)
693
+ *
694
+ * `graphics.BLEND_FACTOR_DST_ALPHA`
695
+ * (Ad/kA,Ad/kA,Ad/kA,Ad/kA)
696
+ *
697
+ * `graphics.BLEND_FACTOR_ONE_MINUS_DST_ALPHA`
698
+ * (1,1,1,1) - (Ad/kA,Ad/kA,Ad/kA,Ad/kA)
699
+ *
700
+ * `graphics.BLEND_FACTOR_CONSTANT_COLOR`
701
+ * (Rc,Gc,Bc,Ac)
702
+ *
703
+ * `graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR`
704
+ * (1,1,1,1) - (Rc,Gc,Bc,Ac)
705
+ *
706
+ * `graphics.BLEND_FACTOR_CONSTANT_ALPHA`
707
+ * (Ac,Ac,Ac,Ac)
708
+ *
709
+ * `graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA`
710
+ * (1,1,1,1) - (Ac,Ac,Ac,Ac)
711
+ *
712
+ * `graphics.BLEND_FACTOR_SRC_ALPHA_SATURATE`
713
+ * (i,i,i,1) where i = min(As, kA - Ad) /kA
714
+ *
715
+ * The blended RGBA values of a pixel comes from the following equations:
716
+ *
717
+ * - Rd = min(kR, Rs * sR + Rd * dR)
718
+ * - Gd = min(kG, Gs * sG + Gd * dG)
719
+ * - Bd = min(kB, Bs * sB + Bd * dB)
720
+ * - Ad = min(kA, As * sA + Ad * dA)
721
+ *
722
+ * Blend function `(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)` is useful for
723
+ * drawing with transparency when the drawn objects are sorted from farthest to nearest.
724
+ * It is also useful for drawing antialiased points and lines in arbitrary order.
725
+ *
726
+ * @param source_factor - source factor
727
+ * @param destination_factor - destination factor
728
+ * @example
729
+ * ```ts
730
+ * // Set the blend func to the most common one:
731
+ * render.set_blend_func(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA);
732
+ * ```
733
+ */
734
+ function set_blend_func(source_factor: number, destination_factor: number): void;
735
+ /**
736
+ * Sets the blend function with separate blend factors for the color and alpha channels.
737
+ *
738
+ * @param source_factor_color - source color blend factor
739
+ * @param destination_factor_color - destination color blend factor
740
+ * @param source_factor_alpha - source alpha blend factor
741
+ * @param destination_factor_alpha - destination alpha blend factor
742
+ * @example
743
+ * ```ts
744
+ * render.set_blend_func_separate(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, graphics.BLEND_FACTOR_ONE, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA);
745
+ * ```
746
+ */
747
+ function set_blend_func_separate(source_factor_color: number, destination_factor_color: number, source_factor_alpha: number, destination_factor_alpha: number): void;
748
+ /**
749
+ * Sets the current render camera to be used for rendering. If a render camera
750
+ * has been set by the render script, the renderer will be using its projection and view matrix
751
+ * during rendering. If a projection and/or view matrix has been set by the render script,
752
+ * they will not be used until the current render camera has been reset by calling `render.set_camera()`.
753
+ * If the 'use_frustum' flag in the options table has been set to true, the renderer will automatically use the
754
+ * camera frustum for frustum culling regardless of what frustum is being passed into the render.draw() function.
755
+ * Note that the frustum plane option in render.draw can still be used together with the camera.
756
+ *
757
+ * @param camera - camera id to use, or nil to reset
758
+ * @param options - optional table with properties:
759
+ *
760
+ * `use_frustum`
761
+ * boolean If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)
762
+ * @example
763
+ * Set the current camera to be used for rendering
764
+ * ```ts
765
+ * function draw_through_camera(self: { my_pred: Opaque<"render_predicate"> }) {
766
+ * render.set_camera("main:/my_go#camera");
767
+ * render.draw(self.my_pred);
768
+ * render.set_camera(undefined);
769
+ * }
770
+ * ```
771
+ * @example
772
+ * Use the camera frustum for frustum culling together with a specific frustum plane option for the draw command
773
+ * ```ts
774
+ * function draw_through_camera(self: { my_pred: Opaque<"render_predicate"> }) {
775
+ * // The camera frustum will take precedence over the frustum plane option in render.draw
776
+ * render.set_camera("main:/my_go#camera", { use_frustum: true });
777
+ * // However, we can still customize the frustum planes regardless of the camera option!
778
+ * render.draw(self.my_pred, { frustum_planes: render.FRUSTUM_PLANES_ALL });
779
+ * render.set_camera();
780
+ * }
781
+ * ```
782
+ */
783
+ function set_camera(camera?: Url | number | string | Hash, options?: { use_frustum?: boolean }): void;
784
+ /**
785
+ * Specifies whether the individual color components in the frame buffer is enabled for writing (`true`) or disabled (`false`). For example, if `blue` is `false`, nothing is written to the blue component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Note that writing are either enabled or disabled for entire color components, not the individual bits of a component.
786
+ * The component masks are all initially `true`.
787
+ *
788
+ * @param red - red mask
789
+ * @param green - green mask
790
+ * @param blue - blue mask
791
+ * @param alpha - alpha mask
792
+ * @example
793
+ * ```ts
794
+ * // alpha cannot be written to frame buffer
795
+ * render.set_color_mask(true, true, true, false);
796
+ * ```
797
+ */
798
+ function set_color_mask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
799
+ /**
800
+ * The name of the compute program must be specified in the ".render" resource set
801
+ * in the "game.project" setting. If nil (or no arguments) are passed to this function,
802
+ * the current compute program will instead be disabled.
803
+ *
804
+ * @param compute - compute id to use, or nil to disable
805
+ * @example
806
+ * ```ts
807
+ * export default defineRenderScript({
808
+ * init() {
809
+ * return { backing_texture: "my_texture_resource" };
810
+ * },
811
+ *
812
+ * update(self, dt) {
813
+ * // Enable compute program named "fractals", then dispatch it.
814
+ * render.set_compute("fractals");
815
+ * render.enable_texture(0, self.backing_texture);
816
+ * render.dispatch_compute(128, 128, 1);
817
+ * render.set_compute();
818
+ * },
819
+ * });
820
+ * ```
821
+ */
822
+ function set_compute(compute?: string | Hash): void;
823
+ /**
824
+ * Specifies whether front- or back-facing polygons can be culled
825
+ * when polygon culling is enabled. Polygon culling is initially disabled.
826
+ * If mode is `graphics.FACE_TYPE_FRONT_AND_BACK`, no polygons are drawn, but other
827
+ * primitives such as points and lines are drawn. The initial value for
828
+ * `face_type` is `graphics.FACE_TYPE_BACK`.
829
+ *
830
+ * @param face_type - face type
831
+ *
832
+ * - `graphics.FACE_TYPE_FRONT`
833
+ * - `graphics.FACE_TYPE_BACK`
834
+ * - `graphics.FACE_TYPE_FRONT_AND_BACK`
835
+ * @example
836
+ * ```ts
837
+ * // How to enable polygon culling and set front face culling:
838
+ * render.enable_state(graphics.STATE_CULL_FACE);
839
+ * render.set_cull_face(graphics.FACE_TYPE_FRONT);
840
+ * ```
841
+ */
842
+ function set_cull_face(face_type: number): void;
843
+ /**
844
+ * Specifies the function that should be used to compare each incoming pixel
845
+ * depth value with the value present in the depth buffer.
846
+ * The comparison is performed only if depth testing is enabled and specifies
847
+ * the conditions under which a pixel will be drawn.
848
+ * Function constants:
849
+ *
850
+ * - `graphics.COMPARE_FUNC_NEVER` (never passes)
851
+ * - `graphics.COMPARE_FUNC_LESS` (passes if the incoming depth value is less than the stored value)
852
+ * - `graphics.COMPARE_FUNC_LEQUAL` (passes if the incoming depth value is less than or equal to the stored value)
853
+ * - `graphics.COMPARE_FUNC_GREATER` (passes if the incoming depth value is greater than the stored value)
854
+ * - `graphics.COMPARE_FUNC_GEQUAL` (passes if the incoming depth value is greater than or equal to the stored value)
855
+ * - `graphics.COMPARE_FUNC_EQUAL` (passes if the incoming depth value is equal to the stored value)
856
+ * - `graphics.COMPARE_FUNC_NOTEQUAL` (passes if the incoming depth value is not equal to the stored value)
857
+ * - `graphics.COMPARE_FUNC_ALWAYS` (always passes)
858
+ *
859
+ * The depth function is initially set to `graphics.COMPARE_FUNC_LESS`.
860
+ *
861
+ * @param func - depth test function, see the description for available values
862
+ * @example
863
+ * ```ts
864
+ * // Enable depth test and set the depth test function to "not equal".
865
+ * render.enable_state(graphics.STATE_DEPTH_TEST);
866
+ * render.set_depth_func(graphics.COMPARE_FUNC_NOTEQUAL);
867
+ * ```
868
+ */
869
+ function set_depth_func(func: number): void;
870
+ /**
871
+ * Specifies whether the depth buffer is enabled for writing. The supplied mask governs
872
+ * if depth buffer writing is enabled (`true`) or disabled (`false`).
873
+ * The mask is initially `true`.
874
+ *
875
+ * @param depth - depth mask
876
+ * @example
877
+ * ```ts
878
+ * // How to turn off writing to the depth buffer:
879
+ * render.set_depth_mask(false);
880
+ * ```
881
+ */
882
+ function set_depth_mask(depth: boolean): void;
883
+ /**
884
+ * Set or remove listener. Currenly only only two type of events can arrived:
885
+ * `render.CONTEXT_EVENT_CONTEXT_LOST` - when rendering context lost. Rending paused and all graphics resources become invalid.
886
+ * `render.CONTEXT_EVENT_CONTEXT_RESTORED` - when rendering context was restored. Rendering still paused and graphics resources still
887
+ * invalid but can be reloaded.
888
+ *
889
+ * @param callback - A callback that receives all render related events.
890
+ * Pass `nil` if want to remove listener.
891
+ *
892
+ * `self`
893
+ * object The render script
894
+ * `event_type`
895
+ * string Rendering event. Possible values: `render.CONTEXT_EVENT_CONTEXT_LOST`, `render.CONTEXT_EVENT_CONTEXT_RESTORED`
896
+ * @example
897
+ * ```ts
898
+ * // Set listener and handle render context events.
899
+ * // custom.render_script
900
+ * export default defineRenderScript({
901
+ * init() {
902
+ * render.set_listener((self, event_type) => {
903
+ * if (event_type === render.CONTEXT_EVENT_CONTEXT_LOST) {
904
+ * // Some stuff when rendering context is lost
905
+ * } else if (event_type === render.CONTEXT_EVENT_CONTEXT_RESTORED) {
906
+ * // Start reload resources, reload game, etc.
907
+ * }
908
+ * });
909
+ * },
910
+ * });
911
+ * ```
912
+ */
913
+ function set_listener(callback?: (self: unknown, event_type: unknown) => void): void;
914
+ /**
915
+ * Sets the scale and units used to calculate depth values.
916
+ * If `graphics.STATE_POLYGON_OFFSET_FILL` is enabled, each fragment's depth value
917
+ * is offset from its interpolated value (depending on the depth value of the
918
+ * appropriate vertices). Polygon offset can be used when drawing decals, rendering
919
+ * hidden-line images etc.
920
+ * `factor` specifies a scale factor that is used to create a variable depth
921
+ * offset for each polygon. The initial value is `0`.
922
+ * `units` is multiplied by an implementation-specific value to create a
923
+ * constant depth offset. The initial value is `0`.
924
+ * The value of the offset is computed as `factor` × `DZ` + `r` × `units`
925
+ * `DZ` is a measurement of the depth slope of the polygon which is the change in z (depth)
926
+ * values divided by the change in either x or y coordinates, as you traverse a polygon.
927
+ * The depth values are in window coordinates, clamped to the range [0, 1].
928
+ * `r` is the smallest value that is guaranteed to produce a resolvable difference.
929
+ * It's value is an implementation-specific constant.
930
+ * The offset is added before the depth test is performed and before the
931
+ * value is written into the depth buffer.
932
+ *
933
+ * @param factor - polygon offset factor
934
+ * @param units - polygon offset units
935
+ * @example
936
+ * ```ts
937
+ * render.enable_state(graphics.STATE_POLYGON_OFFSET_FILL);
938
+ * render.set_polygon_offset(1.0, 1.0);
939
+ * ```
940
+ */
941
+ function set_polygon_offset(factor: number, units: number): void;
942
+ /**
943
+ * Sets the projection matrix to use when rendering.
944
+ *
945
+ * @param matrix - projection matrix
946
+ * @example
947
+ * ```ts
948
+ * // How to set the projection to orthographic with world origo at lower left,
949
+ * // width and height as set in project settings and depth (z) between -1 and 1:
950
+ * render.set_projection(vmath.matrix4_orthographic(0, render.get_width(), 0, render.get_height(), -1, 1));
951
+ * ```
952
+ */
953
+ function set_projection(matrix: Matrix4): void;
954
+ /**
955
+ * Sets a render target. Subsequent draw operations will be to the
956
+ * render target until it is replaced by a subsequent call to set_render_target.
957
+ * This function supports render targets created by a render script, or a render target resource.
958
+ *
959
+ * @param render_target - render target to set. render.RENDER_TARGET_DEFAULT to set the default render target
960
+ * @param options - optional table with behaviour parameters
961
+ *
962
+ * `transient`
963
+ * table Transient frame buffer types are only valid while the render target is active, i.e becomes undefined when a new target is set by a subsequent call to set_render_target.
964
+ * Default is all non-transient. Be aware that some hardware uses a combined depth stencil buffer and when this is the case both are considered non-transient if exclusively selected!
965
+ * A buffer type defined that doesn't exist in the render target is silently ignored.
966
+ *
967
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
968
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
969
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
970
+ * @example
971
+ * How to set a render target and draw to it and then switch back to the default render target
972
+ * The render target defines the depth/stencil buffers as transient, when set_render_target is called the next time the buffers may be invalidated and allow for optimisations depending on driver support
973
+ * ```ts
974
+ * // How to set a render target and draw to it and then switch back to the default render target
975
+ * // The render target defines the depth/stencil buffers as transient, when set_render_target is called the next time the buffers may be invalidated and allow for optimisations depending on driver support
976
+ * export default defineRenderScript({
977
+ * init() {
978
+ * const color_params = {
979
+ * format: graphics.TEXTURE_FORMAT_RGBA,
980
+ * width: render.get_window_width(),
981
+ * height: render.get_window_height(),
982
+ * };
983
+ * return {
984
+ * my_render_target: render.render_target({ [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params }),
985
+ * my_pred: render.predicate([hash("my_tag")]),
986
+ * };
987
+ * },
988
+ *
989
+ * update(self, dt) {
990
+ * // set render target so all drawing is done to it
991
+ * render.set_render_target(self.my_render_target, {
992
+ * transient: [graphics.BUFFER_TYPE_DEPTH_BIT, graphics.BUFFER_TYPE_STENCIL_BIT],
993
+ * });
994
+ *
995
+ * // draw a predicate to the render target
996
+ * render.draw(self.my_pred);
997
+ *
998
+ * // set default render target. This also invalidates the depth and stencil buffers of the current target (self.my_render_target)
999
+ * // which can be an optimisation on some hardware
1000
+ * render.set_render_target(render.RENDER_TARGET_DEFAULT);
1001
+ * },
1002
+ * });
1003
+ * ```
1004
+ * @example
1005
+ * ```ts
1006
+ * // Or set the render target by a render target resource identifier:
1007
+ * export default defineRenderScript({
1008
+ * init() {
1009
+ * return { my_pred: render.predicate([hash("my_tag")]) };
1010
+ * },
1011
+ *
1012
+ * update(self, dt) {
1013
+ * render.set_render_target("my_rt_resource");
1014
+ *
1015
+ * // draw a predicate to the render target
1016
+ * render.draw(self.my_pred);
1017
+ *
1018
+ * // reset the render target to the default backbuffer
1019
+ * render.set_render_target(render.RENDER_TARGET_DEFAULT);
1020
+ * },
1021
+ * });
1022
+ * ```
1023
+ */
1024
+ function set_render_target(render_target?: Opaque<"render_target"> | string | Hash | typeof render.RENDER_TARGET_DEFAULT, options?: { transient?: graphics.BufferType[] }): void;
1025
+ /**
1026
+ * Sets the render target size for a render target created from
1027
+ * either a render script, or from a render target resource.
1028
+ *
1029
+ * @param render_target - render target to set size for
1030
+ * @param width - new render target width
1031
+ * @param height - new render target height
1032
+ * @example
1033
+ * ```ts
1034
+ * export default defineRenderScript({
1035
+ * init() {
1036
+ * return { my_render_target: render.render_target("my_target", {}) };
1037
+ * },
1038
+ *
1039
+ * update(self, dt) {
1040
+ * // Resize render targets to the current window size:
1041
+ * render.set_render_target_size(self.my_render_target, render.get_window_width(), render.get_window_height());
1042
+ * render.set_render_target_size("my_rt_resource", render.get_window_width(), render.get_window_height());
1043
+ * },
1044
+ * });
1045
+ * ```
1046
+ */
1047
+ function set_render_target_size(render_target: Opaque<"render_target"> | string | Hash, width: number, height: number): void;
1048
+ /**
1049
+ * Stenciling is similar to depth-buffering as it enables and disables drawing on a
1050
+ * per-pixel basis. First, GL drawing primitives are drawn into the stencil planes.
1051
+ * Second, geometry and images are rendered but using the stencil planes to mask out
1052
+ * where to draw.
1053
+ * The stencil test discards a pixel based on the outcome of a comparison between the
1054
+ * reference value `ref` and the corresponding value in the stencil buffer.
1055
+ * `func` specifies the comparison function. See the table below for values.
1056
+ * The initial value is `graphics.COMPARE_FUNC_ALWAYS`.
1057
+ * `ref` specifies the reference value for the stencil test. The value is clamped to
1058
+ * the range [0, 2n-1], where n is the number of bitplanes in the stencil buffer.
1059
+ * The initial value is `0`.
1060
+ * `mask` is ANDed with both the reference value and the stored stencil value when the test
1061
+ * is done. The initial value is all `1`'s.
1062
+ * Function constant:
1063
+ *
1064
+ * - `graphics.COMPARE_FUNC_NEVER` (never passes)
1065
+ * - `graphics.COMPARE_FUNC_LESS` (passes if (ref & mask) < (stencil & mask))
1066
+ * - `graphics.COMPARE_FUNC_LEQUAL` (passes if (ref & mask) <= (stencil & mask))
1067
+ * - `graphics.COMPARE_FUNC_GREATER` (passes if (ref & mask) > (stencil & mask))
1068
+ * - `graphics.COMPARE_FUNC_GEQUAL` (passes if (ref & mask) >= (stencil & mask))
1069
+ * - `graphics.COMPARE_FUNC_EQUAL` (passes if (ref & mask) = (stencil & mask))
1070
+ * - `graphics.COMPARE_FUNC_NOTEQUAL` (passes if (ref & mask) != (stencil & mask))
1071
+ * - `graphics.COMPARE_FUNC_ALWAYS` (always passes)
1072
+ *
1073
+ * @param func - stencil test function, see the description for available values
1074
+ * @param ref - reference value for the stencil test
1075
+ * @param mask - mask that is ANDed with both the reference value and the stored stencil value when the test is done
1076
+ * @example
1077
+ * ```ts
1078
+ * // let only 0's pass the stencil test
1079
+ * render.set_stencil_func(graphics.COMPARE_FUNC_EQUAL, 0, 1);
1080
+ * ```
1081
+ */
1082
+ function set_stencil_func(func: number, ref: number, mask: number): void;
1083
+ /**
1084
+ * The stencil mask controls the writing of individual bits in the stencil buffer.
1085
+ * The least significant `n` bits of the parameter `mask`, where `n` is the number of
1086
+ * bits in the stencil buffer, specify the mask.
1087
+ * Where a `1` bit appears in the mask, the corresponding
1088
+ * bit in the stencil buffer can be written. Where a `0` bit appears in the mask,
1089
+ * the corresponding bit in the stencil buffer is never written.
1090
+ * The mask is initially all `1`'s.
1091
+ *
1092
+ * @param mask - stencil mask
1093
+ * @example
1094
+ * ```ts
1095
+ * // set the stencil mask to all 1:s
1096
+ * render.set_stencil_mask(0xff);
1097
+ * ```
1098
+ */
1099
+ function set_stencil_mask(mask: number): void;
1100
+ /**
1101
+ * The stencil test discards a pixel based on the outcome of a comparison between the
1102
+ * reference value `ref` and the corresponding value in the stencil buffer.
1103
+ * To control the test, call render.set_stencil_func.
1104
+ * This function takes three arguments that control what happens to the stored stencil
1105
+ * value while stenciling is enabled. If the stencil test fails, no change is made to the
1106
+ * pixel's color or depth buffers, and `sfail` specifies what happens to the stencil buffer
1107
+ * contents.
1108
+ * Operator constants:
1109
+ *
1110
+ * - `graphics.STENCIL_OP_KEEP` (keeps the current value)
1111
+ * - `graphics.STENCIL_OP_ZERO` (sets the stencil buffer value to 0)
1112
+ * - `graphics.STENCIL_OP_REPLACE` (sets the stencil buffer value to `ref`, as specified by render.set_stencil_func)
1113
+ * - `graphics.STENCIL_OP_INCR` (increments the stencil buffer value and clamp to the maximum representable unsigned value)
1114
+ * - `graphics.STENCIL_OP_INCR_WRAP` (increments the stencil buffer value and wrap to zero when incrementing the maximum representable unsigned value)
1115
+ * - `graphics.STENCIL_OP_DECR` (decrements the current stencil buffer value and clamp to 0)
1116
+ * - `graphics.STENCIL_OP_DECR_WRAP` (decrements the current stencil buffer value and wrap to the maximum representable unsigned value when decrementing zero)
1117
+ * - `graphics.STENCIL_OP_INVERT` (bitwise inverts the current stencil buffer value)
1118
+ *
1119
+ * `dppass` and `dpfail` specify the stencil buffer actions depending on whether subsequent
1120
+ * depth buffer tests succeed (dppass) or fail (dpfail).
1121
+ * The initial value for all operators is `graphics.STENCIL_OP_KEEP`.
1122
+ *
1123
+ * @param sfail - action to take when the stencil test fails
1124
+ * @param dpfail - the stencil action when the stencil test passes
1125
+ * @param dppass - the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled
1126
+ * @example
1127
+ * ```ts
1128
+ * // Set the stencil function to never pass and operator to always draw 1's
1129
+ * // on test fail.
1130
+ * render.set_stencil_func(graphics.COMPARE_FUNC_NEVER, 1, 0xFF);
1131
+ * // always draw 1's on test fail
1132
+ * render.set_stencil_op(graphics.STENCIL_OP_REPLACE, graphics.STENCIL_OP_KEEP, graphics.STENCIL_OP_KEEP);
1133
+ * ```
1134
+ */
1135
+ function set_stencil_op(sfail: number, dpfail: number, dppass: number): void;
1136
+ /**
1137
+ * Sets the view matrix to use when rendering.
1138
+ *
1139
+ * @param matrix - view matrix to set
1140
+ * @example
1141
+ * ```ts
1142
+ * // How to set the view and projection matrices according to
1143
+ * // the values supplied by a camera.
1144
+ * export default defineRenderScript({
1145
+ * init() {
1146
+ * return {
1147
+ * view: vmath.matrix4(),
1148
+ * projection: vmath.matrix4(),
1149
+ * };
1150
+ * },
1151
+ *
1152
+ * update(self, dt) {
1153
+ * // set the view to the stored view value
1154
+ * render.set_view(self.view);
1155
+ * // now we can draw with this view
1156
+ * },
1157
+ *
1158
+ * on_message(self, message_id, message) {
1159
+ * if (
1160
+ * message_id === hash("set_view_projection") &&
1161
+ * types.is_matrix4(message.view) &&
1162
+ * types.is_matrix4(message.projection)
1163
+ * ) {
1164
+ * // camera view and projection arrives here.
1165
+ * self.view = message.view;
1166
+ * self.projection = message.projection;
1167
+ * }
1168
+ * },
1169
+ * });
1170
+ * ```
1171
+ */
1172
+ function set_view(matrix: Matrix4): void;
1173
+ /**
1174
+ * Set the render viewport to the specified rectangle.
1175
+ *
1176
+ * @param x - left corner
1177
+ * @param y - bottom corner
1178
+ * @param width - viewport width
1179
+ * @param height - viewport height
1180
+ * @example
1181
+ * ```ts
1182
+ * // Set the viewport to the window dimensions.
1183
+ * render.set_viewport(0, 0, render.get_window_width(), render.get_window_height());
1184
+ * ```
1185
+ */
1186
+ function set_viewport(x: number, y: number, width: number, height: number): void;
1187
+ }
1188
+ }
1189
+
1190
+ export {};