@defold-typescript/types 0.40.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 (224) hide show
  1. package/api-availability.json +3963 -772
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18069 -10240
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +560 -89
  6. package/fixtures/messages_doc.json +96 -0
  7. package/generated/b2d.d.ts +680 -4
  8. package/generated/b2d_body.d.ts +29 -103
  9. package/generated/b2d_chain.d.ts +5 -6
  10. package/generated/b2d_fixture.d.ts +34 -38
  11. package/generated/b2d_joint.d.ts +503 -25
  12. package/generated/b2d_shape.d.ts +183 -20
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +16 -15
  15. package/generated/builtin-messages.d.ts +7 -1
  16. package/generated/bullet3d.d.ts +91 -0
  17. package/generated/bullet3d_collision_object.d.ts +433 -0
  18. package/generated/bullet3d_constraint.d.ts +818 -0
  19. package/generated/bullet3d_rigid_body.d.ts +429 -0
  20. package/generated/bullet3d_shape.d.ts +123 -0
  21. package/generated/bullet3d_world.d.ts +492 -0
  22. package/generated/camera.d.ts +29 -32
  23. package/generated/collectionfactory.d.ts +15 -18
  24. package/generated/collectionproxy.d.ts +22 -6
  25. package/generated/compute.d.ts +12 -238
  26. package/generated/crash.d.ts +24 -10
  27. package/generated/editor-vm/http.d.ts +90 -7
  28. package/generated/editor-vm/image.d.ts +7 -7
  29. package/generated/editor-vm/json.d.ts +11 -0
  30. package/generated/editor-vm/localization.d.ts +7 -7
  31. package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
  32. package/generated/editor-vm/zip.d.ts +28 -0
  33. package/generated/editor.d.ts +1496 -430
  34. package/generated/factory.d.ts +21 -25
  35. package/generated/font.d.ts +64 -22
  36. package/generated/go.d.ts +235 -182
  37. package/generated/graphics.d.ts +335 -97
  38. package/generated/gui.d.ts +240 -471
  39. package/generated/html5.d.ts +2 -2
  40. package/generated/http.d.ts +28 -35
  41. package/generated/image.d.ts +105 -72
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +7 -0
  44. package/generated/kinds/render-script.d.ts +7 -0
  45. package/generated/kinds/script.d.ts +7 -0
  46. package/generated/label.d.ts +77 -7
  47. package/generated/liveupdate.d.ts +13 -10
  48. package/generated/material.d.ts +312 -360
  49. package/generated/model.d.ts +40 -39
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +365 -133
  52. package/generated/profiler.d.ts +13 -23
  53. package/generated/render.d.ts +237 -297
  54. package/generated/resource.d.ts +664 -583
  55. package/generated/socket.d.ts +120 -133
  56. package/generated/sound.d.ts +62 -31
  57. package/generated/sprite.d.ts +31 -17
  58. package/generated/sys.d.ts +234 -190
  59. package/generated/tilemap.d.ts +21 -16
  60. package/generated/timer.d.ts +34 -21
  61. package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
  62. package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
  63. package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
  65. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
  68. package/generated/versions/defold-1.12.4/go.d.ts +6 -12
  69. package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
  70. package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/http.d.ts +0 -13
  72. package/generated/versions/defold-1.12.4/image.d.ts +16 -33
  73. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  74. package/generated/versions/defold-1.12.4/json.d.ts +10 -6
  75. package/generated/versions/defold-1.12.4/label.d.ts +2 -3
  76. package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
  77. package/generated/versions/defold-1.12.4/model.d.ts +2 -10
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
  81. package/generated/versions/defold-1.12.4/render.d.ts +99 -128
  82. package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
  83. package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
  84. package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
  86. package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
  87. package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
  88. package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
  89. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
  90. package/generated/versions/defold-1.12.4/window.d.ts +1 -16
  91. package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
  92. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
  93. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
  94. package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
  95. package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
  96. package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
  100. package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
  102. package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
  103. package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
  104. package/generated/versions/defold-1.13.0/go.d.ts +6 -12
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
  107. package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
  108. package/generated/versions/defold-1.13.0/http.d.ts +0 -13
  109. package/generated/versions/defold-1.13.0/image.d.ts +16 -33
  110. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  111. package/generated/versions/defold-1.13.0/json.d.ts +10 -6
  112. package/generated/versions/defold-1.13.0/label.d.ts +2 -3
  113. package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
  114. package/generated/versions/defold-1.13.0/material.d.ts +68 -106
  115. package/generated/versions/defold-1.13.0/model.d.ts +2 -10
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
  119. package/generated/versions/defold-1.13.0/render.d.ts +99 -128
  120. package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
  121. package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
  122. package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
  124. package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
  125. package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
  126. package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
  127. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
  128. package/generated/versions/defold-1.13.0/window.d.ts +1 -16
  129. package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
  130. package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
  131. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
  132. package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
  133. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
  134. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
  135. package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
  136. package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
  137. package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
  138. package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
  139. package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
  140. package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
  141. package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
  142. package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
  143. package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
  144. package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
  145. package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
  146. package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
  147. package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
  148. package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
  149. package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
  150. package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
  151. package/generated/versions/defold-1.13.1/font.d.ts +81 -0
  152. package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
  153. package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
  154. package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
  155. package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
  156. package/generated/versions/defold-1.13.1/http.d.ts +77 -0
  157. package/generated/versions/defold-1.13.1/image.d.ts +131 -0
  158. package/generated/versions/defold-1.13.1/index.d.ts +57 -0
  159. package/generated/versions/defold-1.13.1/json.d.ts +80 -0
  160. package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
  161. package/generated/versions/defold-1.13.1/label.d.ts +93 -0
  162. package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
  163. package/generated/versions/defold-1.13.1/material.d.ts +408 -0
  164. package/generated/versions/defold-1.13.1/model.d.ts +272 -0
  165. package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
  166. package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
  167. package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
  168. package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
  169. package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
  170. package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
  171. package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
  172. package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
  173. package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
  174. package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
  175. package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
  176. package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
  177. package/generated/versions/defold-1.13.1/types.d.ts +61 -0
  178. package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
  179. package/generated/versions/defold-1.13.1/window.d.ts +183 -0
  180. package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
  181. package/generated/vmath.d.ts +1 -21
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +7 -0
  185. package/package.json +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 +12 -2
  191. package/scripts/import-defold-release.ts +85 -24
  192. package/scripts/prose-constants.ts +77 -16
  193. package/scripts/regen.ts +391 -77
  194. package/scripts/shared-handle-methods.ts +53 -0
  195. package/scripts/signature-store-fs.ts +1 -0
  196. package/scripts/sync-api-docs.ts +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/core-types.ts +26 -3
  201. package/src/correction-pins.ts +49 -0
  202. package/src/doc-comment.ts +104 -11
  203. package/src/doc-corrections.ts +108 -0
  204. package/src/editor-vm-globals.d.ts +5 -2
  205. package/src/emit-dts.ts +2064 -281
  206. package/src/emit-messages.ts +52 -0
  207. package/src/example-store.ts +125 -14
  208. package/src/field-correction-coverage.ts +204 -0
  209. package/src/fnv1a.ts +16 -0
  210. package/src/go-overloads.d.ts +25 -6
  211. package/src/index-base-table.ts +145 -0
  212. package/src/index-slot-classifications.ts +588 -0
  213. package/src/index.ts +38 -5
  214. package/src/library-index-slot-classifications.ts +332 -0
  215. package/src/lifecycle.ts +61 -199
  216. package/src/luals-type-expr.ts +354 -0
  217. package/src/msg-overloads.d.ts +0 -1
  218. package/src/param-correction-provenance.ts +8 -11
  219. package/src/render-overloads.d.ts +0 -15
  220. package/src/return-correction-provenance.ts +58 -16
  221. package/src/sys-overloads.d.ts +48 -0
  222. package/src/vmath-overloads.d.ts +27 -1
  223. package/src/window-event-guard.d.ts +6 -9
  224. package/url-parameters.json +1 -2
