@defold-typescript/types 0.40.0 → 0.42.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.
- package/api-availability.json +3963 -772
- package/api-migrations.json +27 -0
- package/api-signatures.json +18069 -10240
- package/api-targets.json +448 -11
- package/examples/translations.json +560 -89
- package/fixtures/messages_doc.json +96 -0
- package/generated/b2d.d.ts +680 -4
- package/generated/b2d_body.d.ts +29 -103
- package/generated/b2d_chain.d.ts +5 -6
- package/generated/b2d_fixture.d.ts +34 -38
- package/generated/b2d_joint.d.ts +503 -25
- package/generated/b2d_shape.d.ts +183 -20
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +16 -15
- package/generated/builtin-messages.d.ts +7 -1
- package/generated/bullet3d.d.ts +91 -0
- package/generated/bullet3d_collision_object.d.ts +433 -0
- package/generated/bullet3d_constraint.d.ts +818 -0
- package/generated/bullet3d_rigid_body.d.ts +429 -0
- package/generated/bullet3d_shape.d.ts +123 -0
- package/generated/bullet3d_world.d.ts +492 -0
- package/generated/camera.d.ts +29 -32
- package/generated/collectionfactory.d.ts +15 -18
- package/generated/collectionproxy.d.ts +22 -6
- package/generated/compute.d.ts +12 -238
- package/generated/crash.d.ts +24 -10
- package/generated/editor-vm/http.d.ts +90 -7
- package/generated/editor-vm/image.d.ts +7 -7
- package/generated/editor-vm/json.d.ts +11 -0
- package/generated/editor-vm/localization.d.ts +7 -7
- package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
- package/generated/editor-vm/zip.d.ts +28 -0
- package/generated/editor.d.ts +1496 -430
- package/generated/factory.d.ts +21 -25
- package/generated/font.d.ts +64 -22
- package/generated/go.d.ts +235 -182
- package/generated/graphics.d.ts +335 -97
- package/generated/gui.d.ts +240 -471
- package/generated/html5.d.ts +2 -2
- package/generated/http.d.ts +28 -35
- package/generated/image.d.ts +105 -72
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +7 -0
- package/generated/kinds/render-script.d.ts +7 -0
- package/generated/kinds/script.d.ts +7 -0
- package/generated/label.d.ts +77 -7
- package/generated/liveupdate.d.ts +13 -10
- package/generated/material.d.ts +312 -360
- package/generated/model.d.ts +40 -39
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +365 -133
- package/generated/profiler.d.ts +13 -23
- package/generated/render.d.ts +237 -297
- package/generated/resource.d.ts +664 -583
- package/generated/socket.d.ts +120 -133
- package/generated/sound.d.ts +62 -31
- package/generated/sprite.d.ts +31 -17
- package/generated/sys.d.ts +234 -190
- package/generated/tilemap.d.ts +21 -16
- package/generated/timer.d.ts +34 -21
- package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
- package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
- package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
- package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
- package/generated/versions/defold-1.12.4/go.d.ts +6 -12
- package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
- package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
- package/generated/versions/defold-1.12.4/http.d.ts +0 -13
- package/generated/versions/defold-1.12.4/image.d.ts +16 -33
- package/generated/versions/defold-1.12.4/index.d.ts +1 -0
- package/generated/versions/defold-1.12.4/json.d.ts +10 -6
- package/generated/versions/defold-1.12.4/label.d.ts +2 -3
- package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
- package/generated/versions/defold-1.12.4/model.d.ts +2 -10
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
- package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
- package/generated/versions/defold-1.12.4/render.d.ts +99 -128
- package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
- package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
- package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
- package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
- package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
- package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
- package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
- package/generated/versions/defold-1.12.4/window.d.ts +1 -16
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
- package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
- package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
- package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
- package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
- package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
- package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
- package/generated/versions/defold-1.13.0/go.d.ts +6 -12
- package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
- package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
- package/generated/versions/defold-1.13.0/http.d.ts +0 -13
- package/generated/versions/defold-1.13.0/image.d.ts +16 -33
- package/generated/versions/defold-1.13.0/index.d.ts +1 -0
- package/generated/versions/defold-1.13.0/json.d.ts +10 -6
- package/generated/versions/defold-1.13.0/label.d.ts +2 -3
- package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
- package/generated/versions/defold-1.13.0/material.d.ts +68 -106
- package/generated/versions/defold-1.13.0/model.d.ts +2 -10
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
- package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
- package/generated/versions/defold-1.13.0/render.d.ts +99 -128
- package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
- package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
- package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
- package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
- package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
- package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
- package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
- package/generated/versions/defold-1.13.0/window.d.ts +1 -16
- package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
- package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
- package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
- package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
- package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
- package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
- package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
- package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
- package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
- package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
- package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
- package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
- package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
- package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
- package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
- package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
- package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
- package/generated/versions/defold-1.13.1/font.d.ts +81 -0
- package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
- package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
- package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
- package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.1/http.d.ts +77 -0
- package/generated/versions/defold-1.13.1/image.d.ts +131 -0
- package/generated/versions/defold-1.13.1/index.d.ts +57 -0
- package/generated/versions/defold-1.13.1/json.d.ts +80 -0
- package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.1/label.d.ts +93 -0
- package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
- package/generated/versions/defold-1.13.1/material.d.ts +408 -0
- package/generated/versions/defold-1.13.1/model.d.ts +272 -0
- package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
- package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
- package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
- package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
- package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
- package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
- package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
- package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
- package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
- package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
- package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
- package/generated/versions/defold-1.13.1/types.d.ts +61 -0
- package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
- package/generated/versions/defold-1.13.1/window.d.ts +183 -0
- package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
- package/generated/vmath.d.ts +1 -21
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +7 -0
- package/package.json +18 -2
- package/scripts/example-store-io.ts +12 -1
- package/scripts/extension-goldens.ts +1 -0
- package/scripts/fidelity-baseline.json +146 -46
- package/scripts/generate-api-availability.ts +90 -12
- package/scripts/generate-api-signatures.ts +12 -2
- package/scripts/import-defold-release.ts +106 -26
- package/scripts/prose-constants.ts +77 -16
- package/scripts/regen.ts +391 -77
- package/scripts/shared-handle-methods.ts +53 -0
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +48 -10
- package/src/api-availability.ts +0 -0
- package/src/api-doc.ts +201 -3
- package/src/api-identity.ts +252 -0
- package/src/core-types.ts +26 -3
- package/src/correction-pins.ts +49 -0
- package/src/doc-comment.ts +104 -11
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2064 -281
- package/src/emit-messages.ts +52 -0
- package/src/example-store.ts +125 -14
- package/src/field-correction-coverage.ts +204 -0
- package/src/fnv1a.ts +16 -0
- package/src/go-overloads.d.ts +25 -6
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +38 -5
- package/src/library-index-slot-classifications.ts +332 -0
- package/src/lifecycle.ts +61 -199
- package/src/luals-type-expr.ts +354 -0
- package/src/msg-overloads.d.ts +0 -1
- package/src/param-correction-provenance.ts +8 -11
- package/src/render-overloads.d.ts +0 -15
- package/src/return-correction-provenance.ts +58 -16
- package/src/sys-overloads.d.ts +48 -0
- package/src/vmath-overloads.d.ts +27 -1
- package/src/window-event-guard.d.ts +6 -9
- package/url-parameters.json +1 -2
package/generated/editor.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ declare global {
|
|
|
6
6
|
* Editor scripting documentation
|
|
7
7
|
*/
|
|
8
8
|
namespace editor {
|
|
9
|
+
type command = Opaque<"command">;
|
|
10
|
+
type component = Opaque<"component">;
|
|
11
|
+
type image = Opaque<"editor.image">;
|
|
12
|
+
type message = Opaque<"message">;
|
|
13
|
+
type schema = Opaque<"editor.schema">;
|
|
14
|
+
type tiles = Opaque<"editor.tiles">;
|
|
15
|
+
type transaction_step = Opaque<"transaction_step">;
|
|
9
16
|
/**
|
|
10
17
|
* A string, SHA1 of Defold editor
|
|
11
18
|
*/
|
|
@@ -22,7 +29,7 @@ declare global {
|
|
|
22
29
|
* - `"arm64-macos"`
|
|
23
30
|
* - `"x86_64-linux"`
|
|
24
31
|
*/
|
|
25
|
-
const platform:
|
|
32
|
+
const platform: "x86_64-win32" | "x86_64-macos" | "arm64-macos" | "x86_64-linux";
|
|
26
33
|
/**
|
|
27
34
|
* A string, version name of Defold
|
|
28
35
|
*/
|
|
@@ -32,27 +39,31 @@ declare global {
|
|
|
32
39
|
* For the full documentation of the available commands and options, see the bob manual.
|
|
33
40
|
*
|
|
34
41
|
* @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
|
|
42
|
+
* @param args - bob commands, e.g. `"resolve"` or `"build"`
|
|
36
43
|
* @example
|
|
44
|
+
* Print help in the console:
|
|
37
45
|
* ```ts
|
|
38
|
-
* // Print help in the console:
|
|
39
46
|
* editor.bob({ help: true });
|
|
40
|
-
*
|
|
41
|
-
*
|
|
47
|
+
* ```
|
|
48
|
+
* @example
|
|
49
|
+
* Bundle the game for the host platform:
|
|
50
|
+
* ```ts
|
|
42
51
|
* const opts = { archive: true, platform: editor.platform };
|
|
43
52
|
* editor.bob(opts, "distclean", "resolve", "build", "bundle");
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
53
|
+
* ```
|
|
54
|
+
* @example
|
|
55
|
+
* Using snake_cased and repeated options:
|
|
56
|
+
* ```ts
|
|
57
|
+
* const opts = {
|
|
47
58
|
* archive: true,
|
|
48
59
|
* platform: editor.platform,
|
|
49
60
|
* build_server: "https://build.my-company.com",
|
|
50
61
|
* settings: ["test.ini", "headless.ini"],
|
|
51
62
|
* };
|
|
52
|
-
* editor.bob(
|
|
63
|
+
* editor.bob(opts, "distclean", "resolve", "build");
|
|
53
64
|
* ```
|
|
54
65
|
*/
|
|
55
|
-
function bob(options?:
|
|
66
|
+
function bob(options?: LuaMap<string, string | number | boolean | (string | number | boolean)[]> | Record<string, string | number | boolean | (string | number | boolean)[]>, ...args: string[]): void;
|
|
56
67
|
/**
|
|
57
68
|
* Open a URL in the default browser or a registered application
|
|
58
69
|
*
|
|
@@ -109,20 +120,24 @@ declare global {
|
|
|
109
120
|
* Create resources (including non-existent parent directories).
|
|
110
121
|
* Throws an error if any of the provided resource paths already exist
|
|
111
122
|
*
|
|
112
|
-
* @param resources -
|
|
123
|
+
* @param resources - resource paths (strings starting with `/`) or pairs containing a resource path and optional content
|
|
113
124
|
* @example
|
|
125
|
+
* Create a single resource from template:
|
|
114
126
|
* ```ts
|
|
115
|
-
* // Create a single resource from template:
|
|
116
127
|
* editor.create_resources(["/npc.go"]);
|
|
117
|
-
*
|
|
118
|
-
*
|
|
128
|
+
* ```
|
|
129
|
+
* @example
|
|
130
|
+
* Create multiple resources:
|
|
131
|
+
* ```ts
|
|
119
132
|
* editor.create_resources(["/npc.go", "/levels/1.collection", "/levels/2.collection"]);
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
133
|
+
* ```
|
|
134
|
+
* @example
|
|
135
|
+
* Create a resource with custom content:
|
|
136
|
+
* ```ts
|
|
137
|
+
* editor.create_resources([{ 1: "/npc.script", 2: "go.property('hp', 100)" }]);
|
|
123
138
|
* ```
|
|
124
139
|
*/
|
|
125
|
-
function create_resources(resources:
|
|
140
|
+
function create_resources(resources: (string | editor.create_resources.resource)[]): void;
|
|
126
141
|
/**
|
|
127
142
|
* Delete a directory if it exists, and all existent child directories and files.
|
|
128
143
|
* Throws an error if the directory can't be deleted.
|
|
@@ -141,37 +156,30 @@ declare global {
|
|
|
141
156
|
*
|
|
142
157
|
* @param command - Shell command name to execute
|
|
143
158
|
* @param args - Optional shell command arguments
|
|
144
|
-
* @param options -
|
|
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.
|
|
159
|
+
* @param options - execution options
|
|
154
160
|
* @returns If `out` option is set to `"capture"`, returns the output as string with trimmed trailing newlines. Otherwise, returns `nil`.
|
|
155
161
|
* @example
|
|
162
|
+
* Make a directory with spaces in it:
|
|
156
163
|
* ```ts
|
|
157
|
-
* // Make a directory with spaces in it:
|
|
158
164
|
* editor.execute("mkdir", "new dir");
|
|
159
|
-
*
|
|
160
|
-
*
|
|
165
|
+
* ```
|
|
166
|
+
* @example
|
|
167
|
+
* Read the git status:
|
|
168
|
+
* ```ts
|
|
161
169
|
* const status = editor.execute("git", "status", "--porcelain", {
|
|
162
170
|
* reload_resources: false,
|
|
163
171
|
* out: "capture",
|
|
164
172
|
* });
|
|
165
173
|
* ```
|
|
166
174
|
*/
|
|
167
|
-
function execute(command: string, ...args: (string |
|
|
175
|
+
function execute(command: string, ...args: (string | editor.execute.options)[]): undefined | string;
|
|
168
176
|
/**
|
|
169
177
|
* Query information about file system path
|
|
170
178
|
*
|
|
171
179
|
* @param path - External file path, resolved against project root if relative
|
|
172
|
-
* @returns
|
|
180
|
+
* @returns external file attributes
|
|
173
181
|
*/
|
|
174
|
-
function external_file_attributes(path: string):
|
|
182
|
+
function external_file_attributes(path: string): editor.external_file_attributes.result;
|
|
175
183
|
/**
|
|
176
184
|
* Download the latest version of the project library dependencies and reload library-provided editor scripts.
|
|
177
185
|
* 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.
|
|
@@ -197,16 +205,16 @@ declare global {
|
|
|
197
205
|
* 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
206
|
*
|
|
199
207
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
200
|
-
* @returns
|
|
208
|
+
* @returns sorted unique editor property names available in the current context
|
|
201
209
|
*/
|
|
202
|
-
function properties(node: string | Opaque<"userdata">):
|
|
210
|
+
function properties(node: string | Opaque<"userdata">): string[];
|
|
203
211
|
/**
|
|
204
212
|
* Query information about a project resource
|
|
205
213
|
*
|
|
206
214
|
* @param resource_path - Resource path (starting with `/`)
|
|
207
|
-
* @returns
|
|
215
|
+
* @returns resource attributes
|
|
208
216
|
*/
|
|
209
|
-
function resource_attributes(resource_path: string):
|
|
217
|
+
function resource_attributes(resource_path: string): editor.resource_attributes.result;
|
|
210
218
|
/**
|
|
211
219
|
* Persist any unsaved changes to disk
|
|
212
220
|
*/
|
|
@@ -214,10 +222,146 @@ declare global {
|
|
|
214
222
|
/**
|
|
215
223
|
* Change the editor state in a single, undoable transaction
|
|
216
224
|
*
|
|
217
|
-
* @param txs -
|
|
225
|
+
* @param txs - An array of transaction steps created using `editor.tx.*` functions
|
|
218
226
|
*/
|
|
219
227
|
function transact(txs: Opaque<"transaction_step">[]): void;
|
|
228
|
+
namespace command {
|
|
229
|
+
/**
|
|
230
|
+
* Context provided to editor command handler functions
|
|
231
|
+
*/
|
|
232
|
+
interface context {
|
|
233
|
+
/**
|
|
234
|
+
* current selection, populated when requested by the command query
|
|
235
|
+
*/
|
|
236
|
+
selection?: string | Opaque<"userdata"> | (string | Opaque<"userdata">)[];
|
|
237
|
+
/**
|
|
238
|
+
* current active editor view, populated when requested by the command query
|
|
239
|
+
*/
|
|
240
|
+
active_view?: Opaque<"userdata">;
|
|
241
|
+
/**
|
|
242
|
+
* command argument, populated when requested by the command query
|
|
243
|
+
*/
|
|
244
|
+
argument?: unknown;
|
|
245
|
+
}
|
|
246
|
+
type location = "Assets" | "Bundle" | "Code" | "Debug" | "Edit" | "Help" | "Outline" | "Project" | "Scene" | "View";
|
|
247
|
+
/**
|
|
248
|
+
* Options used to create an editor command
|
|
249
|
+
*/
|
|
250
|
+
interface options {
|
|
251
|
+
/**
|
|
252
|
+
* user-visible command name, either a string or a localization message
|
|
253
|
+
*/
|
|
254
|
+
label: string | Opaque<"message">;
|
|
255
|
+
/**
|
|
256
|
+
* non-empty list of locations where the command is displayed
|
|
257
|
+
*/
|
|
258
|
+
locations: editor.command.location[];
|
|
259
|
+
/**
|
|
260
|
+
* query that controls command availability and provides context to its handler functions
|
|
261
|
+
*/
|
|
262
|
+
query?: editor.command.query;
|
|
263
|
+
/**
|
|
264
|
+
* keyword identifier that may be used for assigning a shortcut to a command; should be a dot-separated identifier string, e.g. `"my-extension.do-stuff"`
|
|
265
|
+
*/
|
|
266
|
+
id?: string;
|
|
267
|
+
/**
|
|
268
|
+
* function that additionally checks if a command is active in the current context; should be fast to execute since the editor might invoke it in response to UI interactions
|
|
269
|
+
*/
|
|
270
|
+
active?: (opts: editor.command.context) => boolean;
|
|
271
|
+
/**
|
|
272
|
+
* function that is invoked when the user decides to execute the command
|
|
273
|
+
*/
|
|
274
|
+
run?: (opts: editor.command.context) => unknown;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* A query that controls command availability and provides context to its handler functions
|
|
278
|
+
*/
|
|
279
|
+
interface query {
|
|
280
|
+
/**
|
|
281
|
+
* current selection request
|
|
282
|
+
*/
|
|
283
|
+
selection?: editor.command.query.selection;
|
|
284
|
+
/**
|
|
285
|
+
* current active editor view request
|
|
286
|
+
*/
|
|
287
|
+
active_view?: editor.command.query.active_view;
|
|
288
|
+
/**
|
|
289
|
+
* set to true to provide the command argument to the handler functions
|
|
290
|
+
*/
|
|
291
|
+
argument?: true;
|
|
292
|
+
}
|
|
293
|
+
namespace query {
|
|
294
|
+
/**
|
|
295
|
+
* Active editor view requested by an editor command
|
|
296
|
+
*/
|
|
297
|
+
interface active_view {
|
|
298
|
+
/**
|
|
299
|
+
* active editor view type
|
|
300
|
+
*/
|
|
301
|
+
type: "code" | "scene" | "html" | "form";
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Selection requested by an editor command
|
|
305
|
+
*/
|
|
306
|
+
interface selection {
|
|
307
|
+
/**
|
|
308
|
+
* selection type
|
|
309
|
+
*/
|
|
310
|
+
type: "resource" | "outline" | "scene";
|
|
311
|
+
/**
|
|
312
|
+
* either the first selected item or all selected items
|
|
313
|
+
*/
|
|
314
|
+
cardinality: "one" | "many";
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
namespace create_resources {
|
|
319
|
+
type resource = { 1: string; 2?: string };
|
|
320
|
+
}
|
|
321
|
+
namespace execute {
|
|
322
|
+
/**
|
|
323
|
+
* Options for editor.execute
|
|
324
|
+
*/
|
|
325
|
+
interface options {
|
|
326
|
+
/**
|
|
327
|
+
* whether the editor reloads resources from disk after the command is executed; defaults to true
|
|
328
|
+
*/
|
|
329
|
+
reload_resources?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* standard output mode; defaults to `"pipe"`
|
|
332
|
+
*/
|
|
333
|
+
out?: "pipe" | "capture" | "discard";
|
|
334
|
+
/**
|
|
335
|
+
* standard error output mode; defaults to `"pipe"`
|
|
336
|
+
*/
|
|
337
|
+
err?: "pipe" | "stdout" | "discard";
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
namespace external_file_attributes {
|
|
341
|
+
/**
|
|
342
|
+
* External file attributes
|
|
343
|
+
*/
|
|
344
|
+
interface result {
|
|
345
|
+
/**
|
|
346
|
+
* resolved file path
|
|
347
|
+
*/
|
|
348
|
+
path: string;
|
|
349
|
+
/**
|
|
350
|
+
* whether there is a file system entry at the path
|
|
351
|
+
*/
|
|
352
|
+
exists: boolean;
|
|
353
|
+
/**
|
|
354
|
+
* whether the path corresponds to a file
|
|
355
|
+
*/
|
|
356
|
+
is_file: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* whether the path corresponds to a directory
|
|
359
|
+
*/
|
|
360
|
+
is_directory: boolean;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
220
363
|
namespace prefs {
|
|
364
|
+
type SCOPE = typeof editor.prefs.SCOPE.GLOBAL | typeof editor.prefs.SCOPE.PROJECT;
|
|
221
365
|
/**
|
|
222
366
|
* Get preference value
|
|
223
367
|
* The schema for the preference value should be defined beforehand.
|
|
@@ -246,135 +390,355 @@ declare global {
|
|
|
246
390
|
/**
|
|
247
391
|
* array schema
|
|
248
392
|
*
|
|
249
|
-
* @param opts -
|
|
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
|
|
393
|
+
* @param opts - schema options
|
|
252
394
|
* @returns Prefs schema
|
|
253
395
|
*/
|
|
254
|
-
export function array(opts:
|
|
396
|
+
export function array(opts: editor.prefs.schema.array.options): editor.schema;
|
|
255
397
|
/**
|
|
256
398
|
* boolean schema
|
|
257
399
|
*
|
|
258
|
-
* @param opts -
|
|
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
|
|
400
|
+
* @param opts - schema options
|
|
261
401
|
* @returns Prefs schema
|
|
262
402
|
*/
|
|
263
|
-
export function boolean(opts?:
|
|
403
|
+
export function boolean(opts?: editor.prefs.schema.boolean.options): editor.schema;
|
|
264
404
|
/**
|
|
265
405
|
* enum value schema
|
|
266
406
|
*
|
|
267
|
-
* @param opts -
|
|
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
|
|
407
|
+
* @param opts - schema options
|
|
270
408
|
* @returns Prefs schema
|
|
271
409
|
*/
|
|
272
|
-
function _enum(opts:
|
|
410
|
+
function _enum(opts: editor.prefs.schema.enum.options): editor.schema;
|
|
273
411
|
/**
|
|
274
412
|
* integer schema
|
|
275
413
|
*
|
|
276
|
-
* @param opts -
|
|
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
|
|
414
|
+
* @param opts - schema options
|
|
279
415
|
* @returns Prefs schema
|
|
280
416
|
*/
|
|
281
|
-
export function integer(opts?:
|
|
417
|
+
export function integer(opts?: editor.prefs.schema.integer.options): editor.schema;
|
|
282
418
|
/**
|
|
283
419
|
* keyword schema
|
|
284
420
|
* A keyword is a short string that is interned within the editor runtime, useful e.g. for identifiers
|
|
285
421
|
*
|
|
286
|
-
* @param opts -
|
|
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
|
|
422
|
+
* @param opts - schema options
|
|
289
423
|
* @returns Prefs schema
|
|
290
424
|
*/
|
|
291
|
-
export function keyword(opts?:
|
|
425
|
+
export function keyword(opts?: editor.prefs.schema.keyword.options): editor.schema;
|
|
292
426
|
/**
|
|
293
427
|
* floating-point number schema
|
|
294
428
|
*
|
|
295
|
-
* @param opts -
|
|
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
|
|
429
|
+
* @param opts - schema options
|
|
298
430
|
* @returns Prefs schema
|
|
299
431
|
*/
|
|
300
|
-
export function number(opts?:
|
|
432
|
+
export function number(opts?: editor.prefs.schema.number.options): editor.schema;
|
|
301
433
|
/**
|
|
302
434
|
* heterogeneous object schema
|
|
303
435
|
*
|
|
304
|
-
* @param opts -
|
|
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
|
|
436
|
+
* @param opts - schema options
|
|
307
437
|
* @returns Prefs schema
|
|
308
438
|
*/
|
|
309
|
-
export function object(opts:
|
|
439
|
+
export function object(opts: editor.prefs.schema.object.options): editor.schema;
|
|
310
440
|
/**
|
|
311
441
|
* homogeneous object schema
|
|
312
442
|
*
|
|
313
|
-
* @param opts -
|
|
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
|
|
443
|
+
* @param opts - schema options
|
|
316
444
|
* @returns Prefs schema
|
|
317
445
|
*/
|
|
318
|
-
export function object_of(opts:
|
|
446
|
+
export function object_of(opts: editor.prefs.schema.object_of.options): editor.schema;
|
|
319
447
|
/**
|
|
320
448
|
* one of schema
|
|
321
449
|
*
|
|
322
|
-
* @param opts -
|
|
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
|
|
450
|
+
* @param opts - schema options
|
|
325
451
|
* @returns Prefs schema
|
|
326
452
|
*/
|
|
327
|
-
export function one_of(opts:
|
|
453
|
+
export function one_of(opts: editor.prefs.schema.one_of.options): editor.schema;
|
|
328
454
|
/**
|
|
329
455
|
* password schema
|
|
330
456
|
* A password is a string that is encrypted when stored in a preference file
|
|
331
457
|
*
|
|
332
|
-
* @param opts -
|
|
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
|
|
458
|
+
* @param opts - schema options
|
|
335
459
|
* @returns Prefs schema
|
|
336
460
|
*/
|
|
337
|
-
export function password(opts?:
|
|
461
|
+
export function password(opts?: editor.prefs.schema.password.options): editor.schema;
|
|
338
462
|
/**
|
|
339
463
|
* set schema
|
|
340
464
|
* Set is represented as a lua table with `true` values
|
|
341
465
|
*
|
|
342
|
-
* @param opts -
|
|
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
|
|
466
|
+
* @param opts - schema options
|
|
345
467
|
* @returns Prefs schema
|
|
346
468
|
*/
|
|
347
|
-
export function set(opts:
|
|
469
|
+
export function set(opts: editor.prefs.schema.set.options): editor.schema;
|
|
348
470
|
/**
|
|
349
471
|
* string schema
|
|
350
472
|
*
|
|
351
|
-
* @param opts -
|
|
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
|
|
473
|
+
* @param opts - schema options
|
|
354
474
|
* @returns Prefs schema
|
|
355
475
|
*/
|
|
356
|
-
export function string(opts?:
|
|
476
|
+
export function string(opts?: editor.prefs.schema.string.options): editor.schema;
|
|
357
477
|
/**
|
|
358
478
|
* tuple schema
|
|
359
479
|
* A tuple is a fixed-length array where each item has its own defined type
|
|
360
480
|
*
|
|
361
|
-
* @param opts -
|
|
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
|
|
481
|
+
* @param opts - schema options
|
|
364
482
|
* @returns Prefs schema
|
|
365
483
|
*/
|
|
366
|
-
export function tuple(opts:
|
|
484
|
+
export function tuple(opts: editor.prefs.schema.tuple.options): editor.schema;
|
|
367
485
|
export { _enum as enum };
|
|
486
|
+
export namespace array {
|
|
487
|
+
/**
|
|
488
|
+
* Options for editor.prefs.schema.array
|
|
489
|
+
*/
|
|
490
|
+
interface options {
|
|
491
|
+
/**
|
|
492
|
+
* array item schema
|
|
493
|
+
*/
|
|
494
|
+
item: editor.schema;
|
|
495
|
+
/**
|
|
496
|
+
* default value
|
|
497
|
+
*/
|
|
498
|
+
default?: unknown[];
|
|
499
|
+
/**
|
|
500
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
501
|
+
*/
|
|
502
|
+
scope?: editor.prefs.SCOPE;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
export namespace boolean {
|
|
506
|
+
/**
|
|
507
|
+
* Options for editor.prefs.schema.boolean
|
|
508
|
+
*/
|
|
509
|
+
interface options {
|
|
510
|
+
/**
|
|
511
|
+
* default value
|
|
512
|
+
*/
|
|
513
|
+
default?: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
516
|
+
*/
|
|
517
|
+
scope?: editor.prefs.SCOPE;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
namespace _enum {
|
|
521
|
+
/**
|
|
522
|
+
* Options for editor.prefs.schema.enum
|
|
523
|
+
*/
|
|
524
|
+
interface options {
|
|
525
|
+
/**
|
|
526
|
+
* allowed values, must be scalar (nil, boolean, number or string)
|
|
527
|
+
*/
|
|
528
|
+
values: (undefined | boolean | number | string)[];
|
|
529
|
+
/**
|
|
530
|
+
* default value
|
|
531
|
+
*/
|
|
532
|
+
default?: unknown;
|
|
533
|
+
/**
|
|
534
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
535
|
+
*/
|
|
536
|
+
scope?: editor.prefs.SCOPE;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
export namespace integer {
|
|
540
|
+
/**
|
|
541
|
+
* Options for editor.prefs.schema.integer
|
|
542
|
+
*/
|
|
543
|
+
interface options {
|
|
544
|
+
/**
|
|
545
|
+
* default value
|
|
546
|
+
*/
|
|
547
|
+
default?: number;
|
|
548
|
+
/**
|
|
549
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
550
|
+
*/
|
|
551
|
+
scope?: editor.prefs.SCOPE;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
export namespace keyword {
|
|
555
|
+
/**
|
|
556
|
+
* Options for editor.prefs.schema.keyword
|
|
557
|
+
*/
|
|
558
|
+
interface options {
|
|
559
|
+
/**
|
|
560
|
+
* default value
|
|
561
|
+
*/
|
|
562
|
+
default?: string;
|
|
563
|
+
/**
|
|
564
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
565
|
+
*/
|
|
566
|
+
scope?: editor.prefs.SCOPE;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
export namespace number {
|
|
570
|
+
/**
|
|
571
|
+
* Options for editor.prefs.schema.number
|
|
572
|
+
*/
|
|
573
|
+
interface options {
|
|
574
|
+
/**
|
|
575
|
+
* default value
|
|
576
|
+
*/
|
|
577
|
+
default?: number;
|
|
578
|
+
/**
|
|
579
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
580
|
+
*/
|
|
581
|
+
scope?: editor.prefs.SCOPE;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
export namespace object {
|
|
585
|
+
/**
|
|
586
|
+
* Options for editor.prefs.schema.object
|
|
587
|
+
*/
|
|
588
|
+
interface options {
|
|
589
|
+
/**
|
|
590
|
+
* a table from property key (string) to value schema
|
|
591
|
+
*/
|
|
592
|
+
properties: LuaTable<string, editor.schema>;
|
|
593
|
+
/**
|
|
594
|
+
* default value
|
|
595
|
+
*/
|
|
596
|
+
default?: LuaTable<string, unknown>;
|
|
597
|
+
/**
|
|
598
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
599
|
+
*/
|
|
600
|
+
scope?: editor.prefs.SCOPE;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
export namespace object_of {
|
|
604
|
+
/**
|
|
605
|
+
* Options for editor.prefs.schema.object_of
|
|
606
|
+
*/
|
|
607
|
+
interface options {
|
|
608
|
+
/**
|
|
609
|
+
* table key schema
|
|
610
|
+
*/
|
|
611
|
+
key: editor.schema;
|
|
612
|
+
/**
|
|
613
|
+
* table value schema
|
|
614
|
+
*/
|
|
615
|
+
val: editor.schema;
|
|
616
|
+
/**
|
|
617
|
+
* default value
|
|
618
|
+
*/
|
|
619
|
+
default?: LuaTable<AnyNotNil, unknown>;
|
|
620
|
+
/**
|
|
621
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
622
|
+
*/
|
|
623
|
+
scope?: editor.prefs.SCOPE;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
export namespace one_of {
|
|
627
|
+
/**
|
|
628
|
+
* Options for editor.prefs.schema.one_of
|
|
629
|
+
*/
|
|
630
|
+
interface options {
|
|
631
|
+
/**
|
|
632
|
+
* alternative schemas
|
|
633
|
+
*/
|
|
634
|
+
schemas: editor.schema[];
|
|
635
|
+
/**
|
|
636
|
+
* default value
|
|
637
|
+
*/
|
|
638
|
+
default?: unknown;
|
|
639
|
+
/**
|
|
640
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
641
|
+
*/
|
|
642
|
+
scope?: editor.prefs.SCOPE;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
export namespace password {
|
|
646
|
+
/**
|
|
647
|
+
* Options for editor.prefs.schema.password
|
|
648
|
+
*/
|
|
649
|
+
interface options {
|
|
650
|
+
/**
|
|
651
|
+
* default value
|
|
652
|
+
*/
|
|
653
|
+
default?: string;
|
|
654
|
+
/**
|
|
655
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
656
|
+
*/
|
|
657
|
+
scope?: editor.prefs.SCOPE;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
export namespace set {
|
|
661
|
+
/**
|
|
662
|
+
* Options for editor.prefs.schema.set
|
|
663
|
+
*/
|
|
664
|
+
interface options {
|
|
665
|
+
/**
|
|
666
|
+
* set item schema
|
|
667
|
+
*/
|
|
668
|
+
item: editor.schema;
|
|
669
|
+
/**
|
|
670
|
+
* default value
|
|
671
|
+
*/
|
|
672
|
+
default?: LuaTable<AnyNotNil, true>;
|
|
673
|
+
/**
|
|
674
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
675
|
+
*/
|
|
676
|
+
scope?: editor.prefs.SCOPE;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
export namespace string {
|
|
680
|
+
/**
|
|
681
|
+
* Options for editor.prefs.schema.string
|
|
682
|
+
*/
|
|
683
|
+
interface options {
|
|
684
|
+
/**
|
|
685
|
+
* default value
|
|
686
|
+
*/
|
|
687
|
+
default?: string;
|
|
688
|
+
/**
|
|
689
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
690
|
+
*/
|
|
691
|
+
scope?: editor.prefs.SCOPE;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
export namespace tuple {
|
|
695
|
+
/**
|
|
696
|
+
* Options for editor.prefs.schema.tuple
|
|
697
|
+
*/
|
|
698
|
+
interface options {
|
|
699
|
+
/**
|
|
700
|
+
* schemas for the items
|
|
701
|
+
*/
|
|
702
|
+
items: editor.schema[];
|
|
703
|
+
/**
|
|
704
|
+
* default value
|
|
705
|
+
*/
|
|
706
|
+
default?: unknown[];
|
|
707
|
+
/**
|
|
708
|
+
* preference scope; global values are shared by every project on this computer, while project values are stored separately per project
|
|
709
|
+
*/
|
|
710
|
+
scope?: editor.prefs.SCOPE;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
368
713
|
}
|
|
369
714
|
namespace SCOPE {
|
|
370
715
|
/**
|
|
371
716
|
* `"global"`
|
|
372
717
|
*/
|
|
373
|
-
const GLOBAL:
|
|
718
|
+
const GLOBAL: string & { readonly __brand: "editor.prefs.SCOPE.GLOBAL" };
|
|
374
719
|
/**
|
|
375
720
|
* `"project"`
|
|
376
721
|
*/
|
|
377
|
-
const PROJECT:
|
|
722
|
+
const PROJECT: string & { readonly __brand: "editor.prefs.SCOPE.PROJECT" };
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
namespace resource_attributes {
|
|
726
|
+
/**
|
|
727
|
+
* Project resource attributes
|
|
728
|
+
*/
|
|
729
|
+
interface result {
|
|
730
|
+
/**
|
|
731
|
+
* whether a resource identified by the path exists in the project
|
|
732
|
+
*/
|
|
733
|
+
exists: boolean;
|
|
734
|
+
/**
|
|
735
|
+
* whether the resource represents a file with some content
|
|
736
|
+
*/
|
|
737
|
+
is_file: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* whether the resource represents a directory
|
|
740
|
+
*/
|
|
741
|
+
is_directory: boolean;
|
|
378
742
|
}
|
|
379
743
|
}
|
|
380
744
|
namespace tx {
|
|
@@ -384,8 +748,9 @@ declare global {
|
|
|
384
748
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
385
749
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
386
750
|
* @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
|
|
751
|
+
* @returns A transaction step
|
|
387
752
|
*/
|
|
388
|
-
function add(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
|
|
753
|
+
function add(node: string | Opaque<"userdata">, property: string, value: LuaMap<string, unknown> | Record<string, unknown>): Opaque<"transaction_step">;
|
|
389
754
|
/**
|
|
390
755
|
* Create a transaction step that will remove all items from node's list property when transacted with `editor.transact()`.
|
|
391
756
|
*
|
|
@@ -411,7 +776,7 @@ declare global {
|
|
|
411
776
|
* @param child_nodes - array of child nodes (the same as returned by `editor.get(node, property)`) in new order
|
|
412
777
|
* @returns A transaction step
|
|
413
778
|
*/
|
|
414
|
-
function reorder(node: string | Opaque<"userdata">, property: string, child_nodes:
|
|
779
|
+
function reorder(node: string | Opaque<"userdata">, property: string, child_nodes: unknown[]): Opaque<"transaction_step">;
|
|
415
780
|
/**
|
|
416
781
|
* Create a transaction step that will reset an overridden property to its default value when transacted with `editor.transact()`.
|
|
417
782
|
*
|
|
@@ -431,355 +796,184 @@ declare global {
|
|
|
431
796
|
function set(node: string | Opaque<"userdata">, property: string, value: unknown): Opaque<"transaction_step">;
|
|
432
797
|
}
|
|
433
798
|
namespace ui {
|
|
799
|
+
/**
|
|
800
|
+
* External file dialog filter
|
|
801
|
+
*/
|
|
802
|
+
interface external_file_filter {
|
|
803
|
+
/**
|
|
804
|
+
* text explaining the filter, either a literal string like `"Text files (*.txt)"` or a localization message
|
|
805
|
+
*/
|
|
806
|
+
description: string | Opaque<"message">;
|
|
807
|
+
/**
|
|
808
|
+
* file extension patterns, e.g. `"*.txt"`, `"*.*"`, or `"game.project"`
|
|
809
|
+
*/
|
|
810
|
+
extensions: string[];
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Issue associated with an input component
|
|
814
|
+
*/
|
|
815
|
+
interface issue {
|
|
816
|
+
/**
|
|
817
|
+
* issue severity
|
|
818
|
+
*/
|
|
819
|
+
severity: editor.ui.ISSUE_SEVERITY;
|
|
820
|
+
/**
|
|
821
|
+
* issue message shown in a tooltip, either a string or a localization message
|
|
822
|
+
*/
|
|
823
|
+
message: string | Opaque<"message">;
|
|
824
|
+
}
|
|
825
|
+
type ALIGNMENT = typeof editor.ui.ALIGNMENT.TOP_LEFT | typeof editor.ui.ALIGNMENT.TOP | typeof editor.ui.ALIGNMENT.TOP_RIGHT | typeof editor.ui.ALIGNMENT.LEFT | typeof editor.ui.ALIGNMENT.CENTER | typeof editor.ui.ALIGNMENT.RIGHT | typeof editor.ui.ALIGNMENT.BOTTOM_LEFT | typeof editor.ui.ALIGNMENT.BOTTOM | typeof editor.ui.ALIGNMENT.BOTTOM_RIGHT;
|
|
826
|
+
type COLOR = typeof editor.ui.COLOR.TEXT | typeof editor.ui.COLOR.HINT | typeof editor.ui.COLOR.OVERRIDE | typeof editor.ui.COLOR.WARNING | typeof editor.ui.COLOR.ERROR;
|
|
827
|
+
type HEADING_STYLE = typeof editor.ui.HEADING_STYLE.H1 | typeof editor.ui.HEADING_STYLE.H2 | typeof editor.ui.HEADING_STYLE.H3 | typeof editor.ui.HEADING_STYLE.H4 | typeof editor.ui.HEADING_STYLE.H5 | typeof editor.ui.HEADING_STYLE.H6 | typeof editor.ui.HEADING_STYLE.DIALOG | typeof editor.ui.HEADING_STYLE.FORM;
|
|
828
|
+
type ICON = typeof editor.ui.ICON.OPEN_RESOURCE | typeof editor.ui.ICON.PLUS | typeof editor.ui.ICON.MINUS | typeof editor.ui.ICON.CLEAR;
|
|
829
|
+
type ISSUE_SEVERITY = typeof editor.ui.ISSUE_SEVERITY.WARNING | typeof editor.ui.ISSUE_SEVERITY.ERROR;
|
|
830
|
+
type ORIENTATION = typeof editor.ui.ORIENTATION.VERTICAL | typeof editor.ui.ORIENTATION.HORIZONTAL;
|
|
831
|
+
type PADDING = typeof editor.ui.PADDING.NONE | typeof editor.ui.PADDING.SMALL | typeof editor.ui.PADDING.MEDIUM | typeof editor.ui.PADDING.LARGE;
|
|
832
|
+
type SPACING = typeof editor.ui.SPACING.NONE | typeof editor.ui.SPACING.SMALL | typeof editor.ui.SPACING.MEDIUM | typeof editor.ui.SPACING.LARGE;
|
|
833
|
+
type TEXT_ALIGNMENT = typeof editor.ui.TEXT_ALIGNMENT.LEFT | typeof editor.ui.TEXT_ALIGNMENT.CENTER | typeof editor.ui.TEXT_ALIGNMENT.RIGHT | typeof editor.ui.TEXT_ALIGNMENT.JUSTIFY;
|
|
434
834
|
/**
|
|
435
835
|
* Button with a label and/or an icon
|
|
436
836
|
*
|
|
437
|
-
* @param props -
|
|
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.
|
|
837
|
+
* @param props - component properties
|
|
455
838
|
* @returns UI component
|
|
456
839
|
*/
|
|
457
|
-
function button(props:
|
|
840
|
+
function button(props: editor.ui.button.props): Opaque<"component">;
|
|
458
841
|
/**
|
|
459
842
|
* Check box with a label
|
|
460
843
|
*
|
|
461
|
-
* @param props -
|
|
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.
|
|
844
|
+
* @param props - component properties
|
|
475
845
|
* @returns UI component
|
|
476
846
|
*/
|
|
477
|
-
function check_box(props:
|
|
847
|
+
function check_box(props: editor.ui.check_box.props): Opaque<"component">;
|
|
478
848
|
/**
|
|
479
849
|
* Convert a function to a UI component.
|
|
480
850
|
* 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
|
|
851
|
+
* The `grow`, `row_span`, and `column_span` props are supported automatically.
|
|
482
852
|
*
|
|
483
853
|
* @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
|
|
854
|
+
* @returns decorated component function that may be invoked with a props table to create a component
|
|
485
855
|
*/
|
|
486
|
-
function component(fn: (
|
|
856
|
+
function component(fn: (props: unknown) => Opaque<"component">): (props: unknown) => Opaque<"component">;
|
|
487
857
|
/**
|
|
488
858
|
* Dialog component, a top-level window component that can't be used as a child of other components
|
|
489
859
|
*
|
|
490
|
-
* @param props -
|
|
860
|
+
* @param props - component properties
|
|
491
861
|
* @returns UI component
|
|
492
862
|
*/
|
|
493
|
-
function dialog(props:
|
|
863
|
+
function dialog(props: editor.ui.dialog.props): Opaque<"component">;
|
|
494
864
|
/**
|
|
495
865
|
* Dialog button shown in the footer of a dialog
|
|
496
866
|
*
|
|
497
|
-
* @param props -
|
|
867
|
+
* @param props - component properties
|
|
498
868
|
* @returns UI component
|
|
499
869
|
*/
|
|
500
|
-
function dialog_button(props:
|
|
870
|
+
function dialog_button(props: editor.ui.dialog_button.props): Opaque<"component">;
|
|
501
871
|
/**
|
|
502
872
|
* Input component for selecting files from the file system
|
|
503
873
|
*
|
|
504
|
-
* @param props -
|
|
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.
|
|
874
|
+
* @param props - component properties
|
|
514
875
|
* @returns UI component
|
|
515
876
|
*/
|
|
516
|
-
function external_file_field(props:
|
|
877
|
+
function external_file_field(props: editor.ui.external_file_field.props): Opaque<"component">;
|
|
517
878
|
/**
|
|
518
879
|
* Layout container that places its children in a 2D grid
|
|
519
880
|
*
|
|
520
|
-
* @param props -
|
|
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.
|
|
881
|
+
* @param props - component properties
|
|
540
882
|
* @returns UI component
|
|
541
883
|
*/
|
|
542
|
-
function grid(props:
|
|
884
|
+
function grid(props: editor.ui.grid.props): Opaque<"component">;
|
|
543
885
|
/**
|
|
544
886
|
* A text heading
|
|
545
887
|
*
|
|
546
|
-
* @param props -
|
|
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.
|
|
888
|
+
* @param props - component properties
|
|
573
889
|
* @returns UI component
|
|
574
890
|
*/
|
|
575
|
-
function heading(props:
|
|
891
|
+
function heading(props: editor.ui.heading.props): Opaque<"component">;
|
|
576
892
|
/**
|
|
577
893
|
* Layout container that places its children in a horizontal row one after another
|
|
578
894
|
*
|
|
579
|
-
* @param props -
|
|
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.
|
|
895
|
+
* @param props - component properties
|
|
599
896
|
* @returns UI component
|
|
600
897
|
*/
|
|
601
|
-
function horizontal(props:
|
|
898
|
+
function horizontal(props: editor.ui.horizontal.props): Opaque<"component">;
|
|
602
899
|
/**
|
|
603
900
|
* An icon from a predefined set
|
|
604
901
|
*
|
|
605
|
-
* @param props -
|
|
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.
|
|
902
|
+
* @param props - component properties
|
|
619
903
|
* @returns UI component
|
|
620
904
|
*/
|
|
621
|
-
function icon(props:
|
|
905
|
+
function icon(props: editor.ui.icon.props): Opaque<"component">;
|
|
622
906
|
/**
|
|
623
907
|
* An image
|
|
624
908
|
*
|
|
625
|
-
* @param props -
|
|
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.
|
|
909
|
+
* @param props - component properties
|
|
635
910
|
* @returns UI component
|
|
636
911
|
*/
|
|
637
|
-
function image(props:
|
|
912
|
+
function image(props: editor.ui.image.props): Opaque<"component">;
|
|
638
913
|
/**
|
|
639
914
|
* Integer input component based on a text field, reports changes on commit (`Enter` or focus loss)
|
|
640
915
|
*
|
|
641
|
-
* @param props -
|
|
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.
|
|
916
|
+
* @param props - component properties
|
|
651
917
|
* @returns UI component
|
|
652
918
|
*/
|
|
653
|
-
function integer_field(props:
|
|
919
|
+
function integer_field(props: editor.ui.integer_field.props): Opaque<"component">;
|
|
654
920
|
/**
|
|
655
921
|
* Label intended for use with input components
|
|
656
922
|
*
|
|
657
|
-
* @param props -
|
|
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.
|
|
923
|
+
* @param props - component properties
|
|
676
924
|
* @returns UI component
|
|
677
925
|
*/
|
|
678
|
-
function label(props:
|
|
926
|
+
function label(props: editor.ui.label.props): Opaque<"component">;
|
|
679
927
|
/**
|
|
680
928
|
* Number input component based on a text field, reports changes on commit (`Enter` or focus loss)
|
|
681
929
|
*
|
|
682
|
-
* @param props -
|
|
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.
|
|
930
|
+
* @param props - component properties
|
|
692
931
|
* @returns UI component
|
|
693
932
|
*/
|
|
694
|
-
function number_field(props:
|
|
933
|
+
function number_field(props: editor.ui.number_field.props): Opaque<"component">;
|
|
695
934
|
/**
|
|
696
|
-
* Open a resource, either in the editor or in a third-party app
|
|
935
|
+
* Open a resource using its primary or selected view, either in the editor or in a third-party app. Code and Text views accept a one-based cursor or range in `args`: `{line = 42}`, `{line = 42, column = 12}`, or `{from = {line = 42, column = 12}, to = {line = 43, column = 4}}`
|
|
697
936
|
*
|
|
698
937
|
* @param resource_path - Resource path (starting with `/`)
|
|
938
|
+
* @param view - View to open: `"code"`, `"text"`, `"scene"`, `"html"`, or `"form"`
|
|
939
|
+
* @param args - View-specific open arguments; requires `view`. Currently supported by Code and Text views. **⚠️ 1-based; passed to Defold unchanged.**
|
|
699
940
|
*/
|
|
700
|
-
function open_resource(resource_path: string): void;
|
|
941
|
+
function open_resource(resource_path: string, view?: string, args?: unknown): void;
|
|
701
942
|
/**
|
|
702
943
|
* A paragraph of text
|
|
703
944
|
*
|
|
704
|
-
* @param props -
|
|
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.
|
|
945
|
+
* @param props - component properties
|
|
723
946
|
* @returns UI component
|
|
724
947
|
*/
|
|
725
|
-
function paragraph(props:
|
|
948
|
+
function paragraph(props: editor.ui.paragraph.props): Opaque<"component">;
|
|
726
949
|
/**
|
|
727
950
|
* Input component for selecting project resources
|
|
728
951
|
*
|
|
729
|
-
* @param props -
|
|
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.
|
|
952
|
+
* @param props - component properties
|
|
739
953
|
* @returns UI component
|
|
740
954
|
*/
|
|
741
|
-
function resource_field(props:
|
|
955
|
+
function resource_field(props: editor.ui.resource_field.props): Opaque<"component">;
|
|
742
956
|
/**
|
|
743
957
|
* Layout container that optionally shows scroll bars if child contents overflow the assigned bounds
|
|
744
958
|
*
|
|
745
|
-
* @param props -
|
|
959
|
+
* @param props - component properties
|
|
746
960
|
* @returns UI component
|
|
747
961
|
*/
|
|
748
|
-
function scroll(props:
|
|
962
|
+
function scroll(props: editor.ui.scroll.props): Opaque<"component">;
|
|
749
963
|
/**
|
|
750
964
|
* Dropdown select box with an array of options
|
|
751
965
|
*
|
|
752
|
-
* @param props -
|
|
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.
|
|
966
|
+
* @param props - component properties
|
|
762
967
|
* @returns UI component
|
|
763
968
|
*/
|
|
764
|
-
function select_box(props:
|
|
969
|
+
function select_box(props: editor.ui.select_box.props): Opaque<"component">;
|
|
765
970
|
/**
|
|
766
971
|
* Thin line for visual content separation, by default horizontal and aligned to center
|
|
767
972
|
*
|
|
768
|
-
* @param props -
|
|
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.
|
|
973
|
+
* @param props - component properties
|
|
780
974
|
* @returns UI component
|
|
781
975
|
*/
|
|
782
|
-
function separator(props:
|
|
976
|
+
function separator(props: editor.ui.separator.props): Opaque<"component">;
|
|
783
977
|
/**
|
|
784
978
|
* Show a dialog and await a result
|
|
785
979
|
*
|
|
@@ -790,54 +984,45 @@ declare global {
|
|
|
790
984
|
/**
|
|
791
985
|
* Show a modal OS directory selection dialog and await a result
|
|
792
986
|
*
|
|
793
|
-
* @param opts -
|
|
987
|
+
* @param opts - dialog options
|
|
794
988
|
* @returns either absolute directory path or nil if user canceled directory selection
|
|
795
989
|
*/
|
|
796
|
-
function show_external_directory_dialog(opts?:
|
|
990
|
+
function show_external_directory_dialog(opts?: editor.ui.show_external_directory_dialog.options): string | undefined;
|
|
797
991
|
/**
|
|
798
992
|
* Show a modal OS file selection dialog and await a result
|
|
799
993
|
*
|
|
800
|
-
* @param opts -
|
|
994
|
+
* @param opts - dialog options
|
|
801
995
|
* @returns either absolute file path or nil if user canceled file selection
|
|
802
996
|
*/
|
|
803
|
-
function show_external_file_dialog(opts?:
|
|
997
|
+
function show_external_file_dialog(opts?: editor.ui.show_external_file_dialog.options): string | undefined;
|
|
804
998
|
/**
|
|
805
999
|
* Show a modal resource selection dialog and await a result
|
|
806
1000
|
*
|
|
807
|
-
* @param opts -
|
|
808
|
-
* @returns
|
|
1001
|
+
* @param opts - dialog options
|
|
1002
|
+
* @returns 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
1003
|
*/
|
|
810
|
-
function show_resource_dialog(opts?:
|
|
1004
|
+
function show_resource_dialog(opts?: editor.ui.show_resource_dialog.options): string | string[] | undefined;
|
|
811
1005
|
/**
|
|
812
1006
|
* String input component based on a text field, reports changes on commit (`Enter` or focus loss)
|
|
813
1007
|
*
|
|
814
|
-
* @param props -
|
|
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.
|
|
1008
|
+
* @param props - component properties
|
|
824
1009
|
* @returns UI component
|
|
825
1010
|
*/
|
|
826
|
-
function string_field(props:
|
|
1011
|
+
function string_field(props: editor.ui.string_field.props): Opaque<"component">;
|
|
827
1012
|
/**
|
|
828
1013
|
* Tab used in the `tabs` prop of `editor.ui.tabs(...)`
|
|
829
1014
|
*
|
|
830
|
-
* @param props -
|
|
1015
|
+
* @param props - component properties
|
|
831
1016
|
* @returns UI component
|
|
832
1017
|
*/
|
|
833
|
-
function tab(props:
|
|
1018
|
+
function tab(props: editor.ui.tab.props): Opaque<"component">;
|
|
834
1019
|
/**
|
|
835
1020
|
* Layout container that shows one selected tab content at a time
|
|
836
1021
|
*
|
|
837
|
-
* @param props -
|
|
1022
|
+
* @param props - component properties
|
|
838
1023
|
* @returns UI component
|
|
839
1024
|
*/
|
|
840
|
-
function tabs(props:
|
|
1025
|
+
function tabs(props: editor.ui.tabs.props): Opaque<"component">;
|
|
841
1026
|
/**
|
|
842
1027
|
* A hook that caches the result of a computation between re-renders.
|
|
843
1028
|
* 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.
|
|
@@ -859,7 +1044,7 @@ declare global {
|
|
|
859
1044
|
*
|
|
860
1045
|
* const counterButton = editor.ui.component((props) => {
|
|
861
1046
|
* const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
|
|
862
|
-
* const onPressed = editor.ui.use_memo(makeListener, setCount);
|
|
1047
|
+
* const onPressed = editor.ui.use_memo(makeListener, setCount) as () => void;
|
|
863
1048
|
* return editor.ui.button({
|
|
864
1049
|
* text: tostring(count),
|
|
865
1050
|
* on_pressed: onPressed,
|
|
@@ -895,214 +1080,1095 @@ declare global {
|
|
|
895
1080
|
/**
|
|
896
1081
|
* Layout container that places its children in a vertical column one after another
|
|
897
1082
|
*
|
|
898
|
-
* @param props -
|
|
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.
|
|
1083
|
+
* @param props - component properties
|
|
918
1084
|
* @returns UI component
|
|
919
1085
|
*/
|
|
920
|
-
function vertical(props:
|
|
1086
|
+
function vertical(props: editor.ui.vertical.props): Opaque<"component">;
|
|
921
1087
|
namespace ALIGNMENT {
|
|
922
1088
|
/**
|
|
923
1089
|
* `"bottom"`
|
|
924
1090
|
*/
|
|
925
|
-
const BOTTOM:
|
|
1091
|
+
const BOTTOM: string & { readonly __brand: "editor.ui.ALIGNMENT.BOTTOM" };
|
|
926
1092
|
/**
|
|
927
1093
|
* `"bottom-left"`
|
|
928
1094
|
*/
|
|
929
|
-
const BOTTOM_LEFT:
|
|
1095
|
+
const BOTTOM_LEFT: string & { readonly __brand: "editor.ui.ALIGNMENT.BOTTOM_LEFT" };
|
|
930
1096
|
/**
|
|
931
1097
|
* `"bottom-right"`
|
|
932
1098
|
*/
|
|
933
|
-
const BOTTOM_RIGHT:
|
|
1099
|
+
const BOTTOM_RIGHT: string & { readonly __brand: "editor.ui.ALIGNMENT.BOTTOM_RIGHT" };
|
|
934
1100
|
/**
|
|
935
1101
|
* `"center"`
|
|
936
1102
|
*/
|
|
937
|
-
const CENTER:
|
|
1103
|
+
const CENTER: string & { readonly __brand: "editor.ui.ALIGNMENT.CENTER" };
|
|
938
1104
|
/**
|
|
939
1105
|
* `"left"`
|
|
940
1106
|
*/
|
|
941
|
-
const LEFT:
|
|
1107
|
+
const LEFT: string & { readonly __brand: "editor.ui.ALIGNMENT.LEFT" };
|
|
942
1108
|
/**
|
|
943
1109
|
* `"right"`
|
|
944
1110
|
*/
|
|
945
|
-
const RIGHT:
|
|
1111
|
+
const RIGHT: string & { readonly __brand: "editor.ui.ALIGNMENT.RIGHT" };
|
|
946
1112
|
/**
|
|
947
1113
|
* `"top"`
|
|
948
1114
|
*/
|
|
949
|
-
const TOP:
|
|
1115
|
+
const TOP: string & { readonly __brand: "editor.ui.ALIGNMENT.TOP" };
|
|
950
1116
|
/**
|
|
951
1117
|
* `"top-left"`
|
|
952
1118
|
*/
|
|
953
|
-
const TOP_LEFT:
|
|
1119
|
+
const TOP_LEFT: string & { readonly __brand: "editor.ui.ALIGNMENT.TOP_LEFT" };
|
|
954
1120
|
/**
|
|
955
1121
|
* `"top-right"`
|
|
956
1122
|
*/
|
|
957
|
-
const TOP_RIGHT:
|
|
1123
|
+
const TOP_RIGHT: string & { readonly __brand: "editor.ui.ALIGNMENT.TOP_RIGHT" };
|
|
1124
|
+
}
|
|
1125
|
+
namespace button {
|
|
1126
|
+
/**
|
|
1127
|
+
* Properties for editor.ui.button
|
|
1128
|
+
*/
|
|
1129
|
+
interface props {
|
|
1130
|
+
/**
|
|
1131
|
+
* button press callback, will be invoked without arguments when the user presses the button
|
|
1132
|
+
*/
|
|
1133
|
+
on_pressed?: (...args: unknown[]) => unknown;
|
|
1134
|
+
/**
|
|
1135
|
+
* the text, either a string or a localization message
|
|
1136
|
+
*/
|
|
1137
|
+
text?: string | Opaque<"message">;
|
|
1138
|
+
/**
|
|
1139
|
+
* text alignment within paragraph bounds
|
|
1140
|
+
*/
|
|
1141
|
+
text_alignment?: editor.ui.TEXT_ALIGNMENT;
|
|
1142
|
+
/**
|
|
1143
|
+
* predefined icon name
|
|
1144
|
+
*/
|
|
1145
|
+
icon?: editor.ui.ICON;
|
|
1146
|
+
/**
|
|
1147
|
+
* determines if the input component can be interacted with
|
|
1148
|
+
*/
|
|
1149
|
+
enabled?: boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1152
|
+
*/
|
|
1153
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1154
|
+
/**
|
|
1155
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1156
|
+
*/
|
|
1157
|
+
grow?: boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1160
|
+
*/
|
|
1161
|
+
row_span?: number;
|
|
1162
|
+
/**
|
|
1163
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1164
|
+
*/
|
|
1165
|
+
column_span?: number;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
namespace check_box {
|
|
1169
|
+
/**
|
|
1170
|
+
* Properties for editor.ui.check_box
|
|
1171
|
+
*/
|
|
1172
|
+
interface props {
|
|
1173
|
+
/**
|
|
1174
|
+
* determines if the checkbox should appear checked
|
|
1175
|
+
*/
|
|
1176
|
+
value?: boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* change callback, will receive the new value
|
|
1179
|
+
*/
|
|
1180
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1181
|
+
/**
|
|
1182
|
+
* determines if the checkbox should appear in the mixed state
|
|
1183
|
+
*/
|
|
1184
|
+
indeterminate?: boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* the text, either a string or a localization message
|
|
1187
|
+
*/
|
|
1188
|
+
text?: string | Opaque<"message">;
|
|
1189
|
+
/**
|
|
1190
|
+
* text alignment within paragraph bounds
|
|
1191
|
+
*/
|
|
1192
|
+
text_alignment?: editor.ui.TEXT_ALIGNMENT;
|
|
1193
|
+
/**
|
|
1194
|
+
* issue related to the input, or false if there is no issue
|
|
1195
|
+
*/
|
|
1196
|
+
issue?: editor.ui.issue | false;
|
|
1197
|
+
/**
|
|
1198
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1199
|
+
*/
|
|
1200
|
+
tooltip?: string | Opaque<"message">;
|
|
1201
|
+
/**
|
|
1202
|
+
* determines if the input component can be interacted with
|
|
1203
|
+
*/
|
|
1204
|
+
enabled?: boolean;
|
|
1205
|
+
/**
|
|
1206
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1207
|
+
*/
|
|
1208
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1209
|
+
/**
|
|
1210
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1211
|
+
*/
|
|
1212
|
+
grow?: boolean;
|
|
1213
|
+
/**
|
|
1214
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1215
|
+
*/
|
|
1216
|
+
row_span?: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1219
|
+
*/
|
|
1220
|
+
column_span?: number;
|
|
1221
|
+
}
|
|
958
1222
|
}
|
|
959
1223
|
namespace COLOR {
|
|
960
1224
|
/**
|
|
961
1225
|
* `"error"`
|
|
962
1226
|
*/
|
|
963
|
-
const ERROR:
|
|
1227
|
+
const ERROR: string & { readonly __brand: "editor.ui.COLOR.ERROR" };
|
|
964
1228
|
/**
|
|
965
1229
|
* `"hint"`
|
|
966
1230
|
*/
|
|
967
|
-
const HINT:
|
|
1231
|
+
const HINT: string & { readonly __brand: "editor.ui.COLOR.HINT" };
|
|
968
1232
|
/**
|
|
969
1233
|
* `"override"`
|
|
970
1234
|
*/
|
|
971
|
-
const OVERRIDE:
|
|
1235
|
+
const OVERRIDE: string & { readonly __brand: "editor.ui.COLOR.OVERRIDE" };
|
|
972
1236
|
/**
|
|
973
1237
|
* `"text"`
|
|
974
1238
|
*/
|
|
975
|
-
const TEXT:
|
|
1239
|
+
const TEXT: string & { readonly __brand: "editor.ui.COLOR.TEXT" };
|
|
976
1240
|
/**
|
|
977
1241
|
* `"warning"`
|
|
978
1242
|
*/
|
|
979
|
-
const WARNING:
|
|
1243
|
+
const WARNING: string & { readonly __brand: "editor.ui.COLOR.WARNING" };
|
|
1244
|
+
}
|
|
1245
|
+
namespace dialog {
|
|
1246
|
+
/**
|
|
1247
|
+
* Properties for editor.ui.dialog
|
|
1248
|
+
*/
|
|
1249
|
+
interface props {
|
|
1250
|
+
/**
|
|
1251
|
+
* OS dialog window title, either a string or a localization message
|
|
1252
|
+
*/
|
|
1253
|
+
title: string | Opaque<"message">;
|
|
1254
|
+
/**
|
|
1255
|
+
* top part of the dialog, defaults to `editor.ui.heading({text = props.title})`
|
|
1256
|
+
*/
|
|
1257
|
+
header?: Opaque<"component"> | false;
|
|
1258
|
+
/**
|
|
1259
|
+
* content of the dialog
|
|
1260
|
+
*/
|
|
1261
|
+
content?: Opaque<"component"> | false;
|
|
1262
|
+
/**
|
|
1263
|
+
* initial width of the dialog window in pixels
|
|
1264
|
+
*/
|
|
1265
|
+
width?: number;
|
|
1266
|
+
/**
|
|
1267
|
+
* initial height of the dialog window in pixels
|
|
1268
|
+
*/
|
|
1269
|
+
height?: number;
|
|
1270
|
+
/**
|
|
1271
|
+
* determines if the dialog window can be resized by the user
|
|
1272
|
+
*/
|
|
1273
|
+
resizable?: boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* array of `editor.ui.dialog_button(...)` components, footer of the dialog. Defaults to a single Close button
|
|
1276
|
+
*/
|
|
1277
|
+
buttons?: (Opaque<"component"> | false)[];
|
|
1278
|
+
/**
|
|
1279
|
+
* if set to `false`, the dialog window stays on top but does not block interaction with the editor
|
|
1280
|
+
*/
|
|
1281
|
+
modal?: boolean;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
namespace dialog_button {
|
|
1285
|
+
/**
|
|
1286
|
+
* Properties for editor.ui.dialog_button
|
|
1287
|
+
*/
|
|
1288
|
+
interface props {
|
|
1289
|
+
/**
|
|
1290
|
+
* button text, either a string or a localization message
|
|
1291
|
+
*/
|
|
1292
|
+
text: string | Opaque<"message">;
|
|
1293
|
+
/**
|
|
1294
|
+
* value returned by `editor.ui.show_dialog(...)` if this button is pressed
|
|
1295
|
+
*/
|
|
1296
|
+
result?: unknown;
|
|
1297
|
+
/**
|
|
1298
|
+
* if set, pressing `Enter` in the dialog will trigger this button
|
|
1299
|
+
*/
|
|
1300
|
+
default?: boolean;
|
|
1301
|
+
/**
|
|
1302
|
+
* if set, pressing `Escape` in the dialog will trigger this button
|
|
1303
|
+
*/
|
|
1304
|
+
cancel?: boolean;
|
|
1305
|
+
/**
|
|
1306
|
+
* determines if the button can be interacted with
|
|
1307
|
+
*/
|
|
1308
|
+
enabled?: boolean;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
namespace external_file_field {
|
|
1312
|
+
/**
|
|
1313
|
+
* Properties for editor.ui.external_file_field
|
|
1314
|
+
*/
|
|
1315
|
+
interface props {
|
|
1316
|
+
/**
|
|
1317
|
+
* file or directory path; resolved against project root if relative
|
|
1318
|
+
*/
|
|
1319
|
+
value?: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* 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
|
|
1322
|
+
*/
|
|
1323
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1324
|
+
/**
|
|
1325
|
+
* OS window title, either a string or a localization message
|
|
1326
|
+
*/
|
|
1327
|
+
title?: string | Opaque<"message">;
|
|
1328
|
+
/**
|
|
1329
|
+
* File filters
|
|
1330
|
+
*/
|
|
1331
|
+
filters?: editor.ui.external_file_filter[];
|
|
1332
|
+
/**
|
|
1333
|
+
* issue related to the input, or false if there is no issue
|
|
1334
|
+
*/
|
|
1335
|
+
issue?: editor.ui.issue | false;
|
|
1336
|
+
/**
|
|
1337
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1338
|
+
*/
|
|
1339
|
+
tooltip?: string | Opaque<"message">;
|
|
1340
|
+
/**
|
|
1341
|
+
* determines if the input component can be interacted with
|
|
1342
|
+
*/
|
|
1343
|
+
enabled?: boolean;
|
|
1344
|
+
/**
|
|
1345
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1346
|
+
*/
|
|
1347
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1348
|
+
/**
|
|
1349
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1350
|
+
*/
|
|
1351
|
+
grow?: boolean;
|
|
1352
|
+
/**
|
|
1353
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1354
|
+
*/
|
|
1355
|
+
row_span?: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1358
|
+
*/
|
|
1359
|
+
column_span?: number;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
namespace grid {
|
|
1363
|
+
/**
|
|
1364
|
+
* Grid row or column constraint
|
|
1365
|
+
*/
|
|
1366
|
+
interface constraint {
|
|
1367
|
+
/**
|
|
1368
|
+
* whether the row or column should grow to fill available space
|
|
1369
|
+
*/
|
|
1370
|
+
grow?: boolean;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Properties for editor.ui.grid
|
|
1374
|
+
*/
|
|
1375
|
+
interface props {
|
|
1376
|
+
/**
|
|
1377
|
+
* array of arrays of child components
|
|
1378
|
+
*/
|
|
1379
|
+
children?: ((Opaque<"component"> | false)[] | false)[];
|
|
1380
|
+
/**
|
|
1381
|
+
* separate configuration for each row
|
|
1382
|
+
*/
|
|
1383
|
+
rows?: (editor.ui.grid.constraint | false)[];
|
|
1384
|
+
/**
|
|
1385
|
+
* separate configuration for each column
|
|
1386
|
+
*/
|
|
1387
|
+
columns?: (editor.ui.grid.constraint | false)[];
|
|
1388
|
+
/**
|
|
1389
|
+
* empty space from the edges of the container to its children, either a predefined padding value or a non-negative number of pixels
|
|
1390
|
+
*/
|
|
1391
|
+
padding?: editor.ui.PADDING | number;
|
|
1392
|
+
/**
|
|
1393
|
+
* empty space between child components, either a predefined spacing value or a non-negative number of pixels; defaults to `editor.ui.SPACING.MEDIUM`
|
|
1394
|
+
*/
|
|
1395
|
+
spacing?: editor.ui.SPACING | number;
|
|
1396
|
+
/**
|
|
1397
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1398
|
+
*/
|
|
1399
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1400
|
+
/**
|
|
1401
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1402
|
+
*/
|
|
1403
|
+
grow?: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1406
|
+
*/
|
|
1407
|
+
row_span?: number;
|
|
1408
|
+
/**
|
|
1409
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1410
|
+
*/
|
|
1411
|
+
column_span?: number;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
namespace heading {
|
|
1415
|
+
/**
|
|
1416
|
+
* Properties for editor.ui.heading
|
|
1417
|
+
*/
|
|
1418
|
+
interface props {
|
|
1419
|
+
/**
|
|
1420
|
+
* the text, either a string or a localization message
|
|
1421
|
+
*/
|
|
1422
|
+
text?: string | Opaque<"message">;
|
|
1423
|
+
/**
|
|
1424
|
+
* text alignment within paragraph bounds
|
|
1425
|
+
*/
|
|
1426
|
+
text_alignment?: editor.ui.TEXT_ALIGNMENT;
|
|
1427
|
+
/**
|
|
1428
|
+
* semantic color, defaults to `editor.ui.COLOR.TEXT`
|
|
1429
|
+
*/
|
|
1430
|
+
color?: editor.ui.COLOR;
|
|
1431
|
+
/**
|
|
1432
|
+
* determines if the lines of text are word-wrapped when they don't fit in the assigned bounds, defaults to true
|
|
1433
|
+
*/
|
|
1434
|
+
word_wrap?: boolean;
|
|
1435
|
+
/**
|
|
1436
|
+
* heading style, defaults to `editor.ui.HEADING_STYLE.H3`
|
|
1437
|
+
*/
|
|
1438
|
+
style?: editor.ui.HEADING_STYLE;
|
|
1439
|
+
/**
|
|
1440
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1441
|
+
*/
|
|
1442
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1443
|
+
/**
|
|
1444
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1445
|
+
*/
|
|
1446
|
+
grow?: boolean;
|
|
1447
|
+
/**
|
|
1448
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1449
|
+
*/
|
|
1450
|
+
row_span?: number;
|
|
1451
|
+
/**
|
|
1452
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1453
|
+
*/
|
|
1454
|
+
column_span?: number;
|
|
1455
|
+
}
|
|
980
1456
|
}
|
|
981
1457
|
namespace HEADING_STYLE {
|
|
982
1458
|
/**
|
|
983
1459
|
* `"dialog"`
|
|
984
1460
|
*/
|
|
985
|
-
const DIALOG:
|
|
1461
|
+
const DIALOG: string & { readonly __brand: "editor.ui.HEADING_STYLE.DIALOG" };
|
|
986
1462
|
/**
|
|
987
1463
|
* `"form"`
|
|
988
1464
|
*/
|
|
989
|
-
const FORM:
|
|
1465
|
+
const FORM: string & { readonly __brand: "editor.ui.HEADING_STYLE.FORM" };
|
|
990
1466
|
/**
|
|
991
1467
|
* `"h1"`
|
|
992
1468
|
*/
|
|
993
|
-
const H1:
|
|
1469
|
+
const H1: string & { readonly __brand: "editor.ui.HEADING_STYLE.H1" };
|
|
994
1470
|
/**
|
|
995
1471
|
* `"h2"`
|
|
996
1472
|
*/
|
|
997
|
-
const H2:
|
|
1473
|
+
const H2: string & { readonly __brand: "editor.ui.HEADING_STYLE.H2" };
|
|
998
1474
|
/**
|
|
999
1475
|
* `"h3"`
|
|
1000
1476
|
*/
|
|
1001
|
-
const H3:
|
|
1477
|
+
const H3: string & { readonly __brand: "editor.ui.HEADING_STYLE.H3" };
|
|
1002
1478
|
/**
|
|
1003
1479
|
* `"h4"`
|
|
1004
1480
|
*/
|
|
1005
|
-
const H4:
|
|
1481
|
+
const H4: string & { readonly __brand: "editor.ui.HEADING_STYLE.H4" };
|
|
1006
1482
|
/**
|
|
1007
1483
|
* `"h5"`
|
|
1008
1484
|
*/
|
|
1009
|
-
const H5:
|
|
1485
|
+
const H5: string & { readonly __brand: "editor.ui.HEADING_STYLE.H5" };
|
|
1010
1486
|
/**
|
|
1011
1487
|
* `"h6"`
|
|
1012
1488
|
*/
|
|
1013
|
-
const H6:
|
|
1489
|
+
const H6: string & { readonly __brand: "editor.ui.HEADING_STYLE.H6" };
|
|
1490
|
+
}
|
|
1491
|
+
namespace horizontal {
|
|
1492
|
+
/**
|
|
1493
|
+
* Properties for editor.ui.horizontal
|
|
1494
|
+
*/
|
|
1495
|
+
interface props {
|
|
1496
|
+
/**
|
|
1497
|
+
* array of child components
|
|
1498
|
+
*/
|
|
1499
|
+
children?: (Opaque<"component"> | false)[];
|
|
1500
|
+
/**
|
|
1501
|
+
* empty space from the edges of the container to its children, either a predefined padding value or a non-negative number of pixels
|
|
1502
|
+
*/
|
|
1503
|
+
padding?: editor.ui.PADDING | number;
|
|
1504
|
+
/**
|
|
1505
|
+
* empty space between child components, either a predefined spacing value or a non-negative number of pixels; defaults to `editor.ui.SPACING.MEDIUM`
|
|
1506
|
+
*/
|
|
1507
|
+
spacing?: editor.ui.SPACING | number;
|
|
1508
|
+
/**
|
|
1509
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1510
|
+
*/
|
|
1511
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1512
|
+
/**
|
|
1513
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1514
|
+
*/
|
|
1515
|
+
grow?: boolean;
|
|
1516
|
+
/**
|
|
1517
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1518
|
+
*/
|
|
1519
|
+
row_span?: number;
|
|
1520
|
+
/**
|
|
1521
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1522
|
+
*/
|
|
1523
|
+
column_span?: number;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
namespace icon {
|
|
1527
|
+
/**
|
|
1528
|
+
* Properties for editor.ui.icon
|
|
1529
|
+
*/
|
|
1530
|
+
interface props {
|
|
1531
|
+
/**
|
|
1532
|
+
* predefined icon name
|
|
1533
|
+
*/
|
|
1534
|
+
icon: editor.ui.ICON;
|
|
1535
|
+
/**
|
|
1536
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1537
|
+
*/
|
|
1538
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1539
|
+
/**
|
|
1540
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1541
|
+
*/
|
|
1542
|
+
grow?: boolean;
|
|
1543
|
+
/**
|
|
1544
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1545
|
+
*/
|
|
1546
|
+
row_span?: number;
|
|
1547
|
+
/**
|
|
1548
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1549
|
+
*/
|
|
1550
|
+
column_span?: number;
|
|
1551
|
+
}
|
|
1014
1552
|
}
|
|
1015
1553
|
namespace ICON {
|
|
1016
1554
|
/**
|
|
1017
1555
|
* `"clear"`
|
|
1018
1556
|
*/
|
|
1019
|
-
const CLEAR:
|
|
1557
|
+
const CLEAR: string & { readonly __brand: "editor.ui.ICON.CLEAR" };
|
|
1020
1558
|
/**
|
|
1021
1559
|
* `"minus"`
|
|
1022
1560
|
*/
|
|
1023
|
-
const MINUS:
|
|
1561
|
+
const MINUS: string & { readonly __brand: "editor.ui.ICON.MINUS" };
|
|
1024
1562
|
/**
|
|
1025
1563
|
* `"open-resource"`
|
|
1026
1564
|
*/
|
|
1027
|
-
const OPEN_RESOURCE:
|
|
1565
|
+
const OPEN_RESOURCE: string & { readonly __brand: "editor.ui.ICON.OPEN_RESOURCE" };
|
|
1028
1566
|
/**
|
|
1029
1567
|
* `"plus"`
|
|
1030
1568
|
*/
|
|
1031
|
-
const PLUS:
|
|
1569
|
+
const PLUS: string & { readonly __brand: "editor.ui.ICON.PLUS" };
|
|
1570
|
+
}
|
|
1571
|
+
namespace image {
|
|
1572
|
+
/**
|
|
1573
|
+
* Properties for editor.ui.image
|
|
1574
|
+
*/
|
|
1575
|
+
interface props {
|
|
1576
|
+
/**
|
|
1577
|
+
* either a resource path (starts with `/`), or an URL
|
|
1578
|
+
*/
|
|
1579
|
+
image: string;
|
|
1580
|
+
/**
|
|
1581
|
+
* width of the image view, the image will be fit inside it while preserving its aspect ratio
|
|
1582
|
+
*/
|
|
1583
|
+
width?: number;
|
|
1584
|
+
/**
|
|
1585
|
+
* height of the image view, the image will be fit inside it while preserving its aspect ratio
|
|
1586
|
+
*/
|
|
1587
|
+
height?: number;
|
|
1588
|
+
/**
|
|
1589
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1590
|
+
*/
|
|
1591
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1592
|
+
/**
|
|
1593
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1594
|
+
*/
|
|
1595
|
+
grow?: boolean;
|
|
1596
|
+
/**
|
|
1597
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1598
|
+
*/
|
|
1599
|
+
row_span?: number;
|
|
1600
|
+
/**
|
|
1601
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1602
|
+
*/
|
|
1603
|
+
column_span?: number;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
namespace integer_field {
|
|
1607
|
+
/**
|
|
1608
|
+
* Properties for editor.ui.integer_field
|
|
1609
|
+
*/
|
|
1610
|
+
interface props {
|
|
1611
|
+
/**
|
|
1612
|
+
* value
|
|
1613
|
+
*/
|
|
1614
|
+
value?: unknown;
|
|
1615
|
+
/**
|
|
1616
|
+
* value change callback, will receive the new value
|
|
1617
|
+
*/
|
|
1618
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1619
|
+
/**
|
|
1620
|
+
* issue related to the input, or false if there is no issue
|
|
1621
|
+
*/
|
|
1622
|
+
issue?: editor.ui.issue | false;
|
|
1623
|
+
/**
|
|
1624
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1625
|
+
*/
|
|
1626
|
+
tooltip?: string | Opaque<"message">;
|
|
1627
|
+
/**
|
|
1628
|
+
* determines if the input component can be interacted with
|
|
1629
|
+
*/
|
|
1630
|
+
enabled?: boolean;
|
|
1631
|
+
/**
|
|
1632
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1633
|
+
*/
|
|
1634
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1635
|
+
/**
|
|
1636
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1637
|
+
*/
|
|
1638
|
+
grow?: boolean;
|
|
1639
|
+
/**
|
|
1640
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1641
|
+
*/
|
|
1642
|
+
row_span?: number;
|
|
1643
|
+
/**
|
|
1644
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1645
|
+
*/
|
|
1646
|
+
column_span?: number;
|
|
1647
|
+
}
|
|
1032
1648
|
}
|
|
1033
1649
|
namespace ISSUE_SEVERITY {
|
|
1034
1650
|
/**
|
|
1035
1651
|
* `"error"`
|
|
1036
1652
|
*/
|
|
1037
|
-
const ERROR:
|
|
1653
|
+
const ERROR: string & { readonly __brand: "editor.ui.ISSUE_SEVERITY.ERROR" };
|
|
1038
1654
|
/**
|
|
1039
1655
|
* `"warning"`
|
|
1040
1656
|
*/
|
|
1041
|
-
const WARNING:
|
|
1657
|
+
const WARNING: string & { readonly __brand: "editor.ui.ISSUE_SEVERITY.WARNING" };
|
|
1658
|
+
}
|
|
1659
|
+
namespace label {
|
|
1660
|
+
/**
|
|
1661
|
+
* Properties for editor.ui.label
|
|
1662
|
+
*/
|
|
1663
|
+
interface props {
|
|
1664
|
+
/**
|
|
1665
|
+
* the text, either a string or a localization message
|
|
1666
|
+
*/
|
|
1667
|
+
text?: string | Opaque<"message">;
|
|
1668
|
+
/**
|
|
1669
|
+
* text alignment within paragraph bounds
|
|
1670
|
+
*/
|
|
1671
|
+
text_alignment?: editor.ui.TEXT_ALIGNMENT;
|
|
1672
|
+
/**
|
|
1673
|
+
* semantic color, defaults to `editor.ui.COLOR.TEXT`
|
|
1674
|
+
*/
|
|
1675
|
+
color?: editor.ui.COLOR;
|
|
1676
|
+
/**
|
|
1677
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1678
|
+
*/
|
|
1679
|
+
tooltip?: string | Opaque<"message">;
|
|
1680
|
+
/**
|
|
1681
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1682
|
+
*/
|
|
1683
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1684
|
+
/**
|
|
1685
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1686
|
+
*/
|
|
1687
|
+
grow?: boolean;
|
|
1688
|
+
/**
|
|
1689
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1690
|
+
*/
|
|
1691
|
+
row_span?: number;
|
|
1692
|
+
/**
|
|
1693
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1694
|
+
*/
|
|
1695
|
+
column_span?: number;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
namespace number_field {
|
|
1699
|
+
/**
|
|
1700
|
+
* Properties for editor.ui.number_field
|
|
1701
|
+
*/
|
|
1702
|
+
interface props {
|
|
1703
|
+
/**
|
|
1704
|
+
* value
|
|
1705
|
+
*/
|
|
1706
|
+
value?: unknown;
|
|
1707
|
+
/**
|
|
1708
|
+
* value change callback, will receive the new value
|
|
1709
|
+
*/
|
|
1710
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1711
|
+
/**
|
|
1712
|
+
* issue related to the input, or false if there is no issue
|
|
1713
|
+
*/
|
|
1714
|
+
issue?: editor.ui.issue | false;
|
|
1715
|
+
/**
|
|
1716
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1717
|
+
*/
|
|
1718
|
+
tooltip?: string | Opaque<"message">;
|
|
1719
|
+
/**
|
|
1720
|
+
* determines if the input component can be interacted with
|
|
1721
|
+
*/
|
|
1722
|
+
enabled?: boolean;
|
|
1723
|
+
/**
|
|
1724
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1725
|
+
*/
|
|
1726
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1727
|
+
/**
|
|
1728
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1729
|
+
*/
|
|
1730
|
+
grow?: boolean;
|
|
1731
|
+
/**
|
|
1732
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1733
|
+
*/
|
|
1734
|
+
row_span?: number;
|
|
1735
|
+
/**
|
|
1736
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1737
|
+
*/
|
|
1738
|
+
column_span?: number;
|
|
1739
|
+
}
|
|
1042
1740
|
}
|
|
1043
1741
|
namespace ORIENTATION {
|
|
1044
1742
|
/**
|
|
1045
1743
|
* `"horizontal"`
|
|
1046
1744
|
*/
|
|
1047
|
-
const HORIZONTAL:
|
|
1745
|
+
const HORIZONTAL: string & { readonly __brand: "editor.ui.ORIENTATION.HORIZONTAL" };
|
|
1048
1746
|
/**
|
|
1049
1747
|
* `"vertical"`
|
|
1050
1748
|
*/
|
|
1051
|
-
const VERTICAL:
|
|
1749
|
+
const VERTICAL: string & { readonly __brand: "editor.ui.ORIENTATION.VERTICAL" };
|
|
1052
1750
|
}
|
|
1053
1751
|
namespace PADDING {
|
|
1054
1752
|
/**
|
|
1055
1753
|
* `"large"`
|
|
1056
1754
|
*/
|
|
1057
|
-
const LARGE:
|
|
1755
|
+
const LARGE: string & { readonly __brand: "editor.ui.PADDING.LARGE" };
|
|
1058
1756
|
/**
|
|
1059
1757
|
* `"medium"`
|
|
1060
1758
|
*/
|
|
1061
|
-
const MEDIUM:
|
|
1759
|
+
const MEDIUM: string & { readonly __brand: "editor.ui.PADDING.MEDIUM" };
|
|
1062
1760
|
/**
|
|
1063
1761
|
* `"none"`
|
|
1064
1762
|
*/
|
|
1065
|
-
const NONE:
|
|
1763
|
+
const NONE: string & { readonly __brand: "editor.ui.PADDING.NONE" };
|
|
1066
1764
|
/**
|
|
1067
1765
|
* `"small"`
|
|
1068
1766
|
*/
|
|
1069
|
-
const SMALL:
|
|
1767
|
+
const SMALL: string & { readonly __brand: "editor.ui.PADDING.SMALL" };
|
|
1768
|
+
}
|
|
1769
|
+
namespace paragraph {
|
|
1770
|
+
/**
|
|
1771
|
+
* Properties for editor.ui.paragraph
|
|
1772
|
+
*/
|
|
1773
|
+
interface props {
|
|
1774
|
+
/**
|
|
1775
|
+
* the text, either a string or a localization message
|
|
1776
|
+
*/
|
|
1777
|
+
text?: string | Opaque<"message">;
|
|
1778
|
+
/**
|
|
1779
|
+
* text alignment within paragraph bounds
|
|
1780
|
+
*/
|
|
1781
|
+
text_alignment?: editor.ui.TEXT_ALIGNMENT;
|
|
1782
|
+
/**
|
|
1783
|
+
* semantic color, defaults to `editor.ui.COLOR.TEXT`
|
|
1784
|
+
*/
|
|
1785
|
+
color?: editor.ui.COLOR;
|
|
1786
|
+
/**
|
|
1787
|
+
* determines if the lines of text are word-wrapped when they don't fit in the assigned bounds, defaults to true
|
|
1788
|
+
*/
|
|
1789
|
+
word_wrap?: boolean;
|
|
1790
|
+
/**
|
|
1791
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1792
|
+
*/
|
|
1793
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1794
|
+
/**
|
|
1795
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1796
|
+
*/
|
|
1797
|
+
grow?: boolean;
|
|
1798
|
+
/**
|
|
1799
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1800
|
+
*/
|
|
1801
|
+
row_span?: number;
|
|
1802
|
+
/**
|
|
1803
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1804
|
+
*/
|
|
1805
|
+
column_span?: number;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
namespace resource_field {
|
|
1809
|
+
/**
|
|
1810
|
+
* Properties for editor.ui.resource_field
|
|
1811
|
+
*/
|
|
1812
|
+
interface props {
|
|
1813
|
+
/**
|
|
1814
|
+
* resource path (must start with `/`)
|
|
1815
|
+
*/
|
|
1816
|
+
value?: string;
|
|
1817
|
+
/**
|
|
1818
|
+
* 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
|
|
1819
|
+
*/
|
|
1820
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1821
|
+
/**
|
|
1822
|
+
* dialog title, either a string or a localization message, defaults to `localization.message("dialog.select-resource.title")`
|
|
1823
|
+
*/
|
|
1824
|
+
title?: string | Opaque<"message">;
|
|
1825
|
+
/**
|
|
1826
|
+
* if specified, restricts selectable resources in the dialog to specified file extensions; e.g. `{"collection", "go"}`
|
|
1827
|
+
*/
|
|
1828
|
+
extensions?: string[];
|
|
1829
|
+
/**
|
|
1830
|
+
* issue related to the input, or false if there is no issue
|
|
1831
|
+
*/
|
|
1832
|
+
issue?: editor.ui.issue | false;
|
|
1833
|
+
/**
|
|
1834
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1835
|
+
*/
|
|
1836
|
+
tooltip?: string | Opaque<"message">;
|
|
1837
|
+
/**
|
|
1838
|
+
* determines if the input component can be interacted with
|
|
1839
|
+
*/
|
|
1840
|
+
enabled?: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1843
|
+
*/
|
|
1844
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1845
|
+
/**
|
|
1846
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1847
|
+
*/
|
|
1848
|
+
grow?: boolean;
|
|
1849
|
+
/**
|
|
1850
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1851
|
+
*/
|
|
1852
|
+
row_span?: number;
|
|
1853
|
+
/**
|
|
1854
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1855
|
+
*/
|
|
1856
|
+
column_span?: number;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
namespace scroll {
|
|
1860
|
+
/**
|
|
1861
|
+
* Properties for editor.ui.scroll
|
|
1862
|
+
*/
|
|
1863
|
+
interface props {
|
|
1864
|
+
/**
|
|
1865
|
+
* content component
|
|
1866
|
+
*/
|
|
1867
|
+
content: Opaque<"component">;
|
|
1868
|
+
/**
|
|
1869
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1870
|
+
*/
|
|
1871
|
+
grow?: boolean;
|
|
1872
|
+
/**
|
|
1873
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1874
|
+
*/
|
|
1875
|
+
row_span?: number;
|
|
1876
|
+
/**
|
|
1877
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1878
|
+
*/
|
|
1879
|
+
column_span?: number;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
namespace select_box {
|
|
1883
|
+
/**
|
|
1884
|
+
* Properties for editor.ui.select_box
|
|
1885
|
+
*/
|
|
1886
|
+
interface props {
|
|
1887
|
+
/**
|
|
1888
|
+
* selected value
|
|
1889
|
+
*/
|
|
1890
|
+
value?: unknown;
|
|
1891
|
+
/**
|
|
1892
|
+
* change callback, will receive the selected value
|
|
1893
|
+
*/
|
|
1894
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
1895
|
+
/**
|
|
1896
|
+
* array of selectable options
|
|
1897
|
+
*/
|
|
1898
|
+
options?: unknown[];
|
|
1899
|
+
/**
|
|
1900
|
+
* function that converts an item to a string (or a localization message); defaults to `tostring`
|
|
1901
|
+
*/
|
|
1902
|
+
to_string?: (...args: unknown[]) => unknown;
|
|
1903
|
+
/**
|
|
1904
|
+
* issue related to the input, or false if there is no issue
|
|
1905
|
+
*/
|
|
1906
|
+
issue?: editor.ui.issue | false;
|
|
1907
|
+
/**
|
|
1908
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
1909
|
+
*/
|
|
1910
|
+
tooltip?: string | Opaque<"message">;
|
|
1911
|
+
/**
|
|
1912
|
+
* determines if the input component can be interacted with
|
|
1913
|
+
*/
|
|
1914
|
+
enabled?: boolean;
|
|
1915
|
+
/**
|
|
1916
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1917
|
+
*/
|
|
1918
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1919
|
+
/**
|
|
1920
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1921
|
+
*/
|
|
1922
|
+
grow?: boolean;
|
|
1923
|
+
/**
|
|
1924
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1925
|
+
*/
|
|
1926
|
+
row_span?: number;
|
|
1927
|
+
/**
|
|
1928
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1929
|
+
*/
|
|
1930
|
+
column_span?: number;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
namespace separator {
|
|
1934
|
+
/**
|
|
1935
|
+
* Properties for editor.ui.separator
|
|
1936
|
+
*/
|
|
1937
|
+
interface props {
|
|
1938
|
+
/**
|
|
1939
|
+
* separator line orientation, `editor.ui.ORIENTATION.VERTICAL` or `editor.ui.ORIENTATION.HORIZONTAL`
|
|
1940
|
+
*/
|
|
1941
|
+
orientation?: editor.ui.ORIENTATION;
|
|
1942
|
+
/**
|
|
1943
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
1944
|
+
*/
|
|
1945
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
1946
|
+
/**
|
|
1947
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
1948
|
+
*/
|
|
1949
|
+
grow?: boolean;
|
|
1950
|
+
/**
|
|
1951
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1952
|
+
*/
|
|
1953
|
+
row_span?: number;
|
|
1954
|
+
/**
|
|
1955
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
1956
|
+
*/
|
|
1957
|
+
column_span?: number;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
namespace show_external_directory_dialog {
|
|
1961
|
+
/**
|
|
1962
|
+
* Options for editor.ui.show_external_directory_dialog
|
|
1963
|
+
*/
|
|
1964
|
+
interface options {
|
|
1965
|
+
/**
|
|
1966
|
+
* initial file or directory path; resolved against project root if relative
|
|
1967
|
+
*/
|
|
1968
|
+
path?: string;
|
|
1969
|
+
/**
|
|
1970
|
+
* OS window title, either a string or a localization message
|
|
1971
|
+
*/
|
|
1972
|
+
title?: string | Opaque<"message">;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
namespace show_external_file_dialog {
|
|
1976
|
+
/**
|
|
1977
|
+
* Options for editor.ui.show_external_file_dialog
|
|
1978
|
+
*/
|
|
1979
|
+
interface options {
|
|
1980
|
+
/**
|
|
1981
|
+
* initial file or directory path; resolved against project root if relative
|
|
1982
|
+
*/
|
|
1983
|
+
path?: string;
|
|
1984
|
+
/**
|
|
1985
|
+
* OS window title, either a string or a localization message
|
|
1986
|
+
*/
|
|
1987
|
+
title?: string | Opaque<"message">;
|
|
1988
|
+
/**
|
|
1989
|
+
* File filters
|
|
1990
|
+
*/
|
|
1991
|
+
filters?: editor.ui.external_file_filter[];
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
namespace show_resource_dialog {
|
|
1995
|
+
/**
|
|
1996
|
+
* Options for editor.ui.show_resource_dialog
|
|
1997
|
+
*/
|
|
1998
|
+
interface options {
|
|
1999
|
+
/**
|
|
2000
|
+
* if specified, restricts selectable resources in the dialog to specified file extensions; e.g. `{"collection", "go"}`
|
|
2001
|
+
*/
|
|
2002
|
+
extensions?: string[];
|
|
2003
|
+
/**
|
|
2004
|
+
* selection mode, defaults to `"single"`
|
|
2005
|
+
*/
|
|
2006
|
+
selection?: "single" | "multiple";
|
|
2007
|
+
/**
|
|
2008
|
+
* dialog title, either a string or a localization message, defaults to `localization.message("dialog.select-resource.title")`
|
|
2009
|
+
*/
|
|
2010
|
+
title?: string | Opaque<"message">;
|
|
2011
|
+
}
|
|
1070
2012
|
}
|
|
1071
2013
|
namespace SPACING {
|
|
1072
2014
|
/**
|
|
1073
2015
|
* `"large"`
|
|
1074
2016
|
*/
|
|
1075
|
-
const LARGE:
|
|
2017
|
+
const LARGE: string & { readonly __brand: "editor.ui.SPACING.LARGE" };
|
|
1076
2018
|
/**
|
|
1077
2019
|
* `"medium"`
|
|
1078
2020
|
*/
|
|
1079
|
-
const MEDIUM:
|
|
2021
|
+
const MEDIUM: string & { readonly __brand: "editor.ui.SPACING.MEDIUM" };
|
|
1080
2022
|
/**
|
|
1081
2023
|
* `"none"`
|
|
1082
2024
|
*/
|
|
1083
|
-
const NONE:
|
|
2025
|
+
const NONE: string & { readonly __brand: "editor.ui.SPACING.NONE" };
|
|
1084
2026
|
/**
|
|
1085
2027
|
* `"small"`
|
|
1086
2028
|
*/
|
|
1087
|
-
const SMALL:
|
|
2029
|
+
const SMALL: string & { readonly __brand: "editor.ui.SPACING.SMALL" };
|
|
2030
|
+
}
|
|
2031
|
+
namespace string_field {
|
|
2032
|
+
/**
|
|
2033
|
+
* Properties for editor.ui.string_field
|
|
2034
|
+
*/
|
|
2035
|
+
interface props {
|
|
2036
|
+
/**
|
|
2037
|
+
* value
|
|
2038
|
+
*/
|
|
2039
|
+
value?: unknown;
|
|
2040
|
+
/**
|
|
2041
|
+
* value change callback, will receive the new value
|
|
2042
|
+
*/
|
|
2043
|
+
on_value_changed?: (...args: unknown[]) => unknown;
|
|
2044
|
+
/**
|
|
2045
|
+
* issue related to the input, or false if there is no issue
|
|
2046
|
+
*/
|
|
2047
|
+
issue?: editor.ui.issue | false;
|
|
2048
|
+
/**
|
|
2049
|
+
* tooltip message shown on hover; either a string or a localization message
|
|
2050
|
+
*/
|
|
2051
|
+
tooltip?: string | Opaque<"message">;
|
|
2052
|
+
/**
|
|
2053
|
+
* determines if the input component can be interacted with
|
|
2054
|
+
*/
|
|
2055
|
+
enabled?: boolean;
|
|
2056
|
+
/**
|
|
2057
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
2058
|
+
*/
|
|
2059
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
2060
|
+
/**
|
|
2061
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
2062
|
+
*/
|
|
2063
|
+
grow?: boolean;
|
|
2064
|
+
/**
|
|
2065
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2066
|
+
*/
|
|
2067
|
+
row_span?: number;
|
|
2068
|
+
/**
|
|
2069
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2070
|
+
*/
|
|
2071
|
+
column_span?: number;
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
namespace tab {
|
|
2075
|
+
/**
|
|
2076
|
+
* Properties for editor.ui.tab
|
|
2077
|
+
*/
|
|
2078
|
+
interface props {
|
|
2079
|
+
/**
|
|
2080
|
+
* tab header text, either a string or a localization message
|
|
2081
|
+
*/
|
|
2082
|
+
text: string | Opaque<"message">;
|
|
2083
|
+
/**
|
|
2084
|
+
* tab content component
|
|
2085
|
+
*/
|
|
2086
|
+
content?: Opaque<"component">;
|
|
2087
|
+
/**
|
|
2088
|
+
* tab header icon component
|
|
2089
|
+
*/
|
|
2090
|
+
icon?: Opaque<"component">;
|
|
2091
|
+
/**
|
|
2092
|
+
* determines if the tab can be selected
|
|
2093
|
+
*/
|
|
2094
|
+
enabled?: boolean;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
namespace tabs {
|
|
2098
|
+
/**
|
|
2099
|
+
* Properties for editor.ui.tabs
|
|
2100
|
+
*/
|
|
2101
|
+
interface props {
|
|
2102
|
+
/**
|
|
2103
|
+
* array of `editor.ui.tab(...)` components
|
|
2104
|
+
*/
|
|
2105
|
+
tabs?: (Opaque<"component"> | false)[];
|
|
2106
|
+
/**
|
|
2107
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
2108
|
+
*/
|
|
2109
|
+
grow?: boolean;
|
|
2110
|
+
/**
|
|
2111
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2112
|
+
*/
|
|
2113
|
+
row_span?: number;
|
|
2114
|
+
/**
|
|
2115
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2116
|
+
*/
|
|
2117
|
+
column_span?: number;
|
|
2118
|
+
}
|
|
1088
2119
|
}
|
|
1089
2120
|
namespace TEXT_ALIGNMENT {
|
|
1090
2121
|
/**
|
|
1091
2122
|
* `"center"`
|
|
1092
2123
|
*/
|
|
1093
|
-
const CENTER:
|
|
2124
|
+
const CENTER: string & { readonly __brand: "editor.ui.TEXT_ALIGNMENT.CENTER" };
|
|
1094
2125
|
/**
|
|
1095
2126
|
* `"justify"`
|
|
1096
2127
|
*/
|
|
1097
|
-
const JUSTIFY:
|
|
2128
|
+
const JUSTIFY: string & { readonly __brand: "editor.ui.TEXT_ALIGNMENT.JUSTIFY" };
|
|
1098
2129
|
/**
|
|
1099
2130
|
* `"left"`
|
|
1100
2131
|
*/
|
|
1101
|
-
const LEFT:
|
|
2132
|
+
const LEFT: string & { readonly __brand: "editor.ui.TEXT_ALIGNMENT.LEFT" };
|
|
1102
2133
|
/**
|
|
1103
2134
|
* `"right"`
|
|
1104
2135
|
*/
|
|
1105
|
-
const RIGHT:
|
|
2136
|
+
const RIGHT: string & { readonly __brand: "editor.ui.TEXT_ALIGNMENT.RIGHT" };
|
|
2137
|
+
}
|
|
2138
|
+
namespace vertical {
|
|
2139
|
+
/**
|
|
2140
|
+
* Properties for editor.ui.vertical
|
|
2141
|
+
*/
|
|
2142
|
+
interface props {
|
|
2143
|
+
/**
|
|
2144
|
+
* array of child components
|
|
2145
|
+
*/
|
|
2146
|
+
children?: (Opaque<"component"> | false)[];
|
|
2147
|
+
/**
|
|
2148
|
+
* empty space from the edges of the container to its children, either a predefined padding value or a non-negative number of pixels
|
|
2149
|
+
*/
|
|
2150
|
+
padding?: editor.ui.PADDING | number;
|
|
2151
|
+
/**
|
|
2152
|
+
* empty space between child components, either a predefined spacing value or a non-negative number of pixels; defaults to `editor.ui.SPACING.MEDIUM`
|
|
2153
|
+
*/
|
|
2154
|
+
spacing?: editor.ui.SPACING | number;
|
|
2155
|
+
/**
|
|
2156
|
+
* alignment of the component content within its assigned bounds, defaults to `editor.ui.ALIGNMENT.TOP_LEFT`
|
|
2157
|
+
*/
|
|
2158
|
+
alignment?: editor.ui.ALIGNMENT;
|
|
2159
|
+
/**
|
|
2160
|
+
* determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container
|
|
2161
|
+
*/
|
|
2162
|
+
grow?: boolean;
|
|
2163
|
+
/**
|
|
2164
|
+
* how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2165
|
+
*/
|
|
2166
|
+
row_span?: number;
|
|
2167
|
+
/**
|
|
2168
|
+
* how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
2169
|
+
*/
|
|
2170
|
+
column_span?: number;
|
|
2171
|
+
}
|
|
1106
2172
|
}
|
|
1107
2173
|
}
|
|
1108
2174
|
}
|