@defold-typescript/types 0.24.0 → 0.25.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.
@@ -0,0 +1,1092 @@
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 if `editor.tx.add()` (as well as `editor.tx.clear()` and `editor.tx.remove()`) transaction with this property won't throw an error
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 if you can get this property so `editor.get()` won't throw an error
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 if `editor.tx.reorder()` transaction with this property won't throw an error
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 if `editor.tx.reset()` transaction with this property won't throw an error
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 if `editor.tx.set()` transaction with this property won't throw an error
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
+ * Get a value of a node property inside the editor.
177
+ * 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.
178
+ *
179
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
180
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
181
+ * @returns property value
182
+ */
183
+ function get(node: string | Opaque<"userdata">, property: string): unknown;
184
+ /**
185
+ * Open a file in a registered application
186
+ *
187
+ * @param path - file path
188
+ */
189
+ function open_external_file(path: string): void;
190
+ /**
191
+ * List property names for a node.
192
+ * 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.
193
+ *
194
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
195
+ * @returns ] sorted unique editor property names available in the current context
196
+ */
197
+ function properties(node: string | Opaque<"userdata">): unknown;
198
+ /**
199
+ * Query information about a project resource
200
+ *
201
+ * @param resource_path - Resource path (starting with `/`)
202
+ * @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
203
+ */
204
+ function resource_attributes(resource_path: string): Record<string | number, unknown>;
205
+ /**
206
+ * Persist any unsaved changes to disk
207
+ */
208
+ function save(): void;
209
+ /**
210
+ * Change the editor state in a single, undoable transaction
211
+ *
212
+ * @param txs - ] An array of transaction steps created using `editor.tx.*` functions
213
+ */
214
+ function transact(txs: Opaque<"transaction_step">[]): void;
215
+ namespace prefs {
216
+ /**
217
+ * Get preference value
218
+ * The schema for the preference value should be defined beforehand.
219
+ *
220
+ * @param key - dot-separated preference key path
221
+ * @returns current pref value or default if a schema for the key path exists, nil otherwise
222
+ */
223
+ function get(key: string): unknown;
224
+ /**
225
+ * Check if preference value is explicitly set
226
+ * The schema for the preference value should be defined beforehand.
227
+ *
228
+ * @param key - dot-separated preference key path
229
+ * @returns flag indicating if the value is explicitly set
230
+ */
231
+ function is_set(key: string): boolean;
232
+ /**
233
+ * Set preference value
234
+ * The schema for the preference value should be defined beforehand.
235
+ *
236
+ * @param key - dot-separated preference key path
237
+ * @param value - new pref value to set
238
+ */
239
+ function set(key: string, value: unknown): void;
240
+ namespace schema {
241
+ /**
242
+ * array schema
243
+ *
244
+ * @param opts - Required opts: `item schema`array item schema Optional opts: `default item[]`default value`scope string`preference scope; either:
245
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
246
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
247
+ * @returns Prefs schema
248
+ */
249
+ export function array(opts: Record<string | number, unknown>): unknown;
250
+ /**
251
+ * boolean schema
252
+ *
253
+ * @param opts - Optional opts: `default boolean`default value`scope string`preference scope; either:
254
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
255
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
256
+ * @returns Prefs schema
257
+ */
258
+ export function boolean(opts?: Record<string | number, unknown>): unknown;
259
+ /**
260
+ * enum value schema
261
+ *
262
+ * @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:
263
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
264
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
265
+ * @returns Prefs schema
266
+ */
267
+ function _enum(opts: Record<string | number, unknown>): unknown;
268
+ /**
269
+ * integer schema
270
+ *
271
+ * @param opts - Optional opts: `default integer`default value`scope string`preference scope; either:
272
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
273
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
274
+ * @returns Prefs schema
275
+ */
276
+ export function integer(opts?: Record<string | number, unknown>): unknown;
277
+ /**
278
+ * keyword schema
279
+ * A keyword is a short string that is interned within the editor runtime, useful e.g. for identifiers
280
+ *
281
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
282
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
283
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
284
+ * @returns Prefs schema
285
+ */
286
+ export function keyword(opts?: Record<string | number, unknown>): unknown;
287
+ /**
288
+ * floating-point number schema
289
+ *
290
+ * @param opts - Optional opts: `default number`default value`scope string`preference scope; either:
291
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
292
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
293
+ * @returns Prefs schema
294
+ */
295
+ export function number(opts?: Record<string | number, unknown>): unknown;
296
+ /**
297
+ * heterogeneous object schema
298
+ *
299
+ * @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:
300
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
301
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
302
+ * @returns Prefs schema
303
+ */
304
+ export function object(opts: Record<string | number, unknown>): unknown;
305
+ /**
306
+ * homogeneous object schema
307
+ *
308
+ * @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:
309
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
310
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
311
+ * @returns Prefs schema
312
+ */
313
+ export function object_of(opts: Record<string | number, unknown>): unknown;
314
+ /**
315
+ * one of schema
316
+ *
317
+ * @param opts - Required opts: `schemas schema[]`alternative schemas Optional opts: `default any`default value`scope string`preference scope; either:
318
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
319
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
320
+ * @returns Prefs schema
321
+ */
322
+ export function one_of(opts: Record<string | number, unknown>): unknown;
323
+ /**
324
+ * password schema
325
+ * A password is a string that is encrypted when stored in a preference file
326
+ *
327
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
328
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
329
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
330
+ * @returns Prefs schema
331
+ */
332
+ export function password(opts?: Record<string | number, unknown>): unknown;
333
+ /**
334
+ * set schema
335
+ * Set is represented as a lua table with `true` values
336
+ *
337
+ * @param opts - Required opts: `item schema`set item schema Optional opts: `default table<item, true>`default value`scope string`preference scope; either:
338
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
339
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
340
+ * @returns Prefs schema
341
+ */
342
+ export function set(opts: Record<string | number, unknown>): unknown;
343
+ /**
344
+ * string schema
345
+ *
346
+ * @param opts - Optional opts: `default string`default value`scope string`preference scope; either:
347
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
348
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
349
+ * @returns Prefs schema
350
+ */
351
+ export function string(opts?: Record<string | number, unknown>): unknown;
352
+ /**
353
+ * tuple schema
354
+ * A tuple is a fixed-length array where each item has its own defined type
355
+ *
356
+ * @param opts - Required opts: `items schema[]`schemas for the items Optional opts: `default any[]`default value`scope string`preference scope; either:
357
+ * - `editor.prefs.SCOPE.GLOBAL`: same preference value is used in every project on this computer
358
+ * - `editor.prefs.SCOPE.PROJECT`: a separate preference value per project
359
+ * @returns Prefs schema
360
+ */
361
+ export function tuple(opts: Record<string | number, unknown>): unknown;
362
+ export { _enum as enum };
363
+ }
364
+ namespace SCOPE {
365
+ /**
366
+ * `"global"`
367
+ */
368
+ const GLOBAL: unknown;
369
+ /**
370
+ * `"project"`
371
+ */
372
+ const PROJECT: unknown;
373
+ }
374
+ }
375
+ namespace tx {
376
+ /**
377
+ * Create a transaction step that will add a child item to a node's list property when transacted with `editor.transact()`.
378
+ *
379
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
380
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
381
+ * @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
382
+ */
383
+ function add(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
384
+ /**
385
+ * Create a transaction step that will remove all items from node's list property when transacted with `editor.transact()`.
386
+ *
387
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
388
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
389
+ * @returns A transaction step
390
+ */
391
+ function clear(node: string | Opaque<"userdata">, property: string): Opaque<"transaction_step">;
392
+ /**
393
+ * Create a transaction step that will remove a child node from the node's list property when transacted with `editor.transact()`.
394
+ *
395
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
396
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
397
+ * @param child_node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
398
+ * @returns A transaction step
399
+ */
400
+ function remove(node: string | Opaque<"userdata">, property: string, child_node: string | Opaque<"userdata">): Opaque<"transaction_step">;
401
+ /**
402
+ * Create a transaction step that reorders child nodes in a node list defined by the property if supported (see `editor.can_reorder()`)
403
+ *
404
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
405
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
406
+ * @param child_nodes - array of child nodes (the same as returned by `editor.get(node, property)`) in new order
407
+ * @returns A transaction step
408
+ */
409
+ function reorder(node: string | Opaque<"userdata">, property: string, child_nodes: Record<string | number, unknown>): Opaque<"transaction_step">;
410
+ /**
411
+ * Create a transaction step that will reset an overridden property to its default value when transacted with `editor.transact()`.
412
+ *
413
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
414
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
415
+ * @returns A transaction step
416
+ */
417
+ function reset(node: string | Opaque<"userdata">, property: string): Opaque<"transaction_step">;
418
+ /**
419
+ * Create transaction step that will set the node's property to a supplied value when transacted with `editor.transact()`.
420
+ *
421
+ * @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
422
+ * @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
423
+ * @param value - A new value for the property
424
+ * @returns A transaction step
425
+ */
426
+ function set(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
427
+ }
428
+ namespace ui {
429
+ /**
430
+ * Button with a label and/or an icon
431
+ *
432
+ * @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:
433
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
434
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
435
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
436
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``icon string`predefined icon name; either:
437
+ * - `editor.ui.ICON.OPEN_RESOURCE`
438
+ * - `editor.ui.ICON.PLUS`
439
+ * - `editor.ui.ICON.MINUS`
440
+ * - `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:
441
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
442
+ * - `editor.ui.ALIGNMENT.TOP`
443
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
444
+ * - `editor.ui.ALIGNMENT.LEFT`
445
+ * - `editor.ui.ALIGNMENT.CENTER`
446
+ * - `editor.ui.ALIGNMENT.RIGHT`
447
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
448
+ * - `editor.ui.ALIGNMENT.BOTTOM`
449
+ * - `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.
450
+ * @returns UI component
451
+ */
452
+ function button(props: Record<string | number, unknown>): Opaque<"component">;
453
+ /**
454
+ * Check box with a label
455
+ *
456
+ * @param props - Optional props: `value boolean`determines if the checkbox should appear checked`on_value_changed function`change callback, will receive the new value`text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
457
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
458
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
459
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
460
+ * - `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:
461
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
462
+ * - `editor.ui.ALIGNMENT.TOP`
463
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
464
+ * - `editor.ui.ALIGNMENT.LEFT`
465
+ * - `editor.ui.ALIGNMENT.CENTER`
466
+ * - `editor.ui.ALIGNMENT.RIGHT`
467
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
468
+ * - `editor.ui.ALIGNMENT.BOTTOM`
469
+ * - `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.
470
+ * @returns UI component
471
+ */
472
+ function check_box(props: Record<string | number, unknown>): Opaque<"component">;
473
+ /**
474
+ * Convert a function to a UI component.
475
+ * 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.
476
+ * 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.
477
+ *
478
+ * @param fn - function, will receive a single table of props when called
479
+ * @returns decorated component function that may be invoked with a props table create component
480
+ */
481
+ function component(fn: (...args: unknown[]) => unknown): (...args: unknown[]) => unknown;
482
+ /**
483
+ * Dialog component, a top-level window component that can't be used as a child of other components
484
+ *
485
+ * @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`buttons component[]`array of `editor.ui.dialog_button(...)` components, footer of the dialog. Defaults to a single Close button
486
+ * @returns UI component
487
+ */
488
+ function dialog(props: Record<string | number, unknown>): Opaque<"component">;
489
+ /**
490
+ * Dialog button shown in the footer of a dialog
491
+ *
492
+ * @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
493
+ * @returns UI component
494
+ */
495
+ function dialog_button(props: Record<string | number, unknown>): Opaque<"component">;
496
+ /**
497
+ * Input component for selecting files from the file system
498
+ *
499
+ * @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:
500
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
501
+ * - `editor.ui.ALIGNMENT.TOP`
502
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
503
+ * - `editor.ui.ALIGNMENT.LEFT`
504
+ * - `editor.ui.ALIGNMENT.CENTER`
505
+ * - `editor.ui.ALIGNMENT.RIGHT`
506
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
507
+ * - `editor.ui.ALIGNMENT.BOTTOM`
508
+ * - `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.
509
+ * @returns UI component
510
+ */
511
+ function external_file_field(props: Record<string | number, unknown>): Opaque<"component">;
512
+ /**
513
+ * Layout container that places its children in a 2D grid
514
+ *
515
+ * @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:
516
+ * - `editor.ui.PADDING.NONE`
517
+ * - `editor.ui.PADDING.SMALL`
518
+ * - `editor.ui.PADDING.MEDIUM`
519
+ * - `editor.ui.PADDING.LARGE`
520
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
521
+ * - `editor.ui.SPACING.NONE`
522
+ * - `editor.ui.SPACING.SMALL`
523
+ * - `editor.ui.SPACING.MEDIUM`
524
+ * - `editor.ui.SPACING.LARGE`
525
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
526
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
527
+ * - `editor.ui.ALIGNMENT.TOP`
528
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
529
+ * - `editor.ui.ALIGNMENT.LEFT`
530
+ * - `editor.ui.ALIGNMENT.CENTER`
531
+ * - `editor.ui.ALIGNMENT.RIGHT`
532
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
533
+ * - `editor.ui.ALIGNMENT.BOTTOM`
534
+ * - `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.
535
+ * @returns UI component
536
+ */
537
+ function grid(props: Record<string | number, unknown>): Opaque<"component">;
538
+ /**
539
+ * A text heading
540
+ *
541
+ * @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:
542
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
543
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
544
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
545
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
546
+ * - `editor.ui.COLOR.TEXT`
547
+ * - `editor.ui.COLOR.HINT`
548
+ * - `editor.ui.COLOR.OVERRIDE`
549
+ * - `editor.ui.COLOR.WARNING`
550
+ * - `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:
551
+ * - `editor.ui.HEADING_STYLE.H1`
552
+ * - `editor.ui.HEADING_STYLE.H2`
553
+ * - `editor.ui.HEADING_STYLE.H3`
554
+ * - `editor.ui.HEADING_STYLE.H4`
555
+ * - `editor.ui.HEADING_STYLE.H5`
556
+ * - `editor.ui.HEADING_STYLE.H6`
557
+ * - `editor.ui.HEADING_STYLE.DIALOG`
558
+ * - `editor.ui.HEADING_STYLE.FORM``alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
559
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
560
+ * - `editor.ui.ALIGNMENT.TOP`
561
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
562
+ * - `editor.ui.ALIGNMENT.LEFT`
563
+ * - `editor.ui.ALIGNMENT.CENTER`
564
+ * - `editor.ui.ALIGNMENT.RIGHT`
565
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
566
+ * - `editor.ui.ALIGNMENT.BOTTOM`
567
+ * - `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.
568
+ * @returns UI component
569
+ */
570
+ function heading(props: Record<string | number, unknown>): Opaque<"component">;
571
+ /**
572
+ * Layout container that places its children in a horizontal row one after another
573
+ *
574
+ * @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:
575
+ * - `editor.ui.PADDING.NONE`
576
+ * - `editor.ui.PADDING.SMALL`
577
+ * - `editor.ui.PADDING.MEDIUM`
578
+ * - `editor.ui.PADDING.LARGE`
579
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
580
+ * - `editor.ui.SPACING.NONE`
581
+ * - `editor.ui.SPACING.SMALL`
582
+ * - `editor.ui.SPACING.MEDIUM`
583
+ * - `editor.ui.SPACING.LARGE`
584
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
585
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
586
+ * - `editor.ui.ALIGNMENT.TOP`
587
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
588
+ * - `editor.ui.ALIGNMENT.LEFT`
589
+ * - `editor.ui.ALIGNMENT.CENTER`
590
+ * - `editor.ui.ALIGNMENT.RIGHT`
591
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
592
+ * - `editor.ui.ALIGNMENT.BOTTOM`
593
+ * - `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.
594
+ * @returns UI component
595
+ */
596
+ function horizontal(props: Record<string | number, unknown>): Opaque<"component">;
597
+ /**
598
+ * An icon from a predefined set
599
+ *
600
+ * @param props - Required props: `icon string`predefined icon name; either:
601
+ * - `editor.ui.ICON.OPEN_RESOURCE`
602
+ * - `editor.ui.ICON.PLUS`
603
+ * - `editor.ui.ICON.MINUS`
604
+ * - `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:
605
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
606
+ * - `editor.ui.ALIGNMENT.TOP`
607
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
608
+ * - `editor.ui.ALIGNMENT.LEFT`
609
+ * - `editor.ui.ALIGNMENT.CENTER`
610
+ * - `editor.ui.ALIGNMENT.RIGHT`
611
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
612
+ * - `editor.ui.ALIGNMENT.BOTTOM`
613
+ * - `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.
614
+ * @returns UI component
615
+ */
616
+ function icon(props: Record<string | number, unknown>): Opaque<"component">;
617
+ /**
618
+ * An image
619
+ *
620
+ * @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:
621
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
622
+ * - `editor.ui.ALIGNMENT.TOP`
623
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
624
+ * - `editor.ui.ALIGNMENT.LEFT`
625
+ * - `editor.ui.ALIGNMENT.CENTER`
626
+ * - `editor.ui.ALIGNMENT.RIGHT`
627
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
628
+ * - `editor.ui.ALIGNMENT.BOTTOM`
629
+ * - `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.
630
+ * @returns UI component
631
+ */
632
+ function image(props: Record<string | number, unknown>): Opaque<"component">;
633
+ /**
634
+ * Integer input component based on a text field, reports changes on commit (`Enter` or focus loss)
635
+ *
636
+ * @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:
637
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
638
+ * - `editor.ui.ALIGNMENT.TOP`
639
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
640
+ * - `editor.ui.ALIGNMENT.LEFT`
641
+ * - `editor.ui.ALIGNMENT.CENTER`
642
+ * - `editor.ui.ALIGNMENT.RIGHT`
643
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
644
+ * - `editor.ui.ALIGNMENT.BOTTOM`
645
+ * - `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.
646
+ * @returns UI component
647
+ */
648
+ function integer_field(props: Record<string | number, unknown>): Opaque<"component">;
649
+ /**
650
+ * Label intended for use with input components
651
+ *
652
+ * @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:
653
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
654
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
655
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
656
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
657
+ * - `editor.ui.COLOR.TEXT`
658
+ * - `editor.ui.COLOR.HINT`
659
+ * - `editor.ui.COLOR.OVERRIDE`
660
+ * - `editor.ui.COLOR.WARNING`
661
+ * - `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:
662
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
663
+ * - `editor.ui.ALIGNMENT.TOP`
664
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
665
+ * - `editor.ui.ALIGNMENT.LEFT`
666
+ * - `editor.ui.ALIGNMENT.CENTER`
667
+ * - `editor.ui.ALIGNMENT.RIGHT`
668
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
669
+ * - `editor.ui.ALIGNMENT.BOTTOM`
670
+ * - `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.
671
+ * @returns UI component
672
+ */
673
+ function label(props: Record<string | number, unknown>): Opaque<"component">;
674
+ /**
675
+ * Number input component based on a text field, reports changes on commit (`Enter` or focus loss)
676
+ *
677
+ * @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:
678
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
679
+ * - `editor.ui.ALIGNMENT.TOP`
680
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
681
+ * - `editor.ui.ALIGNMENT.LEFT`
682
+ * - `editor.ui.ALIGNMENT.CENTER`
683
+ * - `editor.ui.ALIGNMENT.RIGHT`
684
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
685
+ * - `editor.ui.ALIGNMENT.BOTTOM`
686
+ * - `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.
687
+ * @returns UI component
688
+ */
689
+ function number_field(props: Record<string | number, unknown>): Opaque<"component">;
690
+ /**
691
+ * Open a resource, either in the editor or in a third-party app
692
+ *
693
+ * @param resource_path - Resource path (starting with `/`)
694
+ */
695
+ function open_resource(resource_path: string): void;
696
+ /**
697
+ * A paragraph of text
698
+ *
699
+ * @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:
700
+ * - `editor.ui.TEXT_ALIGNMENT.LEFT`
701
+ * - `editor.ui.TEXT_ALIGNMENT.CENTER`
702
+ * - `editor.ui.TEXT_ALIGNMENT.RIGHT`
703
+ * - `editor.ui.TEXT_ALIGNMENT.JUSTIFY``color string`semantic color, defaults to `editor.ui.COLOR.TEXT`; either:
704
+ * - `editor.ui.COLOR.TEXT`
705
+ * - `editor.ui.COLOR.HINT`
706
+ * - `editor.ui.COLOR.OVERRIDE`
707
+ * - `editor.ui.COLOR.WARNING`
708
+ * - `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:
709
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
710
+ * - `editor.ui.ALIGNMENT.TOP`
711
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
712
+ * - `editor.ui.ALIGNMENT.LEFT`
713
+ * - `editor.ui.ALIGNMENT.CENTER`
714
+ * - `editor.ui.ALIGNMENT.RIGHT`
715
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
716
+ * - `editor.ui.ALIGNMENT.BOTTOM`
717
+ * - `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.
718
+ * @returns UI component
719
+ */
720
+ function paragraph(props: Record<string | number, unknown>): Opaque<"component">;
721
+ /**
722
+ * Input component for selecting project resources
723
+ *
724
+ * @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:
725
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
726
+ * - `editor.ui.ALIGNMENT.TOP`
727
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
728
+ * - `editor.ui.ALIGNMENT.LEFT`
729
+ * - `editor.ui.ALIGNMENT.CENTER`
730
+ * - `editor.ui.ALIGNMENT.RIGHT`
731
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
732
+ * - `editor.ui.ALIGNMENT.BOTTOM`
733
+ * - `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.
734
+ * @returns UI component
735
+ */
736
+ function resource_field(props: Record<string | number, unknown>): Opaque<"component">;
737
+ /**
738
+ * Layout container that optionally shows scroll bars if child contents overflow the assigned bounds
739
+ *
740
+ * @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.
741
+ * @returns UI component
742
+ */
743
+ function scroll(props: Record<string | number, unknown>): Opaque<"component">;
744
+ /**
745
+ * Dropdown select box with an array of options
746
+ *
747
+ * @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:
748
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
749
+ * - `editor.ui.ALIGNMENT.TOP`
750
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
751
+ * - `editor.ui.ALIGNMENT.LEFT`
752
+ * - `editor.ui.ALIGNMENT.CENTER`
753
+ * - `editor.ui.ALIGNMENT.RIGHT`
754
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
755
+ * - `editor.ui.ALIGNMENT.BOTTOM`
756
+ * - `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.
757
+ * @returns UI component
758
+ */
759
+ function select_box(props: Record<string | number, unknown>): Opaque<"component">;
760
+ /**
761
+ * Thin line for visual content separation, by default horizontal and aligned to center
762
+ *
763
+ * @param props - Optional props: `orientation string`separator line orientation, `editor.ui.ORIENTATION.VERTICAL` or `editor.ui.ORIENTATION.HORIZONTAL`; either:
764
+ * - `editor.ui.ORIENTATION.VERTICAL`
765
+ * - `editor.ui.ORIENTATION.HORIZONTAL``alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
766
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
767
+ * - `editor.ui.ALIGNMENT.TOP`
768
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
769
+ * - `editor.ui.ALIGNMENT.LEFT`
770
+ * - `editor.ui.ALIGNMENT.CENTER`
771
+ * - `editor.ui.ALIGNMENT.RIGHT`
772
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
773
+ * - `editor.ui.ALIGNMENT.BOTTOM`
774
+ * - `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.
775
+ * @returns UI component
776
+ */
777
+ function separator(props: Record<string | number, unknown>): Opaque<"component">;
778
+ /**
779
+ * Show a modal dialog and await a result
780
+ *
781
+ * @param dialog - a component that resolves to `editor.ui.dialog(...)`
782
+ * @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
783
+ */
784
+ function show_dialog(dialog: Opaque<"component">): unknown;
785
+ /**
786
+ * Show a modal OS directory selection dialog and await a result
787
+ *
788
+ * @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
789
+ * @returns either absolute directory path or nil if user canceled directory selection
790
+ */
791
+ function show_external_directory_dialog(opts?: Record<string | number, unknown>): string | undefined;
792
+ /**
793
+ * Show a modal OS file selection dialog and await a result
794
+ *
795
+ * @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"`
796
+ * @returns either absolute file path or nil if user canceled file selection
797
+ */
798
+ function show_external_file_dialog(opts?: Record<string | number, unknown>): string | undefined;
799
+ /**
800
+ * Show a modal resource selection dialog and await a result
801
+ *
802
+ * @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")`
803
+ * @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.
804
+ */
805
+ function show_resource_dialog(opts?: Record<string | number, unknown>): unknown;
806
+ /**
807
+ * String input component based on a text field, reports changes on commit (`Enter` or focus loss)
808
+ *
809
+ * @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:
810
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
811
+ * - `editor.ui.ALIGNMENT.TOP`
812
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
813
+ * - `editor.ui.ALIGNMENT.LEFT`
814
+ * - `editor.ui.ALIGNMENT.CENTER`
815
+ * - `editor.ui.ALIGNMENT.RIGHT`
816
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
817
+ * - `editor.ui.ALIGNMENT.BOTTOM`
818
+ * - `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.
819
+ * @returns UI component
820
+ */
821
+ function string_field(props: Record<string | number, unknown>): Opaque<"component">;
822
+ /**
823
+ * A hook that caches the result of a computation between re-renders.
824
+ * 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.
825
+ *
826
+ * @param compute - function that will be used to compute the cached value
827
+ * @param args - args to the computation function
828
+ * @returns all returned values of the compute function
829
+ * @example
830
+ * ```ts
831
+ * function increment(n: unknown): number {
832
+ * return (n as number) + 1;
833
+ * }
834
+ *
835
+ * function makeListener(setCount: unknown) {
836
+ * return () => {
837
+ * (setCount as (update: unknown) => unknown)(increment);
838
+ * };
839
+ * }
840
+ *
841
+ * const counterButton = editor.ui.component((props) => {
842
+ * const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
843
+ * const onPressed = editor.ui.use_memo(makeListener, setCount);
844
+ * return editor.ui.button({
845
+ * text: tostring(count),
846
+ * on_pressed: onPressed,
847
+ * });
848
+ * });
849
+ * ```
850
+ */
851
+ function use_memo(compute: (...args: unknown[]) => unknown, ...args: unknown[]): unknown;
852
+ /**
853
+ * A hook that adds local state to the component.
854
+ * 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.
855
+ *
856
+ * @param init - local state initializer, either initial data structure or function that produces the data structure
857
+ * @param args - used when `init` is a function, the args are passed to the initializer function
858
+ * @example
859
+ * ```ts
860
+ * function increment(n: unknown): number {
861
+ * return (n as number) + 1;
862
+ * }
863
+ *
864
+ * const counterButton = editor.ui.component((props) => {
865
+ * const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
866
+ * return editor.ui.button({
867
+ * text: tostring(count),
868
+ * on_pressed: () => {
869
+ * setCount(increment);
870
+ * },
871
+ * });
872
+ * });
873
+ * ```
874
+ */
875
+ function use_state(init: unknown, ...args: unknown[]): LuaMultiReturn<[unknown, (...args: unknown[]) => unknown]>;
876
+ /**
877
+ * Layout container that places its children in a vertical column one after another
878
+ *
879
+ * @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:
880
+ * - `editor.ui.PADDING.NONE`
881
+ * - `editor.ui.PADDING.SMALL`
882
+ * - `editor.ui.PADDING.MEDIUM`
883
+ * - `editor.ui.PADDING.LARGE`
884
+ * - non-negative number, pixels`spacing string, number`empty space between child components, defaults to `editor.ui.SPACING.MEDIUM`; either:
885
+ * - `editor.ui.SPACING.NONE`
886
+ * - `editor.ui.SPACING.SMALL`
887
+ * - `editor.ui.SPACING.MEDIUM`
888
+ * - `editor.ui.SPACING.LARGE`
889
+ * - non-negative number, pixels`alignment string`alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`; either:
890
+ * - `editor.ui.ALIGNMENT.TOP_LEFT`
891
+ * - `editor.ui.ALIGNMENT.TOP`
892
+ * - `editor.ui.ALIGNMENT.TOP_RIGHT`
893
+ * - `editor.ui.ALIGNMENT.LEFT`
894
+ * - `editor.ui.ALIGNMENT.CENTER`
895
+ * - `editor.ui.ALIGNMENT.RIGHT`
896
+ * - `editor.ui.ALIGNMENT.BOTTOM_LEFT`
897
+ * - `editor.ui.ALIGNMENT.BOTTOM`
898
+ * - `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.
899
+ * @returns UI component
900
+ */
901
+ function vertical(props: Record<string | number, unknown>): Opaque<"component">;
902
+ namespace ALIGNMENT {
903
+ /**
904
+ * `"bottom"`
905
+ */
906
+ const BOTTOM: unknown;
907
+ /**
908
+ * `"bottom-left"`
909
+ */
910
+ const BOTTOM_LEFT: unknown;
911
+ /**
912
+ * `"bottom-right"`
913
+ */
914
+ const BOTTOM_RIGHT: unknown;
915
+ /**
916
+ * `"center"`
917
+ */
918
+ const CENTER: unknown;
919
+ /**
920
+ * `"left"`
921
+ */
922
+ const LEFT: unknown;
923
+ /**
924
+ * `"right"`
925
+ */
926
+ const RIGHT: unknown;
927
+ /**
928
+ * `"top"`
929
+ */
930
+ const TOP: unknown;
931
+ /**
932
+ * `"top-left"`
933
+ */
934
+ const TOP_LEFT: unknown;
935
+ /**
936
+ * `"top-right"`
937
+ */
938
+ const TOP_RIGHT: unknown;
939
+ }
940
+ namespace COLOR {
941
+ /**
942
+ * `"error"`
943
+ */
944
+ const ERROR: unknown;
945
+ /**
946
+ * `"hint"`
947
+ */
948
+ const HINT: unknown;
949
+ /**
950
+ * `"override"`
951
+ */
952
+ const OVERRIDE: unknown;
953
+ /**
954
+ * `"text"`
955
+ */
956
+ const TEXT: unknown;
957
+ /**
958
+ * `"warning"`
959
+ */
960
+ const WARNING: unknown;
961
+ }
962
+ namespace HEADING_STYLE {
963
+ /**
964
+ * `"dialog"`
965
+ */
966
+ const DIALOG: unknown;
967
+ /**
968
+ * `"form"`
969
+ */
970
+ const FORM: unknown;
971
+ /**
972
+ * `"h1"`
973
+ */
974
+ const H1: unknown;
975
+ /**
976
+ * `"h2"`
977
+ */
978
+ const H2: unknown;
979
+ /**
980
+ * `"h3"`
981
+ */
982
+ const H3: unknown;
983
+ /**
984
+ * `"h4"`
985
+ */
986
+ const H4: unknown;
987
+ /**
988
+ * `"h5"`
989
+ */
990
+ const H5: unknown;
991
+ /**
992
+ * `"h6"`
993
+ */
994
+ const H6: unknown;
995
+ }
996
+ namespace ICON {
997
+ /**
998
+ * `"clear"`
999
+ */
1000
+ const CLEAR: unknown;
1001
+ /**
1002
+ * `"minus"`
1003
+ */
1004
+ const MINUS: unknown;
1005
+ /**
1006
+ * `"open-resource"`
1007
+ */
1008
+ const OPEN_RESOURCE: unknown;
1009
+ /**
1010
+ * `"plus"`
1011
+ */
1012
+ const PLUS: unknown;
1013
+ }
1014
+ namespace ISSUE_SEVERITY {
1015
+ /**
1016
+ * `"error"`
1017
+ */
1018
+ const ERROR: unknown;
1019
+ /**
1020
+ * `"warning"`
1021
+ */
1022
+ const WARNING: unknown;
1023
+ }
1024
+ namespace ORIENTATION {
1025
+ /**
1026
+ * `"horizontal"`
1027
+ */
1028
+ const HORIZONTAL: unknown;
1029
+ /**
1030
+ * `"vertical"`
1031
+ */
1032
+ const VERTICAL: unknown;
1033
+ }
1034
+ namespace PADDING {
1035
+ /**
1036
+ * `"large"`
1037
+ */
1038
+ const LARGE: unknown;
1039
+ /**
1040
+ * `"medium"`
1041
+ */
1042
+ const MEDIUM: unknown;
1043
+ /**
1044
+ * `"none"`
1045
+ */
1046
+ const NONE: unknown;
1047
+ /**
1048
+ * `"small"`
1049
+ */
1050
+ const SMALL: unknown;
1051
+ }
1052
+ namespace SPACING {
1053
+ /**
1054
+ * `"large"`
1055
+ */
1056
+ const LARGE: unknown;
1057
+ /**
1058
+ * `"medium"`
1059
+ */
1060
+ const MEDIUM: unknown;
1061
+ /**
1062
+ * `"none"`
1063
+ */
1064
+ const NONE: unknown;
1065
+ /**
1066
+ * `"small"`
1067
+ */
1068
+ const SMALL: unknown;
1069
+ }
1070
+ namespace TEXT_ALIGNMENT {
1071
+ /**
1072
+ * `"center"`
1073
+ */
1074
+ const CENTER: unknown;
1075
+ /**
1076
+ * `"justify"`
1077
+ */
1078
+ const JUSTIFY: unknown;
1079
+ /**
1080
+ * `"left"`
1081
+ */
1082
+ const LEFT: unknown;
1083
+ /**
1084
+ * `"right"`
1085
+ */
1086
+ const RIGHT: unknown;
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+
1092
+ export {};