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