@@ -0,0 +1,1121 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Editor scripting documentation
7
+ */
8
+ namespace editor {
9
+ /**
10
+ * A string, SHA1 of Defold editor
11
+ */
12
+ const editor_sha1: unknown;
13
+ /**
14
+ * A string, SHA1 of Defold engine
15
+ */
16
+ const engine_sha1: unknown;
17
+ /**
18
+ * Editor platform id.
19
+ * A `string`, either:
20
+ * - `"x86_64-win32"`
21
+ * - `"x86_64-macos"`
22
+ * - `"arm64-macos"`
23
+ * - `"x86_64-linux"`
24
+ */
25
+ const platform: "x86_64-win32" | "x86_64-macos" | "arm64-macos" | "x86_64-linux";
26
+ /**
27
+ * A string, version name of Defold
28
+ */
29
+ const version: unknown;
30
+ /**
31
+ * Run bob the builder program
32
+ * For the full documentation of the available commands and options, see the bob manual.
33
+ *
34
+ * @param options - table of command line options for bob, without the leading dashes (`--`). You can use snake_case instead of kebab-case for option keys. Only long option names are supported (i.e. `output`, not `o`). Supported value types are strings, integers and booleans. If an option takes no arguments, use a boolean (i.e. `true`). If an option may be repeated, you can use an array of values.
35
+ * @param commands - bob commands, e.g. `"resolve"` or `"build"`
36
+ * @example
37
+ * Print help in the console:
38
+ * ```ts
39
+ * editor.bob({ help: true });
40
+ * ```
41
+ * @example
42
+ * Bundle the game for the host platform:
43
+ * ```ts
44
+ * const opts = { archive: true, platform: editor.platform };
45
+ * editor.bob(opts, "distclean", "resolve", "build", "bundle");
46
+ * ```
47
+ * @example
48
+ * Using snake_cased and repeated options:
49
+ * ```ts
50
+ * const opts = {
51
+ * archive: true,
52
+ * platform: editor.platform,
53
+ * build_server: "https://build.my-company.com",
54
+ * settings: ["test.ini", "headless.ini"],
55
+ * };
56
+ * editor.bob(opts, "distclean", "resolve", "build");
57
+ * ```
58
+ */
59
+ function bob(options?: Record<string | number, unknown>, ...commands: string[]): void;
60
+ /**
61
+ * Open a URL in the default browser or a registered application
62
+ *
63
+ * @param url - http(s) or file URL
64
+ */
65
+ function browse(url: string): void;
66
+ /**
67
+ * Check whether this list property supports add, clear, and remove operations on the supplied node.
68
+ *
69
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
70
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
71
+ */
72
+ function can_add(node: string | Opaque<"userdata">, property: string): boolean;
73
+ /**
74
+ * Check whether this property is exposed for reading on the supplied node or resource.
75
+ *
76
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
77
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
78
+ */
79
+ function can_get(node: string | Opaque<"userdata">, property: string): boolean;
80
+ /**
81
+ * Check whether this list property supports reordering on the supplied node.
82
+ *
83
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
84
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
85
+ */
86
+ function can_reorder(node: string | Opaque<"userdata">, property: string): boolean;
87
+ /**
88
+ * Check whether this property supports reset on the supplied node.
89
+ *
90
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
91
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
92
+ */
93
+ function can_reset(node: string | Opaque<"userdata">, property: string): boolean;
94
+ /**
95
+ * Check whether this property is exposed for setting on the supplied node.
96
+ *
97
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
98
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
99
+ */
100
+ function can_set(node: string | Opaque<"userdata">, property: string): boolean;
101
+ /**
102
+ * Create a directory if it does not exist, and all non-existent parent directories.
103
+ * Throws an error if the directory can't be created.
104
+ *
105
+ * @param resource_path - Resource path (starting with `/`)
106
+ * @example
107
+ * ```ts
108
+ * editor.create_directory("/assets/gen");
109
+ * ```
110
+ */
111
+ function create_directory(resource_path: string): void;
112
+ /**
113
+ * Create resources (including non-existent parent directories).
114
+ * Throws an error if any of the provided resource paths already exist
115
+ *
116
+ * @param resources - ] Array of resource paths (strings starting with `/`) or resource definitions, lua tables with the following keys:`1 string`required, resource path (starting with `/`)`2 string`optional, created resource content
117
+ * @example
118
+ * Create a single resource from template:
119
+ * ```ts
120
+ * editor.create_resources(["/npc.go"]);
121
+ * ```
122
+ * @example
123
+ * Create multiple resources:
124
+ * ```ts
125
+ * editor.create_resources(["/npc.go", "/levels/1.collection", "/levels/2.collection"]);
126
+ * ```
127
+ * @example
128
+ * Create a resource with custom content:
129
+ * ```ts
130
+ * editor.create_resources([{ 1: "/npc.script", 2: "go.property('hp', 100)" }]);
131
+ * ```
132
+ */
133
+ function create_resources(resources: unknown): void;
134
+ /**
135
+ * Delete a directory if it exists, and all existent child directories and files.
136
+ * Throws an error if the directory can't be deleted.
137
+ *
138
+ * @param resource_path - Resource path (starting with `/`)
139
+ * @example
140
+ * ```ts
141
+ * editor.delete_directory("/assets/gen");
142
+ * ```
143
+ */
144
+ function delete_directory(resource_path: string): void;
145
+ /**
146
+ * Execute a shell command.
147
+ * Any shell command arguments should be provided as separate argument strings to this function. If the exit code of the process is not zero, this function throws error. By default, the function returns `nil`, but it can be configured to capture the output of the shell command as string and return it — set `out` option to `"capture"` to do it.
148
+ * By default, after this shell command is executed, the editor will reload resources from disk.
149
+ *
150
+ * @param command - Shell command name to execute
151
+ * @param args - Optional shell command arguments
152
+ * @param options - Optional options table. Supported entries:
153
+ * - boolean `reload_resources`: make the editor reload the resources from disk after the command is executed, default `true`
154
+ * - string `out`: standard output mode, either:
155
+ * - `"pipe"`: the output is piped to the editor console (this is the default behavior).
156
+ * - `"capture"`: capture and return the output to the editor script with trailing newlines trimmed.
157
+ * - `"discard"`: the output is discarded completely.
158
+ * - string `err`: standard error output mode, either:
159
+ * - `"pipe"`: the error output is piped to the editor console (this is the default behavior).
160
+ * - `"stdout"`: the error output is redirected to the standard output of the process.
161
+ * - `"discard"`: the error output is discarded completely.
162
+ * @returns If `out` option is set to `"capture"`, returns the output as string with trimmed trailing newlines. Otherwise, returns `nil`.
163
+ * @example
164
+ * Make a directory with spaces in it:
165
+ * ```ts
166
+ * editor.execute("mkdir", "new dir");
167
+ * ```
168
+ * @example
169
+ * Read the git status:
170
+ * ```ts
171
+ * const status = editor.execute("git", "status", "--porcelain", {
172
+ * reload_resources: false,
173
+ * out: "capture",
174
+ * });
175
+ * ```
176
+ */
177
+ function execute(command: string, ...args: (string | { reload_resources?: boolean; out?: string; err?: string })[]): undefined | string;
178
+ /**
179
+ * Query information about file system path
180
+ *
181
+ * @param path - External file path, resolved against project root if relative
182
+ * @returns A table with the following keys: `path string` resolved file path `exists boolean` whether there is a file system entry at the path `is_file boolean` whether the path corresponds to a file `is_directory boolean` whether the path corresponds to a directory
183
+ */
184
+ function external_file_attributes(path: string): Record<string | number, unknown>;
185
+ /**
186
+ * Download the latest version of the project library dependencies and reload library-provided editor scripts.
187
+ * This function may replace library-provided editor commands, hooks, routes, and UI contributed by editor scripts, so it should typically be the last operation performed by a command.
188
+ */
189
+ function fetch_libraries(): void;
190
+ /**
191
+ * Get a value of a node property inside the editor.
192
+ * Some properties might be read-only, and some might be unavailable in different contexts, so you should use `editor.can_get()` before reading them and `editor.can_set()` before making the editor set them.
193
+ *
194
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
195
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
196
+ * @returns property value
197
+ */
198
+ function get(node: string | Opaque<"userdata">, property: string): unknown;
199
+ /**
200
+ * Open a file in a registered application
201
+ *
202
+ * @param path - file path
203
+ */
204
+ function open_external_file(path: string): void;
205
+ /**
206
+ * List property names for a node.
207
+ * The result is context-sensitive and can vary by node/resource type and editor state. Returned names are readable with `editor.get(node, property)`. Mutating capabilities are per-property; use `editor.can_set()`, `editor.can_reset()`, `editor.can_add()`, and `editor.can_reorder()` to check which operations are supported.
208
+ *
209
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
210
+ * @returns ] sorted unique editor property names available in the current context
211
+ */
212
+ function properties(node: string | Opaque<"userdata">): unknown;
213
+ /**
214
+ * Query information about a project resource
215
+ *
216
+ * @param resource_path - Resource path (starting with `/`)
217
+ * @returns A table with the following keys:`exists boolean`whether a resource identified by the path exists in the project`is_file boolean`whether the resource represents a file with some content`is_directory boolean`whether the resource represents a directory
218
+ */
219
+ function resource_attributes(resource_path: string): Record<string | number, unknown>;
220
+ /**
221
+ * Persist any unsaved changes to disk
222
+ */
223
+ function save(): void;
224
+ /**
225
+ * Change the editor state in a single, undoable transaction
226
+ *
227
+ * @param txs - ] An array of transaction steps created using `editor.tx.*` functions
228
+ */
229
+ function transact(txs: Opaque<"transaction_step">[]): void;
230
+ namespace prefs {
231
+ /**
232
+ * Get preference value
233
+ * The schema for the preference value should be defined beforehand.
234
+ *
235
+ * @param key - dot-separated preference key path
236
+ * @returns current pref value or default if a schema for the key path exists, nil otherwise
237
+ */
238
+ function get(key: string): unknown;
239
+ /**
240
+ * Check if preference value is explicitly set
241
+ * The schema for the preference value should be defined beforehand.
242
+ *
243
+ * @param key - dot-separated preference key path
244
+ * @returns flag indicating if the value is explicitly set
245
+ */
246
+ function is_set(key: string): boolean;
247
+ /**
248
+ * Set preference value
249
+ * The schema for the preference value should be defined beforehand.
250
+ *
251
+ * @param key - dot-separated preference key path
252
+ * @param value - new pref value to set
253
+ */
254
+ function set(key: string, value: unknown): void;
255
+ namespace schema {
256
+ /**
257
+ * array schema
258
+ *
259
+ * @param opts - Required opts: `item schema`array item schema Optional opts: `default item[]`default value`scope string`preference scope; either:
260
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
261
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
262
+ * @returns Prefs schema
263
+ */
264
+ export function array(opts: Record<string | number, unknown>): unknown;
265
+ /**
266
+ * boolean schema
267
+ *
268
+ * @param opts - Optional opts: `default boolean`default value`scope string`preference scope; either:
269
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
270
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
271
+ * @returns Prefs schema
272
+ */
273
+ export function boolean(opts?: Record<string | number, unknown>): unknown;
274
+ /**
275
+ * enum value schema
276
+ *
277
+ * @param opts - Required opts: `values any[]`allowed values, must be scalar (nil, boolean, number or string) Optional opts: `default any`default value`scope string`preference scope; either:
278
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
279
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
280
+ * @returns Prefs schema
281
+ */
282
+ function _enum(opts: Record<string | number, unknown>): unknown;
283
+ /**
284
+ * integer schema
285
+ *
286
+ * @param opts - Optional opts: `default integer`default value`scope string`preference scope; either:
287
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
288
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
289
+ * @returns Prefs schema
290
+ */
291
+ export function integer(opts?: Record<string | number, unknown>): unknown;
292
+ /**
293
+ * keyword schema
294
+ * A keyword is a short string that is interned within the editor runtime, useful e.g. for identifiers
295
+ *
296
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
297
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
298
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
299
+ * @returns Prefs schema
300
+ */
301
+ export function keyword(opts?: Record<string | number, unknown>): unknown;
302
+ /**
303
+ * floating-point number schema
304
+ *
305
+ * @param opts - Optional opts: `default number`default value`scope string`preference scope; either:
306
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
307
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
308
+ * @returns Prefs schema
309
+ */
310
+ export function number(opts?: Record<string | number, unknown>): unknown;
311
+ /**
312
+ * heterogeneous object schema
313
+ *
314
+ * @param opts - Required opts: `properties table<string, schema>`a table from property key (string) to value schema Optional opts: `default table`default value`scope string`preference scope; either:
315
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
316
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
317
+ * @returns Prefs schema
318
+ */
319
+ export function object(opts: Record<string | number, unknown>): unknown;
320
+ /**
321
+ * homogeneous object schema
322
+ *
323
+ * @param opts - Required opts: `key schema`table key schema`val schema`table value schema Optional opts: `default table`default value`scope string`preference scope; either:
324
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
325
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
326
+ * @returns Prefs schema
327
+ */
328
+ export function object_of(opts: Record<string | number, unknown>): unknown;
329
+ /**
330
+ * one of schema
331
+ *
332
+ * @param opts - Required opts: `schemas schema[]`alternative schemas Optional opts: `default any`default value`scope string`preference scope; either:
333
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
334
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
335
+ * @returns Prefs schema
336
+ */
337
+ export function one_of(opts: Record<string | number, unknown>): unknown;
338
+ /**
339
+ * password schema
340
+ * A password is a string that is encrypted when stored in a preference file
341
+ *
342
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
343
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
344
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
345
+ * @returns Prefs schema
346
+ */
347
+ export function password(opts?: Record<string | number, unknown>): unknown;
348
+ /**
349
+ * set schema
350
+ * Set is represented as a lua table with `true` values
351
+ *
352
+ * @param opts - Required opts: `item schema`set item schema Optional opts: `default table<item, true>`default value`scope string`preference scope; either:
353
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
354
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
355
+ * @returns Prefs schema
356
+ */
357
+ export function set(opts: Record<string | number, unknown>): unknown;
358
+ /**
359
+ * string schema
360
+ *
361
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
362
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
363
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
364
+ * @returns Prefs schema
365
+ */
366
+ export function string(opts?: Record<string | number, unknown>): unknown;
367
+ /**
368
+ * tuple schema
369
+ * A tuple is a fixed-length array where each item has its own defined type
370
+ *
371
+ * @param opts - Required opts: `items schema[]`schemas for the items Optional opts: `default any[]`default value`scope string`preference scope; either:
372
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
373
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
374
+ * @returns Prefs schema
375
+ */
376
+ export function tuple(opts: Record<string | number, unknown>): unknown;
377
+ export { _enum as enum };
378
+ }
379
+ namespace SCOPE {
380
+ /**
381
+ * `"global"`
382
+ */
383
+ const GLOBAL: unknown;
384
+ /**
385
+ * `"project"`
386
+ */
387
+ const PROJECT: unknown;
388
+ }
389
+ }
390
+ namespace tx {
391
+ /**
392
+ * Create a transaction step that will add a child item to a node's list property when transacted with `editor.transact()`.
393
+ *
394
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
395
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
396
+ * @param value - Added item for the property, a table from property key to either a valid `editor.tx.set()`-able value, or an array of valid `editor.tx.add()`-able values
397
+ */
398
+ function add(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
399
+ /**
400
+ * Create a transaction step that will remove all items from node's list property when transacted with `editor.transact()`.
401
+ *
402
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
403
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
404
+ * @returns A transaction step
405
+ */
406
+ function clear(node: string | Opaque<"userdata">, property: string): Opaque<"transaction_step">;
407
+ /**
408
+ * Create a transaction step that will remove a child node from the node's list property when transacted with `editor.transact()`.
409
+ *
410
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
411
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
412
+ * @param child_node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
413
+ * @returns A transaction step
414
+ */
415
+ function remove(node: string | Opaque<"userdata">, property: string, child_node: string | Opaque<"userdata">): Opaque<"transaction_step">;
416
+ /**
417
+ * Create a transaction step that reorders child nodes in a node list defined by the property if supported (see `editor.can_reorder()`)
418
+ *
419
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
420
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
421
+ * @param child_nodes - array of child nodes (the same as returned by `editor.get(node, property)`) in new order
422
+ * @returns A transaction step
423
+ */
424
+ function reorder(node: string | Opaque<"userdata">, property: string, child_nodes: Record<string | number, unknown>): Opaque<"transaction_step">;
425
+ /**
426
+ * Create a transaction step that will reset an overridden property to its default value when transacted with `editor.transact()`.
427
+ *
428
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
429
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
430
+ * @returns A transaction step
431
+ */
432
+ function reset(node: string | Opaque<"userdata">, property: string): Opaque<"transaction_step">;
433
+ /**
434
+ * Create transaction step that will set the node's property to a supplied value when transacted with `editor.transact()`.
435
+ *
436
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
437
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
438
+ * @param value - A new value for the property
439
+ * @returns A transaction step
440
+ */
441
+ function set(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
442
+ }
443
+ namespace ui {
444
+ /**
445
+ * Button with a label and/or an icon
446
+ *
447
+ * @param props - Optional props: `on_pressed function`button press callback, will be invoked without arguments when the user presses the button`text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
448
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
449
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
450
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
451
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``icon string`predefined icon name; either:
452
+ * - `editor.ui.ICON.OPEN_RESOURCE`
453
+ * - `editor.ui.ICON.PLUS`
454
+ * - `editor.ui.ICON.MINUS`
455
+ * - `editor.ui.ICON.CLEAR``enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
456
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
457
+ * - `editor.ui.ALIGNMENT.TOP`
458
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
459
+ * - `editor.ui.ALIGNMENT.LEFT`
460
+ * - `editor.ui.ALIGNMENT.CENTER`
461
+ * - `editor.ui.ALIGNMENT.RIGHT`
462
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
463
+ * - `editor.ui.ALIGNMENT.BOTTOM`
464
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
465
+ * @returns UI component
466
+ */
467
+ function button(props: Record<string | number, unknown>): Opaque<"component">;
468
+ /**
469
+ * Check box with a label
470
+ *
471
+ * @param props - Optional props: `value boolean`determines if the checkbox should appear checked`on_value_changed function`change callback, will receive the new value`indeterminate boolean`determines if the checkbox should appear in the mixed state`text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
472
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
473
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
474
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
475
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
476
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
477
+ * - `editor.ui.ALIGNMENT.TOP`
478
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
479
+ * - `editor.ui.ALIGNMENT.LEFT`
480
+ * - `editor.ui.ALIGNMENT.CENTER`
481
+ * - `editor.ui.ALIGNMENT.RIGHT`
482
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
483
+ * - `editor.ui.ALIGNMENT.BOTTOM`
484
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
485
+ * @returns UI component
486
+ */
487
+ function check_box(props: Record<string | number, unknown>): Opaque<"component">;
488
+ /**
489
+ * Convert a function to a UI component.
490
+ * The wrapped function may call any hooks functions (`editor.ui.use_*`), but on any function invocation, the hooks calls must be the same, and in the same order. This means that hooks should not be used inside loops and conditions or after a conditional return statement.
491
+ * The following props are supported automatically:`grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
492
+ *
493
+ * @param fn - function, will receive a single table of props when called
494
+ * @returns decorated component function that may be invoked with a props table create component
495
+ */
496
+ function component(fn: (...args: unknown[]) => unknown): (...args: unknown[]) => unknown;
497
+ /**
498
+ * Dialog component, a top-level window component that can't be used as a child of other components
499
+ *
500
+ * @param props - Required props: `title string, message`OS dialog window title, either a string or a localization message Optional props: `header component`top part of the dialog, defaults to `editor.ui.heading({text = props.title})``content component`content of the dialog`width number`initial width of the dialog window in pixels`height number`initial height of the dialog window in pixels`resizable boolean`determines if the dialog window can be resized by the user`buttons component[]`array of `editor.ui.dialog_button(...)` components, footer of the dialog. Defaults to a single Close button`modal boolean`if set to `false`, the dialog window stays on top but does not block interaction with the editor
501
+ * @returns UI component
502
+ */
503
+ function dialog(props: Record<string | number, unknown>): Opaque<"component">;
504
+ /**
505
+ * Dialog button shown in the footer of a dialog
506
+ *
507
+ * @param props - Required props: `text string, message`button text, either a string or a localization message Optional props: `result any`value returned by `editor.ui.show_dialog(...)` if this button is pressed`default boolean`if set, pressing `Enter` in the dialog will trigger this button`cancel boolean`if set, pressing `Escape` in the dialog will trigger this button`enabled boolean`determines if the button can be interacted with
508
+ * @returns UI component
509
+ */
510
+ function dialog_button(props: Record<string | number, unknown>): Opaque<"component">;
511
+ /**
512
+ * Input component for selecting files from the file system
513
+ *
514
+ * @param props - Optional props: `value string`file or directory path; resolved against project root if relative`on_value_changed function`value change callback, will receive the absolute path of a selected file/folder or nil if the field was cleared; even though the selector dialog allows selecting only files, it's possible to receive directories and non-existent file system entries using text field input`title string, message`OS window title, either a string or a localization message`filters table[]`File filters, an array of filter tables, where each filter has following keys:`description string, message`text explaining the filter, either a literal string like `"Text files (*.txt)"` or a localization message`extensions string[]`array of file extension patterns, e.g. `"*.txt"`, `"*.*"` or `"game.project"``issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
515
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
516
+ * - `editor.ui.ALIGNMENT.TOP`
517
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
518
+ * - `editor.ui.ALIGNMENT.LEFT`
519
+ * - `editor.ui.ALIGNMENT.CENTER`
520
+ * - `editor.ui.ALIGNMENT.RIGHT`
521
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
522
+ * - `editor.ui.ALIGNMENT.BOTTOM`
523
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
524
+ * @returns UI component
525
+ */
526
+ function external_file_field(props: Record<string | number, unknown>): Opaque<"component">;
527
+ /**
528
+ * Layout container that places its children in a 2D grid
529
+ *
530
+ * @param props - Optional props: `children component[][]`array of arrays of child components`rows table[]`array of row option tables, separate configuration for each row:`grow boolean`determines if the row should grow to fill available space`columns table[]`array of column option tables, separate configuration for each column:`grow boolean`determines if the column should grow to fill available space`padding string, number`empty space from the edges of the container to its children; either:
531
+ * - `editor.ui.PADDING.NONE`
532
+ * - `editor.ui.PADDING.SMALL`
533
+ * - `editor.ui.PADDING.MEDIUM`
534
+ * - `editor.ui.PADDING.LARGE`
535
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
536
+ * - `editor.ui.SPACING.NONE`
537
+ * - `editor.ui.SPACING.SMALL`
538
+ * - `editor.ui.SPACING.MEDIUM`
539
+ * - `editor.ui.SPACING.LARGE`
540
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
541
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
542
+ * - `editor.ui.ALIGNMENT.TOP`
543
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
544
+ * - `editor.ui.ALIGNMENT.LEFT`
545
+ * - `editor.ui.ALIGNMENT.CENTER`
546
+ * - `editor.ui.ALIGNMENT.RIGHT`
547
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
548
+ * - `editor.ui.ALIGNMENT.BOTTOM`
549
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
550
+ * @returns UI component
551
+ */
552
+ function grid(props: Record<string | number, unknown>): Opaque<"component">;
553
+ /**
554
+ * A text heading
555
+ *
556
+ * @param props - Optional props: `text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
557
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
558
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
559
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
560
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
561
+ * - `editor.ui.COLOR.TEXT`
562
+ * - `editor.ui.COLOR.HINT`
563
+ * - `editor.ui.COLOR.OVERRIDE`
564
+ * - `editor.ui.COLOR.WARNING`
565
+ * - `editor.ui.COLOR.ERROR``word_wrap boolean`determines if the lines of text are word-wrapped when they don't fit in the assigned bounds, defaults to true`style string`heading style, defaults to `editor.ui.HEADING_STYLE.H3`; either:
566
+ * - `editor.ui.HEADING_STYLE.H1`
567
+ * - `editor.ui.HEADING_STYLE.H2`
568
+ * - `editor.ui.HEADING_STYLE.H3`
569
+ * - `editor.ui.HEADING_STYLE.H4`
570
+ * - `editor.ui.HEADING_STYLE.H5`
571
+ * - `editor.ui.HEADING_STYLE.H6`
572
+ * - `editor.ui.HEADING_STYLE.DIALOG`
573
+ * - `editor.ui.HEADING_STYLE.FORM``alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
574
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
575
+ * - `editor.ui.ALIGNMENT.TOP`
576
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
577
+ * - `editor.ui.ALIGNMENT.LEFT`
578
+ * - `editor.ui.ALIGNMENT.CENTER`
579
+ * - `editor.ui.ALIGNMENT.RIGHT`
580
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
581
+ * - `editor.ui.ALIGNMENT.BOTTOM`
582
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
583
+ * @returns UI component
584
+ */
585
+ function heading(props: Record<string | number, unknown>): Opaque<"component">;
586
+ /**
587
+ * Layout container that places its children in a horizontal row one after another
588
+ *
589
+ * @param props - Optional props: `children component[]`array of child components`padding string, number`empty space from the edges of the container to its children; either:
590
+ * - `editor.ui.PADDING.NONE`
591
+ * - `editor.ui.PADDING.SMALL`
592
+ * - `editor.ui.PADDING.MEDIUM`
593
+ * - `editor.ui.PADDING.LARGE`
594
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
595
+ * - `editor.ui.SPACING.NONE`
596
+ * - `editor.ui.SPACING.SMALL`
597
+ * - `editor.ui.SPACING.MEDIUM`
598
+ * - `editor.ui.SPACING.LARGE`
599
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
600
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
601
+ * - `editor.ui.ALIGNMENT.TOP`
602
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
603
+ * - `editor.ui.ALIGNMENT.LEFT`
604
+ * - `editor.ui.ALIGNMENT.CENTER`
605
+ * - `editor.ui.ALIGNMENT.RIGHT`
606
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
607
+ * - `editor.ui.ALIGNMENT.BOTTOM`
608
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
609
+ * @returns UI component
610
+ */
611
+ function horizontal(props: Record<string | number, unknown>): Opaque<"component">;
612
+ /**
613
+ * An icon from a predefined set
614
+ *
615
+ * @param props - Required props: `icon string`predefined icon name; either:
616
+ * - `editor.ui.ICON.OPEN_RESOURCE`
617
+ * - `editor.ui.ICON.PLUS`
618
+ * - `editor.ui.ICON.MINUS`
619
+ * - `editor.ui.ICON.CLEAR` Optional props: `alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
620
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
621
+ * - `editor.ui.ALIGNMENT.TOP`
622
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
623
+ * - `editor.ui.ALIGNMENT.LEFT`
624
+ * - `editor.ui.ALIGNMENT.CENTER`
625
+ * - `editor.ui.ALIGNMENT.RIGHT`
626
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
627
+ * - `editor.ui.ALIGNMENT.BOTTOM`
628
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
629
+ * @returns UI component
630
+ */
631
+ function icon(props: Record<string | number, unknown>): Opaque<"component">;
632
+ /**
633
+ * An image
634
+ *
635
+ * @param props - Required props: `image string`either a resource path (starts with `/`), or an URL Optional props: `width number`width of the image view, the image will be fit inside it while preserving its aspect ratio`height number`height of the image view, the image will be fit inside it while preserving its aspect ratio`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
636
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
637
+ * - `editor.ui.ALIGNMENT.TOP`
638
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
639
+ * - `editor.ui.ALIGNMENT.LEFT`
640
+ * - `editor.ui.ALIGNMENT.CENTER`
641
+ * - `editor.ui.ALIGNMENT.RIGHT`
642
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
643
+ * - `editor.ui.ALIGNMENT.BOTTOM`
644
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
645
+ * @returns UI component
646
+ */
647
+ function image(props: Record<string | number, unknown>): Opaque<"component">;
648
+ /**
649
+ * Integer input component based on a text field, reports changes on commit (`Enter` or focus loss)
650
+ *
651
+ * @param props - Optional props: `value any`value`on_value_changed function`value change callback, will receive the new value`issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
652
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
653
+ * - `editor.ui.ALIGNMENT.TOP`
654
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
655
+ * - `editor.ui.ALIGNMENT.LEFT`
656
+ * - `editor.ui.ALIGNMENT.CENTER`
657
+ * - `editor.ui.ALIGNMENT.RIGHT`
658
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
659
+ * - `editor.ui.ALIGNMENT.BOTTOM`
660
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
661
+ * @returns UI component
662
+ */
663
+ function integer_field(props: Record<string | number, unknown>): Opaque<"component">;
664
+ /**
665
+ * Label intended for use with input components
666
+ *
667
+ * @param props - Optional props: `text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
668
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
669
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
670
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
671
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
672
+ * - `editor.ui.COLOR.TEXT`
673
+ * - `editor.ui.COLOR.HINT`
674
+ * - `editor.ui.COLOR.OVERRIDE`
675
+ * - `editor.ui.COLOR.WARNING`
676
+ * - `editor.ui.COLOR.ERROR``tooltip string, message`tooltip message shown on hover; either a string or a localization message`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
677
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
678
+ * - `editor.ui.ALIGNMENT.TOP`
679
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
680
+ * - `editor.ui.ALIGNMENT.LEFT`
681
+ * - `editor.ui.ALIGNMENT.CENTER`
682
+ * - `editor.ui.ALIGNMENT.RIGHT`
683
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
684
+ * - `editor.ui.ALIGNMENT.BOTTOM`
685
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
686
+ * @returns UI component
687
+ */
688
+ function label(props: Record<string | number, unknown>): Opaque<"component">;
689
+ /**
690
+ * Number input component based on a text field, reports changes on commit (`Enter` or focus loss)
691
+ *
692
+ * @param props - Optional props: `value any`value`on_value_changed function`value change callback, will receive the new value`issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
693
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
694
+ * - `editor.ui.ALIGNMENT.TOP`
695
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
696
+ * - `editor.ui.ALIGNMENT.LEFT`
697
+ * - `editor.ui.ALIGNMENT.CENTER`
698
+ * - `editor.ui.ALIGNMENT.RIGHT`
699
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
700
+ * - `editor.ui.ALIGNMENT.BOTTOM`
701
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
702
+ * @returns UI component
703
+ */
704
+ function number_field(props: Record<string | number, unknown>): Opaque<"component">;
705
+ /**
706
+ * Open a resource, either in the editor or in a third-party app
707
+ *
708
+ * @param resource_path - Resource path (starting with `/`)
709
+ */
710
+ function open_resource(resource_path: string): void;
711
+ /**
712
+ * A paragraph of text
713
+ *
714
+ * @param props - Optional props: `text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
715
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
716
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
717
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
718
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
719
+ * - `editor.ui.COLOR.TEXT`
720
+ * - `editor.ui.COLOR.HINT`
721
+ * - `editor.ui.COLOR.OVERRIDE`
722
+ * - `editor.ui.COLOR.WARNING`
723
+ * - `editor.ui.COLOR.ERROR``word_wrap boolean`determines if the lines of text are word-wrapped when they don't fit in the assigned bounds, defaults to true`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
724
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
725
+ * - `editor.ui.ALIGNMENT.TOP`
726
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
727
+ * - `editor.ui.ALIGNMENT.LEFT`
728
+ * - `editor.ui.ALIGNMENT.CENTER`
729
+ * - `editor.ui.ALIGNMENT.RIGHT`
730
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
731
+ * - `editor.ui.ALIGNMENT.BOTTOM`
732
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
733
+ * @returns UI component
734
+ */
735
+ function paragraph(props: Record<string | number, unknown>): Opaque<"component">;
736
+ /**
737
+ * Input component for selecting project resources
738
+ *
739
+ * @param props - Optional props: `value string`resource path (must start with `/`)`on_value_changed function`value change callback, will receive either resource path of a selected resource or nil when the field is cleared; even though the resource selector dialog allows filtering on resource extensions, it's possible to receive resources with other extensions and non-existent resources using text field input`title string, message`dialog title, either a string or a localization message, defaults to `localization.message("dialog.select-resource.title")``extensions string[]`if specified, restricts selectable resources in the dialog to specified file extensions; e.g. `{"collection", "go"}``issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
740
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
741
+ * - `editor.ui.ALIGNMENT.TOP`
742
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
743
+ * - `editor.ui.ALIGNMENT.LEFT`
744
+ * - `editor.ui.ALIGNMENT.CENTER`
745
+ * - `editor.ui.ALIGNMENT.RIGHT`
746
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
747
+ * - `editor.ui.ALIGNMENT.BOTTOM`
748
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
749
+ * @returns UI component
750
+ */
751
+ function resource_field(props: Record<string | number, unknown>): Opaque<"component">;
752
+ /**
753
+ * Layout container that optionally shows scroll bars if child contents overflow the assigned bounds
754
+ *
755
+ * @param props - Required props: `content component`content component Optional props: `grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
756
+ * @returns UI component
757
+ */
758
+ function scroll(props: Record<string | number, unknown>): Opaque<"component">;
759
+ /**
760
+ * Dropdown select box with an array of options
761
+ *
762
+ * @param props - Optional props: `value any`selected value`on_value_changed function`change callback, will receive the selected value`options any[]`array of selectable options`to_string function`function that converts an item to a string (or a localization message); defaults to `tostring``issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
763
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
764
+ * - `editor.ui.ALIGNMENT.TOP`
765
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
766
+ * - `editor.ui.ALIGNMENT.LEFT`
767
+ * - `editor.ui.ALIGNMENT.CENTER`
768
+ * - `editor.ui.ALIGNMENT.RIGHT`
769
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
770
+ * - `editor.ui.ALIGNMENT.BOTTOM`
771
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
772
+ * @returns UI component
773
+ */
774
+ function select_box(props: Record<string | number, unknown>): Opaque<"component">;
775
+ /**
776
+ * Thin line for visual content separation, by default horizontal and aligned to center
777
+ *
778
+ * @param props - Optional props: `orientation string`separator line orientation, `editor.ui.ORIENTATION.VERTICAL` or `editor.ui.ORIENTATION.HORIZONTAL`; either:
779
+ * - `editor.ui.ORIENTATION.VERTICAL`
780
+ * - `editor.ui.ORIENTATION.HORIZONTAL``alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
781
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
782
+ * - `editor.ui.ALIGNMENT.TOP`
783
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
784
+ * - `editor.ui.ALIGNMENT.LEFT`
785
+ * - `editor.ui.ALIGNMENT.CENTER`
786
+ * - `editor.ui.ALIGNMENT.RIGHT`
787
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
788
+ * - `editor.ui.ALIGNMENT.BOTTOM`
789
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
790
+ * @returns UI component
791
+ */
792
+ function separator(props: Record<string | number, unknown>): Opaque<"component">;
793
+ /**
794
+ * Show a dialog and await a result
795
+ *
796
+ * @param dialog - a component that resolves to `editor.ui.dialog(...)`
797
+ * @returns dialog result, the value used as a `result` prop in a `editor.ui.dialog_button({...})` selected by the user, or `nil` if the dialog was closed and there was no `cancel = true` dialog button with `result` prop set
798
+ */
799
+ function show_dialog(dialog: Opaque<"component">): unknown;
800
+ /**
801
+ * Show a modal OS directory selection dialog and await a result
802
+ *
803
+ * @param opts - `path string`initial file or directory path used by the dialog; resolved against project root if relative`title string, message`OS window title, either a string or a localization message
804
+ * @returns either absolute directory path or nil if user canceled directory selection
805
+ */
806
+ function show_external_directory_dialog(opts?: Record<string | number, unknown>): string | undefined;
807
+ /**
808
+ * Show a modal OS file selection dialog and await a result
809
+ *
810
+ * @param opts - `path string`initial file or directory path used by the dialog; resolved against project root if relative`title string, message`OS window title, either a string or a localization message`filters table[]`File filters, an array of filter tables, where each filter has following keys:`description string, message`text explaining the filter, either a literal string like `"Text files (*.txt)"` or a localization message`extensions string[]`array of file extension patterns, e.g. `"*.txt"`, `"*.*"` or `"game.project"`
811
+ * @returns either absolute file path or nil if user canceled file selection
812
+ */
813
+ function show_external_file_dialog(opts?: Record<string | number, unknown>): string | undefined;
814
+ /**
815
+ * Show a modal resource selection dialog and await a result
816
+ *
817
+ * @param opts - `extensions string[]`if specified, restricts selectable resources in the dialog to specified file extensions; e.g. `{"collection", "go"}``selection string`either `"single"` or `"multiple"`, defaults to `"single"``title string, message`dialog title, either a string or a localization message, defaults to `localization.message("dialog.select-resource.title")`
818
+ * @returns |nil] if user made no selection, returns `nil`. Otherwise, if selection mode is `"single"`, returns selected resource path; otherwise returns a non-empty array of selected resource paths.
819
+ */
820
+ function show_resource_dialog(opts?: Record<string | number, unknown>): unknown;
821
+ /**
822
+ * String input component based on a text field, reports changes on commit (`Enter` or focus loss)
823
+ *
824
+ * @param props - Optional props: `value any`value`on_value_changed function`value change callback, will receive the new value`issue table`issue related to the input; table with the following keys (all required):`severity string`either `editor.ui.ISSUE_SEVERITY.WARNING` or `editor.ui.ISSUE_SEVERITY.ERROR``message string, message`issue message that will be shown in a tooltip; either a string or a localization message`tooltip string, message`tooltip message shown on hover; either a string or a localization message`enabled boolean`determines if the input component can be interacted with`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
825
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
826
+ * - `editor.ui.ALIGNMENT.TOP`
827
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
828
+ * - `editor.ui.ALIGNMENT.LEFT`
829
+ * - `editor.ui.ALIGNMENT.CENTER`
830
+ * - `editor.ui.ALIGNMENT.RIGHT`
831
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
832
+ * - `editor.ui.ALIGNMENT.BOTTOM`
833
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
834
+ * @returns UI component
835
+ */
836
+ function string_field(props: Record<string | number, unknown>): Opaque<"component">;
837
+ /**
838
+ * Tab used in the `tabs` prop of `editor.ui.tabs(...)`
839
+ *
840
+ * @param props - Required props: `text string, message`tab header text, either a string or a localization message Optional props: `content component`tab content component`icon component`tab header icon component`enabled boolean`determines if the tab can be selected
841
+ * @returns UI component
842
+ */
843
+ function tab(props: Record<string | number, unknown>): Opaque<"component">;
844
+ /**
845
+ * Layout container that shows one selected tab content at a time
846
+ *
847
+ * @param props - Optional props: `tabs component[]`array of `editor.ui.tab(...)` components`grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
848
+ * @returns UI component
849
+ */
850
+ function tabs(props: Record<string | number, unknown>): Opaque<"component">;
851
+ /**
852
+ * A hook that caches the result of a computation between re-renders.
853
+ * See `editor.ui.component` for hooks caveats and rules. If any of the arguments to `use_memo` change during a component refresh (checked with `==`), the value will be recomputed.
854
+ *
855
+ * @param compute - function that will be used to compute the cached value
856
+ * @param args - args to the computation function
857
+ * @returns all returned values of the compute function
858
+ * @example
859
+ * ```ts
860
+ * function increment(n: unknown): number {
861
+ * return (n as number) + 1;
862
+ * }
863
+ *
864
+ * function makeListener(setCount: unknown) {
865
+ * return () => {
866
+ * (setCount as (update: unknown) => unknown)(increment);
867
+ * };
868
+ * }
869
+ *
870
+ * const counterButton = editor.ui.component((props) => {
871
+ * const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
872
+ * const onPressed = editor.ui.use_memo(makeListener, setCount) as () => void;
873
+ * return editor.ui.button({
874
+ * text: tostring(count),
875
+ * on_pressed: onPressed,
876
+ * });
877
+ * });
878
+ * ```
879
+ */
880
+ function use_memo(compute: (...args: unknown[]) => unknown, ...args: unknown[]): unknown;
881
+ /**
882
+ * A hook that adds local state to the component.
883
+ * See `editor.ui.component` for hooks caveats and rules. If any of the arguments to `use_state` change during a component refresh (checked with `==`), the current state will be reset to the initial one.
884
+ *
885
+ * @param init - local state initializer, either initial data structure or function that produces the data structure
886
+ * @param args - used when `init` is a function, the args are passed to the initializer function
887
+ * @example
888
+ * ```ts
889
+ * function increment(n: unknown): number {
890
+ * return (n as number) + 1;
891
+ * }
892
+ *
893
+ * const counterButton = editor.ui.component((props) => {
894
+ * const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
895
+ * return editor.ui.button({
896
+ * text: tostring(count),
897
+ * on_pressed: () => {
898
+ * setCount(increment);
899
+ * },
900
+ * });
901
+ * });
902
+ * ```
903
+ */
904
+ function use_state(init: unknown, ...args: unknown[]): LuaMultiReturn<[unknown, (...args: unknown[]) => unknown]>;
905
+ /**
906
+ * Layout container that places its children in a vertical column one after another
907
+ *
908
+ * @param props - Optional props: `children component[]`array of child components`padding string, number`empty space from the edges of the container to its children; either:
909
+ * - `editor.ui.PADDING.NONE`
910
+ * - `editor.ui.PADDING.SMALL`
911
+ * - `editor.ui.PADDING.MEDIUM`
912
+ * - `editor.ui.PADDING.LARGE`
913
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
914
+ * - `editor.ui.SPACING.NONE`
915
+ * - `editor.ui.SPACING.SMALL`
916
+ * - `editor.ui.SPACING.MEDIUM`
917
+ * - `editor.ui.SPACING.LARGE`
918
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
919
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
920
+ * - `editor.ui.ALIGNMENT.TOP`
921
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
922
+ * - `editor.ui.ALIGNMENT.LEFT`
923
+ * - `editor.ui.ALIGNMENT.CENTER`
924
+ * - `editor.ui.ALIGNMENT.RIGHT`
925
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
926
+ * - `editor.ui.ALIGNMENT.BOTTOM`
927
+ * - `editor.ui.ALIGNMENT.BOTTOM_RIGHT``grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
928
+ * @returns UI component
929
+ */
930
+ function vertical(props: Record<string | number, unknown>): Opaque<"component">;
931
+ namespace ALIGNMENT {
932
+ /**
933
+ * `"bottom"`
934
+ */
935
+ const BOTTOM: unknown;
936
+ /**
937
+ * `"bottom-left"`
938
+ */
939
+ const BOTTOM_LEFT: unknown;
940
+ /**
941
+ * `"bottom-right"`
942
+ */
943
+ const BOTTOM_RIGHT: unknown;
944
+ /**
945
+ * `"center"`
946
+ */
947
+ const CENTER: unknown;
948
+ /**
949
+ * `"left"`
950
+ */
951
+ const LEFT: unknown;
952
+ /**
953
+ * `"right"`
954
+ */
955
+ const RIGHT: unknown;
956
+ /**
957
+ * `"top"`
958
+ */
959
+ const TOP: unknown;
960
+ /**
961
+ * `"top-left"`
962
+ */
963
+ const TOP_LEFT: unknown;
964
+ /**
965
+ * `"top-right"`
966
+ */
967
+ const TOP_RIGHT: unknown;
968
+ }
969
+ namespace COLOR {
970
+ /**
971
+ * `"error"`
972
+ */
973
+ const ERROR: unknown;
974
+ /**
975
+ * `"hint"`
976
+ */
977
+ const HINT: unknown;
978
+ /**
979
+ * `"override"`
980
+ */
981
+ const OVERRIDE: unknown;
982
+ /**
983
+ * `"text"`
984
+ */
985
+ const TEXT: unknown;
986
+ /**
987
+ * `"warning"`
988
+ */
989
+ const WARNING: unknown;
990
+ }
991
+ namespace HEADING_STYLE {
992
+ /**
993
+ * `"dialog"`
994
+ */
995
+ const DIALOG: unknown;
996
+ /**
997
+ * `"form"`
998
+ */
999
+ const FORM: unknown;
1000
+ /**
1001
+ * `"h1"`
1002
+ */
1003
+ const H1: unknown;
1004
+ /**
1005
+ * `"h2"`
1006
+ */
1007
+ const H2: unknown;
1008
+ /**
1009
+ * `"h3"`
1010
+ */
1011
+ const H3: unknown;
1012
+ /**
1013
+ * `"h4"`
1014
+ */
1015
+ const H4: unknown;
1016
+ /**
1017
+ * `"h5"`
1018
+ */
1019
+ const H5: unknown;
1020
+ /**
1021
+ * `"h6"`
1022
+ */
1023
+ const H6: unknown;
1024
+ }
1025
+ namespace ICON {
1026
+ /**
1027
+ * `"clear"`
1028
+ */
1029
+ const CLEAR: unknown;
1030
+ /**
1031
+ * `"minus"`
1032
+ */
1033
+ const MINUS: unknown;
1034
+ /**
1035
+ * `"open-resource"`
1036
+ */
1037
+ const OPEN_RESOURCE: unknown;
1038
+ /**
1039
+ * `"plus"`
1040
+ */
1041
+ const PLUS: unknown;
1042
+ }
1043
+ namespace ISSUE_SEVERITY {
1044
+ /**
1045
+ * `"error"`
1046
+ */
1047
+ const ERROR: unknown;
1048
+ /**
1049
+ * `"warning"`
1050
+ */
1051
+ const WARNING: unknown;
1052
+ }
1053
+ namespace ORIENTATION {
1054
+ /**
1055
+ * `"horizontal"`
1056
+ */
1057
+ const HORIZONTAL: unknown;
1058
+ /**
1059
+ * `"vertical"`
1060
+ */
1061
+ const VERTICAL: unknown;
1062
+ }
1063
+ namespace PADDING {
1064
+ /**
1065
+ * `"large"`
1066
+ */
1067
+ const LARGE: unknown;
1068
+ /**
1069
+ * `"medium"`
1070
+ */
1071
+ const MEDIUM: unknown;
1072
+ /**
1073
+ * `"none"`
1074
+ */
1075
+ const NONE: unknown;
1076
+ /**
1077
+ * `"small"`
1078
+ */
1079
+ const SMALL: unknown;
1080
+ }
1081
+ namespace SPACING {
1082
+ /**
1083
+ * `"large"`
1084
+ */
1085
+ const LARGE: unknown;
1086
+ /**
1087
+ * `"medium"`
1088
+ */
1089
+ const MEDIUM: unknown;
1090
+ /**
1091
+ * `"none"`
1092
+ */
1093
+ const NONE: unknown;
1094
+ /**
1095
+ * `"small"`
1096
+ */
1097
+ const SMALL: unknown;
1098
+ }
1099
+ namespace TEXT_ALIGNMENT {
1100
+ /**
1101
+ * `"center"`
1102
+ */
1103
+ const CENTER: unknown;
1104
+ /**
1105
+ * `"justify"`
1106
+ */
1107
+ const JUSTIFY: unknown;
1108
+ /**
1109
+ * `"left"`
1110
+ */
1111
+ const LEFT: unknown;
1112
+ /**
1113
+ * `"right"`
1114
+ */
1115
+ const RIGHT: unknown;
1116
+ }
1117
+ }
1118
+ }
1119
+ }
1120
+
1121
+ export {};