@defold-typescript/types 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-availability.json +333 -306
- package/api-signatures.json +3 -2
- package/api-targets.json +9 -2
- package/generated/collectionproxy.d.ts +22 -0
- package/generated/editor-vm/http.d.ts +2 -2
- package/generated/editor-vm/image.d.ts +48 -0
- package/generated/editor.d.ts +27 -8
- package/generated/gui.d.ts +35 -6
- package/generated/kinds/editor-script.d.ts +1 -0
- package/generated/material.d.ts +4 -0
- package/generated/versions/defold-1.12.4/gui.d.ts +43 -43
- package/index.d.ts +3 -0
- package/package.json +1 -1
- package/scripts/import-defold-release.ts +10 -0
- package/scripts/sync-api-docs.ts +4 -3
- package/src/api-availability.ts +0 -0
- package/src/emit-dts.ts +6 -0
- package/src/index.ts +3 -0
package/api-signatures.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"versions": {
|
|
3
|
-
"1.13.
|
|
3
|
+
"1.13.1": {
|
|
4
4
|
"b2d\u0000FUNCTION\u0000b2d.get_body\u0000[{\"types\":[\"hash\",\"string\",\"url\"],\"isOptional\":false}]->[{\"types\":[\"b2Body\"],\"isOptional\":false}]": "function get_body(url: string | Hash | Url): Opaque<\"b2Body\">;",
|
|
5
5
|
"b2d\u0000FUNCTION\u0000b2d.get_version\u0000[]->[{\"types\":[\"table\"],\"isOptional\":false}]": "function get_version(): { version: number; major: number; middle: number; minor: number };",
|
|
6
6
|
"b2d\u0000FUNCTION\u0000b2d.get_world\u0000[]->[{\"types\":[\"b2World\"],\"isOptional\":false}]": "function get_world(): Opaque<\"b2World\">;",
|
|
@@ -369,6 +369,7 @@
|
|
|
369
369
|
"collectionproxy\u0000CONSTANT\u0000collectionproxy.RESULT_LOADING\u0000": "const RESULT_LOADING: number & { readonly __brand: \"collectionproxy.RESULT_LOADING\" };",
|
|
370
370
|
"collectionproxy\u0000CONSTANT\u0000collectionproxy.RESULT_NOT_EXCLUDED\u0000": "const RESULT_NOT_EXCLUDED: number & { readonly __brand: \"collectionproxy.RESULT_NOT_EXCLUDED\" };",
|
|
371
371
|
"collectionproxy\u0000FUNCTION\u0000collectionproxy.get_resources\u0000[{\"types\":[\"url\"],\"isOptional\":false}]->[{\"types\":[\"table\"],\"isOptional\":false}]": "function get_resources(collectionproxy: Url): Hash[];",
|
|
372
|
+
"collectionproxy\u0000FUNCTION\u0000collectionproxy.load\u0000[{\"types\":[\"hash\",\"string\",\"url\"],\"isOptional\":false},{\"types\":[\"nil\",\"table\"],\"isOptional\":false},{\"types\":[\"function(self, message_id, message, sender)\"],\"isOptional\":false}]->[]": "function load(url: string | Hash | Url, options: Record<string | number, unknown> | undefined, callback: (self: unknown, message_id: unknown, message: unknown, sender: unknown) => void): void;",
|
|
372
373
|
"collectionproxy\u0000FUNCTION\u0000collectionproxy.set_collection\u0000[{\"types\":[\"hash\",\"string\",\"url\"],\"isOptional\":true},{\"types\":[\"nil\",\"string\"],\"isOptional\":true}]->[{\"types\":[\"boolean\"],\"isOptional\":false},{\"types\":[\"number\"],\"isOptional\":false}]": "function set_collection(url?: string | Hash | Url, prototype?: string): LuaMultiReturn<[boolean, number]>;",
|
|
373
374
|
"compute\u0000FUNCTION\u0000compute.get_constants\u0000[{\"types\":[\"hash\",\"string\"],\"isOptional\":false}]->[{\"types\":[\"table\"],\"isOptional\":false}]": "function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];",
|
|
374
375
|
"compute\u0000FUNCTION\u0000compute.get_samplers\u0000[{\"types\":[\"hash\",\"string\"],\"isOptional\":false}]->[{\"types\":[\"table\"],\"isOptional\":false}]": "function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];",
|
|
@@ -797,7 +798,7 @@
|
|
|
797
798
|
"gui\u0000FUNCTION\u0000gui.reset_material\u0000[{\"types\":[\"node\"],\"isOptional\":false}]->[]": "function reset_material(node: Opaque<\"node\">): void;",
|
|
798
799
|
"gui\u0000FUNCTION\u0000gui.reset_nodes\u0000[]->[]": "function reset_nodes(): void;",
|
|
799
800
|
"gui\u0000FUNCTION\u0000gui.screen_to_local\u0000[{\"types\":[\"node\"],\"isOptional\":false},{\"types\":[\"vector3\"],\"isOptional\":false}]->[{\"types\":[\"vector3\"],\"isOptional\":false}]": "function screen_to_local(node: Opaque<\"node\">, screen_position: Vector3): Vector3;",
|
|
800
|
-
"gui\u0000FUNCTION\u0000gui.set\u0000[{\"types\":[\"node\",\"url\"],\"isOptional\":false},{\"types\":[\"constant\",\"hash\",\"string\"],\"isOptional\":false},{\"types\":[\"number\",\"quaternion\",\"vector3\",\"vector4\"],\"isOptional\":false},{\"types\":[\"table\"],\"isOptional\":true}]->[]": "function set(node: Opaque<\"node\"> | Url, property: string | Hash | Opaque<\"constant\">, value
|
|
801
|
+
"gui\u0000FUNCTION\u0000gui.set\u0000[{\"types\":[\"node\",\"url\"],\"isOptional\":false},{\"types\":[\"constant\",\"hash\",\"string\"],\"isOptional\":false},{\"types\":[\"nil\",\"number\",\"quaternion\",\"vector3\",\"vector4\"],\"isOptional\":false},{\"types\":[\"table\"],\"isOptional\":true}]->[]": "function set(node: Opaque<\"node\"> | Url, property: string | Hash | Opaque<\"constant\">, value?: number | Vector4 | Vector3 | Quaternion, options?: { index?: number; key?: Hash }): void;",
|
|
801
802
|
"gui\u0000FUNCTION\u0000gui.set_adjust_mode\u0000[{\"types\":[\"node\"],\"isOptional\":false},{\"types\":[\"constant\"],\"isOptional\":false}]->[]": "function set_adjust_mode(node: Opaque<\"node\">, adjust_mode: Opaque<\"constant\">): void;",
|
|
802
803
|
"gui\u0000FUNCTION\u0000gui.set_alpha\u0000[{\"types\":[\"node\"],\"isOptional\":false},{\"types\":[\"number\"],\"isOptional\":false}]->[]": "function set_alpha(node: Opaque<\"node\">, alpha: number): void;",
|
|
803
804
|
"gui\u0000FUNCTION\u0000gui.set_blend_mode\u0000[{\"types\":[\"node\"],\"isOptional\":false},{\"types\":[\"constant\"],\"isOptional\":false}]->[]": "function set_blend_mode(node: Opaque<\"node\">, blend_mode: Opaque<\"constant\">): void;",
|
package/api-targets.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"targets": [
|
|
3
3
|
{
|
|
4
|
-
"id": "defold-1.13.
|
|
4
|
+
"id": "defold-1.13.1",
|
|
5
5
|
"default": true,
|
|
6
|
-
"fixturesDir": "fixtures/defold-1.13.
|
|
6
|
+
"fixturesDir": "fixtures/defold-1.13.1",
|
|
7
7
|
"generatedDir": "generated",
|
|
8
8
|
"coreTypesImport": "../src/core-types",
|
|
9
9
|
"source": null,
|
|
@@ -251,6 +251,7 @@
|
|
|
251
251
|
"skipFunctions": [
|
|
252
252
|
"command",
|
|
253
253
|
"http.",
|
|
254
|
+
"image.",
|
|
254
255
|
"json.",
|
|
255
256
|
"localization.",
|
|
256
257
|
"pprint",
|
|
@@ -266,6 +267,12 @@
|
|
|
266
267
|
"mapType": "editor",
|
|
267
268
|
"skipFunctions": ["server.local_url", "server.port", "server.route", "server.url"]
|
|
268
269
|
},
|
|
270
|
+
{
|
|
271
|
+
"namespace": "image",
|
|
272
|
+
"fixture": "editor_image_doc.json",
|
|
273
|
+
"outFile": "editor-vm/image.d.ts",
|
|
274
|
+
"mapType": "editor"
|
|
275
|
+
},
|
|
269
276
|
{
|
|
270
277
|
"namespace": "json",
|
|
271
278
|
"fixture": "editor_json_doc.json",
|
|
@@ -41,6 +41,28 @@ declare global {
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
function get_resources(collectionproxy: Url): Hash[];
|
|
44
|
+
/**
|
|
45
|
+
* Loads the collection referenced by a collection proxy. The proxy is also
|
|
46
|
+
* initialized and the callback receives `proxy_loading`, `proxy_ready`, or
|
|
47
|
+
* `proxy_error` messages.
|
|
48
|
+
*
|
|
49
|
+
* @param url - the collection proxy component
|
|
50
|
+
* @param options - options table, currently unused
|
|
51
|
+
* @param callback - callback
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* collectionproxy.load("#proxy", undefined, (self, message_id, message, sender) => {
|
|
55
|
+
* if (message_id === hash("proxy_ready")) {
|
|
56
|
+
* print("proxy is ready");
|
|
57
|
+
* } else if (message_id === hash("proxy_loading")) {
|
|
58
|
+
* print("progress", message.progress);
|
|
59
|
+
* } else if (message_id === hash("proxy_error")) {
|
|
60
|
+
* print("error", message.code);
|
|
61
|
+
* }
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
function load(url: string | Hash | Url, options: Record<string | number, unknown> | undefined, callback: (self: unknown, message_id: unknown, message: unknown, sender: unknown) => void): void;
|
|
44
66
|
/**
|
|
45
67
|
* The collection should be loaded by the collection proxy.
|
|
46
68
|
* Setting the collection to "nil" will revert it back to the original collection.
|
|
@@ -8,8 +8,8 @@ declare global {
|
|
|
8
8
|
* Perform an HTTP request
|
|
9
9
|
*
|
|
10
10
|
* @param url - request URL
|
|
11
|
-
* @param opts - Additional request options, a table with the following keys:`method string`request method, defaults to `"GET"``headers table`request headers, a table with string keys and values`body string`request body`as string`response body converter, either `"string"` or `"json"`
|
|
12
|
-
* @returns HTTP response, a table with the following keys:`status integer`response code`headers table`response headers, a table where each key is a lower-cased string, and each value is either a string or an array of strings if the header was repeated`body string, any, nil`response body, present only when `as` option was provided, either a string or a parsed json value
|
|
11
|
+
* @param opts - Additional request options, a table with the following keys:`method string`request method, defaults to `"GET"``headers table`request headers, a table with string keys and values`body string`request body`as string`response body converter, either `"string"` or `"json"`; mutually exclusive with `path``path string`destination file path, resolved against project root if relative; mutually exclusive with `as`
|
|
12
|
+
* @returns HTTP response, a table with the following keys:`status integer`response code`headers table`response headers, a table where each key is a lower-cased string, and each value is either a string or an array of strings if the header was repeated`body string, any, nil`response body, present only when `as` option was provided, either a string or a parsed json value`path string, nil`resolved absolute destination path, present only after a successful response was written when the `path` option was provided
|
|
13
13
|
*/
|
|
14
14
|
function request(url: string, opts?: Record<string | number, unknown>): Record<string | number, unknown>;
|
|
15
15
|
namespace server {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Editor scripting documentation
|
|
5
|
+
*/
|
|
6
|
+
namespace image {
|
|
7
|
+
/**
|
|
8
|
+
* Load an image file for reading
|
|
9
|
+
*
|
|
10
|
+
* @param path - External file path, resolved against project root if relative
|
|
11
|
+
* @returns image userdata
|
|
12
|
+
*/
|
|
13
|
+
function load_file(path: string): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Return the color of a pixel from a loaded image.
|
|
16
|
+
* Coordinates are 1-based, with `1, 1` at the top-left corner.
|
|
17
|
+
*
|
|
18
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
19
|
+
* @param x - 1-based horizontal pixel coordinate
|
|
20
|
+
* @param y - 1-based vertical pixel coordinate
|
|
21
|
+
*/
|
|
22
|
+
function pixel(image: unknown, x: number, y: number): LuaMultiReturn<[number, number, number, number]>;
|
|
23
|
+
/**
|
|
24
|
+
* Iterate over pixels in a loaded image.
|
|
25
|
+
* The iterator returns pixels row by row from top-left to bottom-right. Coordinates are 1-based.
|
|
26
|
+
*
|
|
27
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
28
|
+
* @returns iterator function returning `x, y, r, g, b, a` for each pixel
|
|
29
|
+
* @example
|
|
30
|
+
* ```lua
|
|
31
|
+
* local img = image.load_file("assets/source.png")
|
|
32
|
+
* local width, height = image.size(img)
|
|
33
|
+
* for x, y, r, g, b, a in image.pixels(img) do
|
|
34
|
+
* print(x, y, r, g, b, a)
|
|
35
|
+
* end
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
function pixels(image: unknown): (...args: unknown[]) => unknown;
|
|
39
|
+
/**
|
|
40
|
+
* Return the width and height of a loaded image.
|
|
41
|
+
*
|
|
42
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
43
|
+
*/
|
|
44
|
+
function size(image: unknown): LuaMultiReturn<[number, number]>;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {};
|
package/generated/editor.d.ts
CHANGED
|
@@ -60,35 +60,35 @@ declare global {
|
|
|
60
60
|
*/
|
|
61
61
|
function browse(url: string): void;
|
|
62
62
|
/**
|
|
63
|
-
* Check
|
|
63
|
+
* Check whether this list property supports add, clear, and remove operations on the supplied node.
|
|
64
64
|
*
|
|
65
65
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
66
66
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
67
67
|
*/
|
|
68
68
|
function can_add(node: string | Opaque<"userdata">, property: string): boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Check
|
|
70
|
+
* Check whether this property is exposed for reading on the supplied node or resource.
|
|
71
71
|
*
|
|
72
72
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
73
73
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
74
74
|
*/
|
|
75
75
|
function can_get(node: string | Opaque<"userdata">, property: string): boolean;
|
|
76
76
|
/**
|
|
77
|
-
* Check
|
|
77
|
+
* Check whether this list property supports reordering on the supplied node.
|
|
78
78
|
*
|
|
79
79
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
80
80
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
81
81
|
*/
|
|
82
82
|
function can_reorder(node: string | Opaque<"userdata">, property: string): boolean;
|
|
83
83
|
/**
|
|
84
|
-
* Check
|
|
84
|
+
* Check whether this property supports reset on the supplied node.
|
|
85
85
|
*
|
|
86
86
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
87
87
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
88
88
|
*/
|
|
89
89
|
function can_reset(node: string | Opaque<"userdata">, property: string): boolean;
|
|
90
90
|
/**
|
|
91
|
-
* Check
|
|
91
|
+
* Check whether this property is exposed for setting on the supplied node.
|
|
92
92
|
*
|
|
93
93
|
* @param node - Either resource path (e.g. `"/main/game.script"`), or internal node id passed to the script by the editor
|
|
94
94
|
* @param property - Either `"path"`, `"text"`, or a property from the Outline view (hover the label to see its editor script name)
|
|
@@ -172,6 +172,11 @@ declare global {
|
|
|
172
172
|
* @returns A table with the following keys: `path string` resolved file path `exists boolean` whether there is a file system entry at the path `is_file boolean` whether the path corresponds to a file `is_directory boolean` whether the path corresponds to a directory
|
|
173
173
|
*/
|
|
174
174
|
function external_file_attributes(path: string): Record<string | number, unknown>;
|
|
175
|
+
/**
|
|
176
|
+
* Download the latest version of the project library dependencies and reload library-provided editor scripts.
|
|
177
|
+
* This function may replace library-provided editor commands, hooks, routes, and UI contributed by editor scripts, so it should typically be the last operation performed by a command.
|
|
178
|
+
*/
|
|
179
|
+
function fetch_libraries(): void;
|
|
175
180
|
/**
|
|
176
181
|
* Get a value of a node property inside the editor.
|
|
177
182
|
* Some properties might be read-only, and some might be unavailable in different contexts, so you should use `editor.can_get()` before reading them and `editor.can_set()` before making the editor set them.
|
|
@@ -453,7 +458,7 @@ declare global {
|
|
|
453
458
|
/**
|
|
454
459
|
* Check box with a label
|
|
455
460
|
*
|
|
456
|
-
* @param props - Optional props: `value boolean`determines if the checkbox should appear checked`on_value_changed function`change callback, will receive the new value`text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
|
|
461
|
+
* @param props - Optional props: `value boolean`determines if the checkbox should appear checked`on_value_changed function`change callback, will receive the new value`indeterminate boolean`determines if the checkbox should appear in the mixed state`text string, message`the text, either a string or a localization message`text_alignment string`text alignment within paragraph bounds; either:
|
|
457
462
|
* - `editor.ui.TEXT_ALIGNMENT.LEFT`
|
|
458
463
|
* - `editor.ui.TEXT_ALIGNMENT.CENTER`
|
|
459
464
|
* - `editor.ui.TEXT_ALIGNMENT.RIGHT`
|
|
@@ -482,7 +487,7 @@ declare global {
|
|
|
482
487
|
/**
|
|
483
488
|
* Dialog component, a top-level window component that can't be used as a child of other components
|
|
484
489
|
*
|
|
485
|
-
* @param props - Required props: `title string, message`OS dialog window title, either a string or a localization message Optional props: `header component`top part of the dialog, defaults to `editor.ui.heading({text = props.title})``content component`content of the dialog`buttons component[]`array of `editor.ui.dialog_button(...)` components, footer of the dialog. Defaults to a single Close button
|
|
490
|
+
* @param props - Required props: `title string, message`OS dialog window title, either a string or a localization message Optional props: `header component`top part of the dialog, defaults to `editor.ui.heading({text = props.title})``content component`content of the dialog`width number`initial width of the dialog window in pixels`height number`initial height of the dialog window in pixels`resizable boolean`determines if the dialog window can be resized by the user`buttons component[]`array of `editor.ui.dialog_button(...)` components, footer of the dialog. Defaults to a single Close button`modal boolean`if set to `false`, the dialog window stays on top but does not block interaction with the editor
|
|
486
491
|
* @returns UI component
|
|
487
492
|
*/
|
|
488
493
|
function dialog(props: Record<string | number, unknown>): Opaque<"component">;
|
|
@@ -776,7 +781,7 @@ declare global {
|
|
|
776
781
|
*/
|
|
777
782
|
function separator(props: Record<string | number, unknown>): Opaque<"component">;
|
|
778
783
|
/**
|
|
779
|
-
* Show a
|
|
784
|
+
* Show a dialog and await a result
|
|
780
785
|
*
|
|
781
786
|
* @param dialog - a component that resolves to `editor.ui.dialog(...)`
|
|
782
787
|
* @returns dialog result, the value used as a `result` prop in a `editor.ui.dialog_button({...})` selected by the user, or `nil` if the dialog was closed and there was no `cancel = true` dialog button with `result` prop set
|
|
@@ -819,6 +824,20 @@ declare global {
|
|
|
819
824
|
* @returns UI component
|
|
820
825
|
*/
|
|
821
826
|
function string_field(props: Record<string | number, unknown>): Opaque<"component">;
|
|
827
|
+
/**
|
|
828
|
+
* Tab used in the `tabs` prop of `editor.ui.tabs(...)`
|
|
829
|
+
*
|
|
830
|
+
* @param props - Required props: `text string, message`tab header text, either a string or a localization message Optional props: `content component`tab content component`icon component`tab header icon component`enabled boolean`determines if the tab can be selected
|
|
831
|
+
* @returns UI component
|
|
832
|
+
*/
|
|
833
|
+
function tab(props: Record<string | number, unknown>): Opaque<"component">;
|
|
834
|
+
/**
|
|
835
|
+
* Layout container that shows one selected tab content at a time
|
|
836
|
+
*
|
|
837
|
+
* @param props - Optional props: `tabs component[]`array of `editor.ui.tab(...)` components`grow boolean`determines if the component should grow to fill available space in a `horizontal` or `vertical` layout container`row_span integer`how many rows the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.`column_span integer`how many columns the component spans inside a grid container, must be positive. This prop is only useful for components inside a `grid` container.
|
|
838
|
+
* @returns UI component
|
|
839
|
+
*/
|
|
840
|
+
function tabs(props: Record<string | number, unknown>): Opaque<"component">;
|
|
822
841
|
/**
|
|
823
842
|
* A hook that caches the result of a computation between re-renders.
|
|
824
843
|
* See `editor.ui.component` for hooks caveats and rules. If any of the arguments to `use_memo` change during a component refresh (checked with `==`), the value will be recomputed.
|
package/generated/gui.d.ts
CHANGED
|
@@ -1667,11 +1667,31 @@ declare global {
|
|
|
1667
1667
|
*/
|
|
1668
1668
|
function reset_nodes(): void;
|
|
1669
1669
|
/**
|
|
1670
|
-
*
|
|
1670
|
+
* Converts a screen-space position to the local position value for the supplied node.
|
|
1671
|
+
* The conversion takes the parent transform, anchors, adjust mode, and adjust reference into account.
|
|
1671
1672
|
*
|
|
1672
|
-
* @param node - node
|
|
1673
|
-
* @param screen_position - screen position
|
|
1674
|
-
* @returns local position
|
|
1673
|
+
* @param node - node whose local position space should be used
|
|
1674
|
+
* @param screen_position - screen-space position
|
|
1675
|
+
* @returns local position value for the node
|
|
1676
|
+
* @example
|
|
1677
|
+
* ```ts
|
|
1678
|
+
* // Animate a node to the pressed pointer position:
|
|
1679
|
+
* export default defineScript({
|
|
1680
|
+
* init() {
|
|
1681
|
+
* msg.post(".", "acquire_input_focus");
|
|
1682
|
+
* return { marker: gui.get_node("marker") };
|
|
1683
|
+
* },
|
|
1684
|
+
*
|
|
1685
|
+
* on_input(self, action_id, action) {
|
|
1686
|
+
* if (action_id === hash("touch") && action.pressed) {
|
|
1687
|
+
* const screen_position = vmath.vector3(action.screen_x, action.screen_y, 0);
|
|
1688
|
+
* const target_position = gui.screen_to_local(self.marker, screen_position);
|
|
1689
|
+
* gui.animate(self.marker, gui.PROP_POSITION, target_position, gui.EASING_OUTQUAD, 0.2);
|
|
1690
|
+
* return true;
|
|
1691
|
+
* }
|
|
1692
|
+
* },
|
|
1693
|
+
* });
|
|
1694
|
+
* ```
|
|
1675
1695
|
*/
|
|
1676
1696
|
function screen_to_local(node: Opaque<"node">, screen_position: Vector3): Vector3;
|
|
1677
1697
|
/**
|
|
@@ -1719,7 +1739,7 @@ declare global {
|
|
|
1719
1739
|
*
|
|
1720
1740
|
* @param node - node to set the property for, or msg.url() to the gui itself
|
|
1721
1741
|
* @param property - the property to set
|
|
1722
|
-
* @param value - the property to set
|
|
1742
|
+
* @param value - the property to set. `nil` is only supported for removing runtime texture mappings with `gui.set(msg.url(), "textures", nil, {key = ...})`.
|
|
1723
1743
|
* @param options - optional options table (only applicable for material constants)
|
|
1724
1744
|
* - `index` number index into array property (1 based)
|
|
1725
1745
|
* - `key` hash name of internal property
|
|
@@ -1767,9 +1787,18 @@ declare global {
|
|
|
1767
1787
|
* }
|
|
1768
1788
|
* },
|
|
1769
1789
|
* });
|
|
1790
|
+
*
|
|
1791
|
+
* // Remove a named runtime texture resource mapping:
|
|
1792
|
+
* const atlas_id = resource.create_atlas("/runtime.texturesetc", atlas_params);
|
|
1793
|
+
* gui.set(msg.url(), "textures", atlas_id, { key: "runtime_texture" });
|
|
1794
|
+
* gui.set_texture(gui.get_node("box"), "runtime_texture");
|
|
1795
|
+
*
|
|
1796
|
+
* // Later, remove the GUI mapping before releasing the atlas resource.
|
|
1797
|
+
* gui.set(msg.url(), "textures", undefined, { key: "runtime_texture" });
|
|
1798
|
+
* resource.release(atlas_id);
|
|
1770
1799
|
* ```
|
|
1771
1800
|
*/
|
|
1772
|
-
function set(node: Opaque<"node"> | Url, property: string | Hash | Opaque<"constant">, value
|
|
1801
|
+
function set(node: Opaque<"node"> | Url, property: string | Hash | Opaque<"constant">, value?: number | Vector4 | Vector3 | Quaternion, options?: { index?: number; key?: Hash }): void;
|
|
1773
1802
|
/**
|
|
1774
1803
|
* Sets the adjust mode on a node.
|
|
1775
1804
|
* The adjust mode defines how the node will adjust itself to screen
|
package/generated/material.d.ts
CHANGED
|
@@ -239,6 +239,8 @@ declare global {
|
|
|
239
239
|
* - `graphics.SEMANTIC_TYPE_BONE_INDICES`
|
|
240
240
|
*
|
|
241
241
|
* - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
|
|
242
|
+
*
|
|
243
|
+
* - `graphics.SEMANTIC_TYPE_MORPH_TARGET_WEIGHTS`
|
|
242
244
|
* @example
|
|
243
245
|
* ```ts
|
|
244
246
|
* const vertex_attributes = material.get_vertex_attributes(resource.material("/my_material.materialc"));
|
|
@@ -432,6 +434,8 @@ declare global {
|
|
|
432
434
|
* - `graphics.SEMANTIC_TYPE_BONE_INDICES`
|
|
433
435
|
*
|
|
434
436
|
* - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
|
|
437
|
+
*
|
|
438
|
+
* - `graphics.SEMANTIC_TYPE_MORPH_TARGET_WEIGHTS`
|
|
435
439
|
* @example
|
|
436
440
|
* ```ts
|
|
437
441
|
* material.set_vertex_attributes(resource.material("/my_material.materialc"), { tint_attribute: { value: vmath.vector4(1, 0, 0, 1), semantic_type: graphics.SEMANTIC_TYPE_COLOR } });
|
|
@@ -1726,49 +1726,49 @@ declare global {
|
|
|
1726
1726
|
* - `index` number index into array property (1 based)
|
|
1727
1727
|
* - `key` hash name of internal property
|
|
1728
1728
|
* @example
|
|
1729
|
-
* ```
|
|
1730
|
-
*
|
|
1731
|
-
*
|
|
1732
|
-
*
|
|
1733
|
-
* gui.set(node, "position.x", node_position.x + 128)
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1736
|
-
* gui.
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
1740
|
-
*
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1745
|
-
*
|
|
1746
|
-
*
|
|
1747
|
-
* gui.set(node, "
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1755
|
-
* gui.set(node, "
|
|
1756
|
-
*
|
|
1757
|
-
* gui.set(node, "
|
|
1758
|
-
*
|
|
1759
|
-
*
|
|
1760
|
-
*
|
|
1761
|
-
*
|
|
1762
|
-
*
|
|
1763
|
-
*
|
|
1764
|
-
*
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1769
|
-
*
|
|
1770
|
-
*
|
|
1771
|
-
*
|
|
1729
|
+
* ```lua
|
|
1730
|
+
* Updates the position property on an existing node:
|
|
1731
|
+
* local node = gui.get_node("my_box_node")
|
|
1732
|
+
* local node_position = gui.get(node, "position")
|
|
1733
|
+
* gui.set(node, "position.x", node_position.x + 128)
|
|
1734
|
+
*
|
|
1735
|
+
* Updates the rotation property on an existing node:
|
|
1736
|
+
* local node = gui.get_node("my_box_node")
|
|
1737
|
+
* gui.set(node, "rotation", vmath.quat_rotation_z(math.rad(45)))
|
|
1738
|
+
* -- this is equivalent to:
|
|
1739
|
+
* gui.set(node, "euler.z", 45)
|
|
1740
|
+
* -- or using the entire vector:
|
|
1741
|
+
* gui.set(node, "euler", vmath.vector3(0,0,45))
|
|
1742
|
+
* -- or using the set_rotation
|
|
1743
|
+
* gui.set_rotation(node, vmath.vector3(0,0,45))
|
|
1744
|
+
*
|
|
1745
|
+
* Sets various material constants for a node:
|
|
1746
|
+
* local node = gui.get_node("my_box_node")
|
|
1747
|
+
* gui.set(node, "tint", vmath.vector4(1,0,0,1))
|
|
1748
|
+
* -- matrix4 is also supported
|
|
1749
|
+
* gui.set(node, "light_matrix", vmath.matrix4())
|
|
1750
|
+
* -- update a constant in an array at position 4. the array is specified in the shader as:
|
|
1751
|
+
* -- uniform vec4 tint_array[4]; // lua is 1 based, shader is 0 based
|
|
1752
|
+
* gui.set(node, "tint_array", vmath.vector4(1,0,0,1), { index = 4 })
|
|
1753
|
+
* -- update a matrix constant in an array at position 4. the array is specified in the shader as:
|
|
1754
|
+
* -- uniform mat4 light_matrix_array[4];
|
|
1755
|
+
* gui.set(node, "light_matrix_array", vmath.matrix4(), { index = 4 })
|
|
1756
|
+
* -- update a sub-element in a constant
|
|
1757
|
+
* gui.set(node, "tint.x", 1)
|
|
1758
|
+
* -- update a sub-element in an array constant at position 4
|
|
1759
|
+
* gui.set(node, "tint_array.x", 1, {index = 4})
|
|
1760
|
+
*
|
|
1761
|
+
* Set a named property
|
|
1762
|
+
* function on_message(self, message_id, message, sender)
|
|
1763
|
+
* if message_id == hash("set_font") then
|
|
1764
|
+
* gui.set(msg.url(), "fonts", message.font, {key = "my_font_name"})
|
|
1765
|
+
* gui.set_font(gui.get_node("text"), "my_font_name")
|
|
1766
|
+
* elseif message_id == hash("set_texture") then
|
|
1767
|
+
* gui.set(msg.url(), "textures", message.texture, {key = "my_texture"})
|
|
1768
|
+
* gui.set_texture(gui.get_node("box"), "my_texture")
|
|
1769
|
+
* gui.play_flipbook(gui.get_node("box"), "logo_256")
|
|
1770
|
+
* end
|
|
1771
|
+
* end
|
|
1772
1772
|
* ```
|
|
1773
1773
|
*/
|
|
1774
1774
|
function set(node: Opaque<"node"> | Url, property: string | Hash | Opaque<"constant">, value: number | Vector4 | Vector3 | Quaternion, options?: { index?: number; key?: Hash }): void;
|
package/index.d.ts
CHANGED
|
@@ -61,13 +61,16 @@ export {
|
|
|
61
61
|
type ApiSymbolIdentity,
|
|
62
62
|
type AvailabilityLabel,
|
|
63
63
|
type AvailabilityLabelKind,
|
|
64
|
+
type AvailabilityLabelOptions,
|
|
64
65
|
availabilityLabel,
|
|
65
66
|
deriveAvailabilityMatrix,
|
|
66
67
|
groupByLogicalName,
|
|
67
68
|
isSignatureTransition,
|
|
68
69
|
type LogicalNameGroup,
|
|
69
70
|
normalizedFunctionSignature,
|
|
71
|
+
signatureTransitionNames,
|
|
70
72
|
symbolIdentityKey,
|
|
73
|
+
symbolNameKey,
|
|
71
74
|
type VersionSurface,
|
|
72
75
|
} from "./src/api-availability";
|
|
73
76
|
export type { ApiFunction, ApiModule, ApiParameter, ApiVariable } from "./src/api-doc";
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { isKnownDefoldTypeToken } from "../src/emit-dts";
|
|
|
4
4
|
import { refDocCacheDir, resolveRefDoc } from "./doc-source";
|
|
5
5
|
import {
|
|
6
6
|
apiElementIdentity,
|
|
7
|
+
EDITOR_MANIFEST,
|
|
7
8
|
IGNORED_UPSTREAM,
|
|
8
9
|
mergeApiDocs,
|
|
9
10
|
readZip,
|
|
@@ -15,6 +16,14 @@ const EXACT_VERSION = /^\d+\.\d+\.\d+$/;
|
|
|
15
16
|
const LUA_NAMESPACE = /^[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)*$/;
|
|
16
17
|
const PACKAGE_ROOT = resolve(import.meta.dir, "..");
|
|
17
18
|
|
|
19
|
+
// Editor-scripting namespaces are mapped, but not by `api-targets.json`: they
|
|
20
|
+
// emit through `EDITOR_MODULE_MANIFEST` rather than the runtime module set the
|
|
21
|
+
// baseline is built from, so the baseline can never vouch for them. Only
|
|
22
|
+
// `EDITOR_MANIFEST` is consulted — `EDITOR_VM_MANIFEST` entries are split out of
|
|
23
|
+
// the editor document and never surface as an upstream `info.namespace`, so
|
|
24
|
+
// excusing their bare names would suppress a real runtime namespace instead.
|
|
25
|
+
const EDITOR_MAPPED_NAMESPACES = new Set(EDITOR_MANIFEST.map((source) => source.namespace));
|
|
26
|
+
|
|
18
27
|
// The set of namespaces promoted into the generated surface at Defold 1.13.0.
|
|
19
28
|
// Held here rather than derived from the root release model because the
|
|
20
29
|
// per-package `rootDir` boundary forbids importing outside this package tree;
|
|
@@ -325,6 +334,7 @@ export function buildReleaseImportPlan(input: {
|
|
|
325
334
|
(source) =>
|
|
326
335
|
source.functionCount > 0 &&
|
|
327
336
|
!baselineByNamespace.has(source.namespace) &&
|
|
337
|
+
!EDITOR_MAPPED_NAMESPACES.has(source.namespace) &&
|
|
328
338
|
!IGNORED_UPSTREAM.has(source.namespace),
|
|
329
339
|
)
|
|
330
340
|
.map((source) => ({
|
package/scripts/sync-api-docs.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { MODULE_MANIFEST } from "./regen";
|
|
|
11
11
|
// model because the per-package `rootDir` boundary forbids a types-package
|
|
12
12
|
// module importing outside its own tree; `scripts/release-model.test.ts`
|
|
13
13
|
// correspondence-guards these against the model so drift fails CI.
|
|
14
|
-
export const DEFOLD_VERSION = "1.13.
|
|
14
|
+
export const DEFOLD_VERSION = "1.13.1";
|
|
15
15
|
export const refDocUrl = (version = DEFOLD_VERSION): string =>
|
|
16
16
|
`https://github.com/defold/defold/releases/download/${version}/ref-doc.zip`;
|
|
17
17
|
|
|
@@ -184,6 +184,7 @@ export const EDITOR_MANIFEST: readonly SyncManifestEntry[] = [
|
|
|
184
184
|
// `http_doc.json` / `json_doc.json` / `zlib_doc.json`.
|
|
185
185
|
export const EDITOR_VM_MANIFEST: readonly SyncManifestEntry[] = [
|
|
186
186
|
editorVm("http"),
|
|
187
|
+
editorVm("image"),
|
|
187
188
|
editorVm("json"),
|
|
188
189
|
editorVm("localization"),
|
|
189
190
|
editorVm("zip"),
|
|
@@ -204,7 +205,7 @@ function editorVm(namespace: string): SyncManifestEntry {
|
|
|
204
205
|
function entry(
|
|
205
206
|
namespace: string,
|
|
206
207
|
zipEntry: string,
|
|
207
|
-
fixture: string = `fixtures/defold-1.13.
|
|
208
|
+
fixture: string = `fixtures/defold-1.13.1/${namespace.replace(/\./g, "_")}_doc.json`,
|
|
208
209
|
mergeEntries?: readonly string[],
|
|
209
210
|
): SyncManifestEntry {
|
|
210
211
|
return { namespace, zipEntry, fixture, ...(mergeEntries ? { mergeEntries } : {}) };
|
|
@@ -235,7 +236,7 @@ function ext(namespace: string, repo: string, tag: string, path: string): Extens
|
|
|
235
236
|
repo,
|
|
236
237
|
tag,
|
|
237
238
|
path,
|
|
238
|
-
fixture: `fixtures/defold-1.13.
|
|
239
|
+
fixture: `fixtures/defold-1.13.1/${namespace}_doc.json`,
|
|
239
240
|
};
|
|
240
241
|
}
|
|
241
242
|
|
package/src/api-availability.ts
CHANGED
|
Binary file
|
package/src/emit-dts.ts
CHANGED
|
@@ -157,6 +157,12 @@ export const ARBITRARY_TABLE_SLOTS = new Set([
|
|
|
157
157
|
// is opaque to the field-list parser and the whole-slot `Record` is faithful.
|
|
158
158
|
"render.render_target",
|
|
159
159
|
"render.set_render_target",
|
|
160
|
+
// reserved-but-undocumented options bag: `collectionproxy.load`'s `options`
|
|
161
|
+
// slot is documented verbatim as "options table, currently unused" and accepts
|
|
162
|
+
// `nil`, so upstream defines no field list to emit. The whole-slot `Record` is
|
|
163
|
+
// faithful to what is documented today. If a later release fills the bag in,
|
|
164
|
+
// drop this entry so the missing fields resurface under `recordTables`.
|
|
165
|
+
"collectionproxy.load",
|
|
160
166
|
]);
|
|
161
167
|
|
|
162
168
|
// Per-slot companion to ARBITRARY_TABLE_SLOTS (`element:kind:name`), for a
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export {
|
|
|
5
5
|
type ApiSymbolIdentity,
|
|
6
6
|
type AvailabilityLabel,
|
|
7
7
|
type AvailabilityLabelKind,
|
|
8
|
+
type AvailabilityLabelOptions,
|
|
8
9
|
applyMigrationOverlay,
|
|
9
10
|
availabilityLabel,
|
|
10
11
|
type Box2dBackend,
|
|
@@ -14,7 +15,9 @@ export {
|
|
|
14
15
|
isSignatureTransition,
|
|
15
16
|
type LogicalNameGroup,
|
|
16
17
|
normalizedFunctionSignature,
|
|
18
|
+
signatureTransitionNames,
|
|
17
19
|
symbolIdentityKey,
|
|
20
|
+
symbolNameKey,
|
|
18
21
|
type VersionSurface,
|
|
19
22
|
validateAvailability,
|
|
20
23
|
} from "./api-availability";
|