@defold-typescript/types 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +13 -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 +85 -24
- 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 +16 -5
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Matrix4, Url, Vector3 } from "../../../src/core-types";
|
|
2
|
+
import type { Hash, Matrix4, Url, Vector3 } from "../../../src/core-types";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
/**
|
|
@@ -30,7 +30,7 @@ declare global {
|
|
|
30
30
|
* @param camera - camera id
|
|
31
31
|
* @returns the effective aspect ratio.
|
|
32
32
|
*/
|
|
33
|
-
function get_aspect_ratio(camera?: Url | number): number;
|
|
33
|
+
function get_aspect_ratio(camera?: Url | number | string | Hash): number;
|
|
34
34
|
/**
|
|
35
35
|
* Returns whether auto aspect ratio is enabled. When enabled, the camera automatically
|
|
36
36
|
* calculates aspect ratio from render target dimensions. When disabled, uses the
|
|
@@ -39,7 +39,7 @@ declare global {
|
|
|
39
39
|
* @param camera - camera id
|
|
40
40
|
* @returns true if auto aspect ratio is enabled
|
|
41
41
|
*/
|
|
42
|
-
function get_auto_aspect_ratio(camera?: Url | number): boolean;
|
|
42
|
+
function get_auto_aspect_ratio(camera?: Url | number | string | Hash): boolean;
|
|
43
43
|
/**
|
|
44
44
|
* This function returns a table with all the camera URLs that have been
|
|
45
45
|
* registered in the render context.
|
|
@@ -62,28 +62,28 @@ declare global {
|
|
|
62
62
|
* @param camera - camera id
|
|
63
63
|
* @returns true if the camera is enabled
|
|
64
64
|
*/
|
|
65
|
-
function get_enabled(camera?: Url | number): boolean;
|
|
65
|
+
function get_enabled(camera?: Url | number | string | Hash): boolean;
|
|
66
66
|
/**
|
|
67
67
|
* get far z
|
|
68
68
|
*
|
|
69
69
|
* @param camera - camera id
|
|
70
70
|
* @returns the far z.
|
|
71
71
|
*/
|
|
72
|
-
function get_far_z(camera?: Url | number): number;
|
|
72
|
+
function get_far_z(camera?: Url | number | string | Hash): number;
|
|
73
73
|
/**
|
|
74
74
|
* get field of view
|
|
75
75
|
*
|
|
76
76
|
* @param camera - camera id
|
|
77
77
|
* @returns the field of view.
|
|
78
78
|
*/
|
|
79
|
-
function get_fov(camera?: Url | number): number;
|
|
79
|
+
function get_fov(camera?: Url | number | string | Hash): number;
|
|
80
80
|
/**
|
|
81
81
|
* get near z
|
|
82
82
|
*
|
|
83
83
|
* @param camera - camera id
|
|
84
84
|
* @returns the near z.
|
|
85
85
|
*/
|
|
86
|
-
function get_near_z(camera?: Url | number): number;
|
|
86
|
+
function get_near_z(camera?: Url | number | string | Hash): number;
|
|
87
87
|
/**
|
|
88
88
|
* Gets the orthographic zoom calculated from the current window and project dimensions
|
|
89
89
|
* in auto-fit and auto-cover modes. Returns 1.0 in fixed mode.
|
|
@@ -91,7 +91,7 @@ declare global {
|
|
|
91
91
|
* @param camera - camera id
|
|
92
92
|
* @returns the calculated orthographic auto zoom.
|
|
93
93
|
*/
|
|
94
|
-
function get_orthographic_auto_zoom(camera?: Url | number): number;
|
|
94
|
+
function get_orthographic_auto_zoom(camera?: Url | number | string | Hash): number;
|
|
95
95
|
/**
|
|
96
96
|
* get orthographic zoom mode
|
|
97
97
|
*
|
|
@@ -99,7 +99,7 @@ declare global {
|
|
|
99
99
|
* @returns one of camera.ORTHO_MODE_FIXED, camera.ORTHO_MODE_AUTO_FIT or
|
|
100
100
|
* camera.ORTHO_MODE_AUTO_COVER
|
|
101
101
|
*/
|
|
102
|
-
function get_orthographic_mode(camera?: Url | number): number;
|
|
102
|
+
function get_orthographic_mode(camera?: Url | number | string | Hash): number;
|
|
103
103
|
/**
|
|
104
104
|
* Gets the positive user-controlled orthographic zoom multiplier. In auto-fit and auto-cover
|
|
105
105
|
* modes, this value is multiplied with camera.get_orthographic_auto_zoom(camera).
|
|
@@ -107,21 +107,21 @@ declare global {
|
|
|
107
107
|
* @param camera - camera id
|
|
108
108
|
* @returns the positive zoom multiplier when the camera uses orthographic projection.
|
|
109
109
|
*/
|
|
110
|
-
function get_orthographic_zoom(camera?: Url | number): number;
|
|
110
|
+
function get_orthographic_zoom(camera?: Url | number | string | Hash): number;
|
|
111
111
|
/**
|
|
112
112
|
* get projection matrix
|
|
113
113
|
*
|
|
114
114
|
* @param camera - camera id
|
|
115
115
|
* @returns the projection matrix.
|
|
116
116
|
*/
|
|
117
|
-
function get_projection(camera?: Url | number): Matrix4;
|
|
117
|
+
function get_projection(camera?: Url | number | string | Hash): Matrix4;
|
|
118
118
|
/**
|
|
119
119
|
* get view matrix
|
|
120
120
|
*
|
|
121
121
|
* @param camera - camera id
|
|
122
122
|
* @returns the view matrix.
|
|
123
123
|
*/
|
|
124
|
-
function get_view(camera?: Url | number): Matrix4;
|
|
124
|
+
function get_view(camera?: Url | number | string | Hash): Matrix4;
|
|
125
125
|
/**
|
|
126
126
|
* Converts a screen-space 2D point with view depth to a 3D world point.
|
|
127
127
|
* z is the view depth in world units measured from the camera plane along the camera forward axis.
|
|
@@ -154,7 +154,7 @@ declare global {
|
|
|
154
154
|
* });
|
|
155
155
|
* ```
|
|
156
156
|
*/
|
|
157
|
-
function screen_to_world(pos: Vector3, camera?: Url | number): Vector3;
|
|
157
|
+
function screen_to_world(pos: Vector3, camera?: Url | number | string | Hash): Vector3;
|
|
158
158
|
/**
|
|
159
159
|
* Converts 2D screen coordinates (x,y) to the 3D world-space point on the camera's near plane for that pixel.
|
|
160
160
|
* If a camera isn't specified, the last enabled camera is used.
|
|
@@ -178,7 +178,7 @@ declare global {
|
|
|
178
178
|
* });
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
|
-
function screen_xy_to_world(x: number, y: number, camera?: Url | number): Vector3;
|
|
181
|
+
function screen_xy_to_world(x: number, y: number, camera?: Url | number | string | Hash): Vector3;
|
|
182
182
|
/**
|
|
183
183
|
* Sets the manual aspect ratio for the camera. This value is only used when
|
|
184
184
|
* auto aspect ratio is disabled. To disable auto aspect ratio and use this
|
|
@@ -187,7 +187,7 @@ declare global {
|
|
|
187
187
|
* @param camera - camera id
|
|
188
188
|
* @param aspect_ratio - the manual aspect ratio value.
|
|
189
189
|
*/
|
|
190
|
-
function set_aspect_ratio(camera: Url | number | undefined, aspect_ratio: number): void;
|
|
190
|
+
function set_aspect_ratio(camera: Url | number | string | Hash | undefined, aspect_ratio: number): void;
|
|
191
191
|
/**
|
|
192
192
|
* Enables or disables automatic aspect ratio calculation. When enabled (true),
|
|
193
193
|
* the camera automatically calculates aspect ratio from render target dimensions.
|
|
@@ -196,35 +196,35 @@ declare global {
|
|
|
196
196
|
* @param camera - camera id
|
|
197
197
|
* @param auto_aspect_ratio - true to enable auto aspect ratio
|
|
198
198
|
*/
|
|
199
|
-
function set_auto_aspect_ratio(camera: Url | number | undefined, auto_aspect_ratio: boolean): void;
|
|
199
|
+
function set_auto_aspect_ratio(camera: Url | number | string | Hash | undefined, auto_aspect_ratio: boolean): void;
|
|
200
200
|
/**
|
|
201
201
|
* set far z
|
|
202
202
|
*
|
|
203
203
|
* @param camera - camera id
|
|
204
204
|
* @param far_z - the far z.
|
|
205
205
|
*/
|
|
206
|
-
function set_far_z(camera: Url | number | undefined, far_z: number): void;
|
|
206
|
+
function set_far_z(camera: Url | number | string | Hash | undefined, far_z: number): void;
|
|
207
207
|
/**
|
|
208
208
|
* set field of view
|
|
209
209
|
*
|
|
210
210
|
* @param camera - camera id
|
|
211
211
|
* @param fov - the field of view.
|
|
212
212
|
*/
|
|
213
|
-
function set_fov(camera: Url | number | undefined, fov: number): void;
|
|
213
|
+
function set_fov(camera: Url | number | string | Hash | undefined, fov: number): void;
|
|
214
214
|
/**
|
|
215
215
|
* set near z
|
|
216
216
|
*
|
|
217
217
|
* @param camera - camera id
|
|
218
218
|
* @param near_z - the near z.
|
|
219
219
|
*/
|
|
220
|
-
function set_near_z(camera: Url | number | undefined, near_z: number): void;
|
|
220
|
+
function set_near_z(camera: Url | number | string | Hash | undefined, near_z: number): void;
|
|
221
221
|
/**
|
|
222
222
|
* set orthographic zoom mode
|
|
223
223
|
*
|
|
224
224
|
* @param camera - camera id
|
|
225
225
|
* @param mode - camera.ORTHO_MODE_FIXED, camera.ORTHO_MODE_AUTO_FIT or camera.ORTHO_MODE_AUTO_COVER
|
|
226
226
|
*/
|
|
227
|
-
function set_orthographic_mode(camera: Url | number | undefined, mode: number): void;
|
|
227
|
+
function set_orthographic_mode(camera: Url | number | string | Hash | undefined, mode: number): void;
|
|
228
228
|
/**
|
|
229
229
|
* Sets the positive user-controlled orthographic zoom multiplier. In auto-fit and auto-cover
|
|
230
230
|
* modes, this value is multiplied with camera.get_orthographic_auto_zoom(camera).
|
|
@@ -232,7 +232,7 @@ declare global {
|
|
|
232
232
|
* @param camera - camera id
|
|
233
233
|
* @param orthographic_zoom - the positive zoom multiplier when the camera uses orthographic projection.
|
|
234
234
|
*/
|
|
235
|
-
function set_orthographic_zoom(camera: Url | number | undefined, orthographic_zoom: number): void;
|
|
235
|
+
function set_orthographic_zoom(camera: Url | number | string | Hash | undefined, orthographic_zoom: number): void;
|
|
236
236
|
/**
|
|
237
237
|
* Converts a 3D world position to screen-space coordinates with view depth.
|
|
238
238
|
* Returns a vector3 where x and y are in screen pixels and z is the view depth in world units
|
|
@@ -251,7 +251,7 @@ declare global {
|
|
|
251
251
|
* const screen_pos = camera.world_to_screen(world_pos);
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
|
-
function world_to_screen(world_pos: Vector3, camera?: Url | number): Vector3;
|
|
254
|
+
function world_to_screen(world_pos: Vector3, camera?: Url | number | string | Hash): Vector3;
|
|
255
255
|
interface properties {
|
|
256
256
|
/**
|
|
257
257
|
* The ratio between the frustum width and height. Used when calculating the
|
|
@@ -279,7 +279,7 @@ declare global {
|
|
|
279
279
|
* in auto fit and auto cover modes. The value is 1.0 in fixed mode.
|
|
280
280
|
* The type of the property is float.
|
|
281
281
|
*/
|
|
282
|
-
orthographic_auto_zoom: number;
|
|
282
|
+
readonly orthographic_auto_zoom: number;
|
|
283
283
|
/**
|
|
284
284
|
* Positive zoom multiplier when using an orthographic projection. In auto fit and auto cover
|
|
285
285
|
* modes, this value is multiplied with the calculated orthographic_auto_zoom value.
|
|
@@ -290,12 +290,12 @@ declare global {
|
|
|
290
290
|
* READ ONLY The calculated projection matrix of the camera.
|
|
291
291
|
* The type of the property is matrix4.
|
|
292
292
|
*/
|
|
293
|
-
projection: Matrix4;
|
|
293
|
+
readonly projection: Matrix4;
|
|
294
294
|
/**
|
|
295
295
|
* READ ONLY The calculated view matrix of the camera.
|
|
296
296
|
* The type of the property is matrix4.
|
|
297
297
|
*/
|
|
298
|
-
view: Matrix4;
|
|
298
|
+
readonly view: Matrix4;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -43,8 +43,8 @@ declare global {
|
|
|
43
43
|
* @param scale - uniform scaling to apply to the newly spawned collection (must be greater than 0).
|
|
44
44
|
* @returns a table mapping the id:s from the collection to the new instance id:s
|
|
45
45
|
* @example
|
|
46
|
+
* How to spawn a collection of game objects:
|
|
46
47
|
* ```ts
|
|
47
|
-
* // How to spawn a collection of game objects:
|
|
48
48
|
* export default defineScript({
|
|
49
49
|
* init() {
|
|
50
50
|
* // Spawn a small group of enemies.
|
|
@@ -76,8 +76,10 @@ declare global {
|
|
|
76
76
|
* return { enemy_ids };
|
|
77
77
|
* },
|
|
78
78
|
* });
|
|
79
|
-
*
|
|
80
|
-
*
|
|
79
|
+
* ```
|
|
80
|
+
* @example
|
|
81
|
+
* How to delete a spawned collection:
|
|
82
|
+
* ```ts
|
|
81
83
|
* function delete_enemies(self: { enemy_ids: Hash[] }) {
|
|
82
84
|
* go.delete(self.enemy_ids);
|
|
83
85
|
* }
|
|
@@ -92,12 +94,10 @@ declare global {
|
|
|
92
94
|
* @returns status of the collection factory component
|
|
93
95
|
*
|
|
94
96
|
* - `collectionfactory.STATUS_UNLOADED`
|
|
95
|
-
*
|
|
96
97
|
* - `collectionfactory.STATUS_LOADING`
|
|
97
|
-
*
|
|
98
98
|
* - `collectionfactory.STATUS_LOADED`
|
|
99
99
|
*/
|
|
100
|
-
function get_status(url
|
|
100
|
+
function get_status(url: string | Hash | Url): collectionfactory.Status;
|
|
101
101
|
/**
|
|
102
102
|
* Resources loaded are referenced by the collection factory component until the existing (parent) collection is destroyed or collectionfactory.unload is called.
|
|
103
103
|
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
@@ -117,7 +117,7 @@ declare global {
|
|
|
117
117
|
* collectionfactory.load("#factory", (self, url, result) => {});
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
-
function load(url
|
|
120
|
+
function load(url: string | Hash | Url, complete_function: (self: unknown, url: unknown, result: unknown) => void): void;
|
|
121
121
|
/**
|
|
122
122
|
* Changes the prototype for the collection factory.
|
|
123
123
|
* Setting the prototype to "nil" will revert back to the original prototype.
|
|
@@ -132,7 +132,7 @@ declare global {
|
|
|
132
132
|
* const ids = collectionfactory.create("#factory", go.get_world_position(), vmath.quat());
|
|
133
133
|
* ```
|
|
134
134
|
*/
|
|
135
|
-
function set_prototype(url
|
|
135
|
+
function set_prototype(url: string | Hash | Url, prototype: string | undefined): void;
|
|
136
136
|
/**
|
|
137
137
|
* This decreases the reference count for each resource loaded with collectionfactory.load. If reference is zero, the resource is destroyed.
|
|
138
138
|
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
@@ -144,7 +144,7 @@ declare global {
|
|
|
144
144
|
* collectionfactory.unload("#factory");
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
function unload(url
|
|
147
|
+
function unload(url: string | Hash | Url): void;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -40,7 +40,7 @@ declare global {
|
|
|
40
40
|
* }
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
function get_resources(collectionproxy: Url):
|
|
43
|
+
function get_resources(collectionproxy: Url | string | Hash): string[];
|
|
44
44
|
/**
|
|
45
45
|
* The collection should be loaded by the collection proxy.
|
|
46
46
|
* Setting the collection to "nil" will revert it back to the original collection.
|
|
@@ -64,7 +64,7 @@ declare global {
|
|
|
64
64
|
* msg.post("/go#collectionproxy", "enable");
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
function set_collection(url
|
|
67
|
+
function set_collection(url: string | Hash | Url, prototype: string | undefined): LuaMultiReturn<[boolean, number]>;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -18,37 +18,21 @@ declare global {
|
|
|
18
18
|
* number the type of the constant. Supported values:
|
|
19
19
|
*
|
|
20
20
|
* - `material.CONSTANT_TYPE_USER`
|
|
21
|
-
*
|
|
22
21
|
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
23
|
-
*
|
|
24
22
|
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
25
|
-
*
|
|
26
23
|
* - `material.CONSTANT_TYPE_WORLD`
|
|
27
|
-
*
|
|
28
24
|
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
29
|
-
*
|
|
30
25
|
* - `material.CONSTANT_TYPE_VIEW`
|
|
31
|
-
*
|
|
32
26
|
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
33
|
-
*
|
|
34
27
|
* - `material.CONSTANT_TYPE_NORMAL`
|
|
35
|
-
*
|
|
36
28
|
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
37
|
-
*
|
|
38
29
|
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
39
|
-
*
|
|
40
30
|
* - `material.CONSTANT_TYPE_TIME`
|
|
41
|
-
*
|
|
42
31
|
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
43
|
-
*
|
|
44
32
|
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
45
|
-
*
|
|
46
33
|
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
47
|
-
*
|
|
48
34
|
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
49
|
-
*
|
|
50
35
|
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
51
|
-
*
|
|
52
36
|
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
53
37
|
*
|
|
54
38
|
* `value`
|
|
@@ -72,48 +56,34 @@ declare global {
|
|
|
72
56
|
* number the u wrap mode of the texture sampler. Supported values:
|
|
73
57
|
*
|
|
74
58
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
75
|
-
*
|
|
76
59
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
77
|
-
*
|
|
78
60
|
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
79
|
-
*
|
|
80
61
|
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
81
62
|
*
|
|
82
63
|
* `v_wrap`
|
|
83
64
|
* number the v wrap mode of the texture sampler. Supported values:
|
|
84
65
|
*
|
|
85
66
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
86
|
-
*
|
|
87
67
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
88
|
-
*
|
|
89
68
|
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
90
|
-
*
|
|
91
69
|
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
92
70
|
*
|
|
93
71
|
* `min_filter`
|
|
94
72
|
* number the min filter mode of the texture sampler. Supported values:
|
|
95
73
|
*
|
|
96
74
|
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
97
|
-
*
|
|
98
75
|
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
99
|
-
*
|
|
100
76
|
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
101
|
-
*
|
|
102
77
|
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
103
|
-
*
|
|
104
78
|
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
105
|
-
*
|
|
106
79
|
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
107
|
-
*
|
|
108
80
|
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
109
81
|
*
|
|
110
82
|
* `mag_filter`
|
|
111
83
|
* number the mag filter mode of the texture sampler
|
|
112
84
|
*
|
|
113
85
|
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
114
|
-
*
|
|
115
86
|
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
116
|
-
*
|
|
117
87
|
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
118
88
|
*
|
|
119
89
|
* `max_anisotropy`
|
|
@@ -146,28 +116,19 @@ declare global {
|
|
|
146
116
|
* number the type of the texture. Supported values:
|
|
147
117
|
*
|
|
148
118
|
* - `graphics.TEXTURE_TYPE_2D`
|
|
149
|
-
*
|
|
150
119
|
* - `graphics.TEXTURE_TYPE_2D_ARRAY`
|
|
151
|
-
*
|
|
152
120
|
* - `graphics.TEXTURE_TYPE_CUBE_MAP`
|
|
153
|
-
*
|
|
154
121
|
* - `graphics.TEXTURE_TYPE_IMAGE_2D`
|
|
155
|
-
*
|
|
156
122
|
* - `graphics.TEXTURE_TYPE_3D`
|
|
157
|
-
*
|
|
158
123
|
* - `graphics.TEXTURE_TYPE_IMAGE_3D`
|
|
159
124
|
*
|
|
160
125
|
* `flags`
|
|
161
126
|
* number the flags of the texture. This field is a bit mask of these supported flags:
|
|
162
127
|
*
|
|
163
128
|
* - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
|
|
164
|
-
*
|
|
165
129
|
* - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
|
|
166
|
-
*
|
|
167
130
|
* - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
|
|
168
|
-
*
|
|
169
131
|
* - `graphics.TEXTURE_USAGE_FLAG_INPUT`
|
|
170
|
-
*
|
|
171
132
|
* - `graphics.TEXTURE_USAGE_FLAG_COLOR`
|
|
172
133
|
* @example
|
|
173
134
|
* ```ts
|
|
@@ -185,37 +146,21 @@ declare global {
|
|
|
185
146
|
* number the type of the constant. Supported values:
|
|
186
147
|
*
|
|
187
148
|
* - `material.CONSTANT_TYPE_USER`
|
|
188
|
-
*
|
|
189
149
|
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
190
|
-
*
|
|
191
150
|
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
192
|
-
*
|
|
193
151
|
* - `material.CONSTANT_TYPE_WORLD`
|
|
194
|
-
*
|
|
195
152
|
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
196
|
-
*
|
|
197
153
|
* - `material.CONSTANT_TYPE_VIEW`
|
|
198
|
-
*
|
|
199
154
|
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
200
|
-
*
|
|
201
155
|
* - `material.CONSTANT_TYPE_NORMAL`
|
|
202
|
-
*
|
|
203
156
|
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
204
|
-
*
|
|
205
157
|
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
206
|
-
*
|
|
207
158
|
* - `material.CONSTANT_TYPE_TIME`
|
|
208
|
-
*
|
|
209
159
|
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
210
|
-
*
|
|
211
160
|
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
212
|
-
*
|
|
213
161
|
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
214
|
-
*
|
|
215
162
|
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
216
|
-
*
|
|
217
163
|
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
218
|
-
*
|
|
219
164
|
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
220
165
|
*
|
|
221
166
|
* `value`
|
|
@@ -237,48 +182,34 @@ declare global {
|
|
|
237
182
|
* number the u wrap mode of the texture sampler. Supported values:
|
|
238
183
|
*
|
|
239
184
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
240
|
-
*
|
|
241
185
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
242
|
-
*
|
|
243
186
|
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
244
|
-
*
|
|
245
187
|
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
246
188
|
*
|
|
247
189
|
* `v_wrap`
|
|
248
190
|
* number the v wrap mode of the texture sampler. Supported values:
|
|
249
191
|
*
|
|
250
192
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
251
|
-
*
|
|
252
193
|
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
253
|
-
*
|
|
254
194
|
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
255
|
-
*
|
|
256
195
|
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
257
196
|
*
|
|
258
197
|
* `min_filter`
|
|
259
198
|
* number the min filter mode of the texture sampler. Supported values:
|
|
260
199
|
*
|
|
261
200
|
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
262
|
-
*
|
|
263
201
|
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
264
|
-
*
|
|
265
202
|
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
266
|
-
*
|
|
267
203
|
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
268
|
-
*
|
|
269
204
|
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
270
|
-
*
|
|
271
205
|
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
272
|
-
*
|
|
273
206
|
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
274
207
|
*
|
|
275
208
|
* `mag_filter`
|
|
276
209
|
* number the mag filter mode of the texture sampler
|
|
277
210
|
*
|
|
278
211
|
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
279
|
-
*
|
|
280
212
|
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
281
|
-
*
|
|
282
213
|
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
283
214
|
*
|
|
284
215
|
* `max_anisotropy`
|
|
@@ -99,7 +99,7 @@ declare global {
|
|
|
99
99
|
* reads user field from a loaded crash dump
|
|
100
100
|
*
|
|
101
101
|
* @param handle - crash dump handle
|
|
102
|
-
* @param index - user data slot index
|
|
102
|
+
* @param index - user data slot index. **0️⃣ 0-based; passed to Defold unchanged.**
|
|
103
103
|
* @returns user data value recorded in the crash dump
|
|
104
104
|
*/
|
|
105
105
|
function get_user_field(handle: number, index: number): string;
|
|
@@ -127,7 +127,7 @@ declare global {
|
|
|
127
127
|
* a crash occurs. This can be user id:s, breadcrumb data etc.
|
|
128
128
|
* There are 32 slots indexed from 0. Each slot stores at most 255 characters.
|
|
129
129
|
*
|
|
130
|
-
* @param index - slot index. 0-indexed
|
|
130
|
+
* @param index - slot index. 0-indexed. **0️⃣ 0-based; passed to Defold unchanged.**
|
|
131
131
|
* @param value - string value to store
|
|
132
132
|
*/
|
|
133
133
|
function set_user_field(index: number, value: string): void;
|
|
@@ -17,7 +17,7 @@ declare global {
|
|
|
17
17
|
* @param tiles - unbounded 2d grid of tiles
|
|
18
18
|
* @param x - x coordinate of a tile
|
|
19
19
|
* @param y - y coordinate of a tile
|
|
20
|
-
* @returns full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise
|
|
20
|
+
* @returns full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
21
21
|
*/
|
|
22
22
|
export function get_info(tiles: unknown, x: number, y: number): Record<string | number, unknown>;
|
|
23
23
|
/**
|
|
@@ -26,7 +26,7 @@ declare global {
|
|
|
26
26
|
* @param tiles - unbounded 2d grid of tiles
|
|
27
27
|
* @param x - x coordinate of a tile
|
|
28
28
|
* @param y - y coordinate of a tile
|
|
29
|
-
* @returns 1-indexed tile index of a tilemap's tilesource
|
|
29
|
+
* @returns 1-indexed tile index of a tilemap's tilesource. **⚠️ 1-based; passed to Defold unchanged.**
|
|
30
30
|
*/
|
|
31
31
|
export function get_tile(tiles: unknown, x: number, y: number): number;
|
|
32
32
|
/**
|
|
@@ -69,7 +69,7 @@ declare global {
|
|
|
69
69
|
* @param tiles - unbounded 2d grid of tiles
|
|
70
70
|
* @param x - x coordinate of a tile
|
|
71
71
|
* @param y - y coordinate of a tile
|
|
72
|
-
* @param tile_or_info - Either 1-indexed tile index of a tilemap's tilesource or full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise
|
|
72
|
+
* @param tile_or_info - Either 1-indexed tile index of a tilemap's tilesource or full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ 1-based; passed to Defold unchanged.** **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
73
73
|
* @returns unbounded 2d grid of tiles
|
|
74
74
|
*/
|
|
75
75
|
export function set(tiles: unknown, x: number, y: number, tile_or_info: number | Record<string | number, unknown>): unknown;
|
|
@@ -22,7 +22,7 @@ declare global {
|
|
|
22
22
|
* - `"arm64-macos"`
|
|
23
23
|
* - `"x86_64-linux"`
|
|
24
24
|
*/
|
|
25
|
-
const platform:
|
|
25
|
+
const platform: "x86_64-win32" | "x86_64-macos" | "arm64-macos" | "x86_64-linux";
|
|
26
26
|
/**
|
|
27
27
|
* A string, version name of Defold
|
|
28
28
|
*/
|
|
@@ -34,22 +34,26 @@ declare global {
|
|
|
34
34
|
* @param options - table of command line options for bob, without the leading dashes (`--`). You can use snake_case instead of kebab-case for option keys. Only long option names are supported (i.e. `output`, not `o`). Supported value types are strings, integers and booleans. If an option takes no arguments, use a boolean (i.e. `true`). If an option may be repeated, you can use an array of values.
|
|
35
35
|
* @param commands - bob commands, e.g. `"resolve"` or `"build"`
|
|
36
36
|
* @example
|
|
37
|
+
* Print help in the console:
|
|
37
38
|
* ```ts
|
|
38
|
-
* // Print help in the console:
|
|
39
39
|
* editor.bob({ help: true });
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* ```
|
|
41
|
+
* @example
|
|
42
|
+
* Bundle the game for the host platform:
|
|
43
|
+
* ```ts
|
|
42
44
|
* const opts = { archive: true, platform: editor.platform };
|
|
43
45
|
* editor.bob(opts, "distclean", "resolve", "build", "bundle");
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* ```
|
|
47
|
+
* @example
|
|
48
|
+
* Using snake_cased and repeated options:
|
|
49
|
+
* ```ts
|
|
50
|
+
* const opts = {
|
|
47
51
|
* archive: true,
|
|
48
52
|
* platform: editor.platform,
|
|
49
53
|
* build_server: "https://build.my-company.com",
|
|
50
54
|
* settings: ["test.ini", "headless.ini"],
|
|
51
55
|
* };
|
|
52
|
-
* editor.bob(
|
|
56
|
+
* editor.bob(opts, "distclean", "resolve", "build");
|
|
53
57
|
* ```
|
|
54
58
|
*/
|
|
55
59
|
function bob(options?: Record<string | number, unknown>, ...commands: string[]): void;
|
|
@@ -111,15 +115,19 @@ declare global {
|
|
|
111
115
|
*
|
|
112
116
|
* @param resources - ] Array of resource paths (strings starting with `/`) or resource definitions, lua tables with the following keys:`1 string`required, resource path (starting with `/`)`2 string`optional, created resource content
|
|
113
117
|
* @example
|
|
118
|
+
* Create a single resource from template:
|
|
114
119
|
* ```ts
|
|
115
|
-
* // Create a single resource from template:
|
|
116
120
|
* editor.create_resources(["/npc.go"]);
|
|
117
|
-
*
|
|
118
|
-
*
|
|
121
|
+
* ```
|
|
122
|
+
* @example
|
|
123
|
+
* Create multiple resources:
|
|
124
|
+
* ```ts
|
|
119
125
|
* editor.create_resources(["/npc.go", "/levels/1.collection", "/levels/2.collection"]);
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
126
|
+
* ```
|
|
127
|
+
* @example
|
|
128
|
+
* Create a resource with custom content:
|
|
129
|
+
* ```ts
|
|
130
|
+
* editor.create_resources([{ 1: "/npc.script", 2: "go.property('hp', 100)" }]);
|
|
123
131
|
* ```
|
|
124
132
|
*/
|
|
125
133
|
function create_resources(resources: unknown): void;
|
|
@@ -144,20 +152,22 @@ declare global {
|
|
|
144
152
|
* @param options - Optional options table. Supported entries:
|
|
145
153
|
* - boolean `reload_resources`: make the editor reload the resources from disk after the command is executed, default `true`
|
|
146
154
|
* - string `out`: standard output mode, either:
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
155
|
+
* - `"pipe"`: the output is piped to the editor console (this is the default behavior).
|
|
156
|
+
* - `"capture"`: capture and return the output to the editor script with trailing newlines trimmed.
|
|
157
|
+
* - `"discard"`: the output is discarded completely.
|
|
150
158
|
* - string `err`: standard error output mode, either:
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
159
|
+
* - `"pipe"`: the error output is piped to the editor console (this is the default behavior).
|
|
160
|
+
* - `"stdout"`: the error output is redirected to the standard output of the process.
|
|
161
|
+
* - `"discard"`: the error output is discarded completely.
|
|
154
162
|
* @returns If `out` option is set to `"capture"`, returns the output as string with trimmed trailing newlines. Otherwise, returns `nil`.
|
|
155
163
|
* @example
|
|
164
|
+
* Make a directory with spaces in it:
|
|
156
165
|
* ```ts
|
|
157
|
-
* // Make a directory with spaces in it:
|
|
158
166
|
* editor.execute("mkdir", "new dir");
|
|
159
|
-
*
|
|
160
|
-
*
|
|
167
|
+
* ```
|
|
168
|
+
* @example
|
|
169
|
+
* Read the git status:
|
|
170
|
+
* ```ts
|
|
161
171
|
* const status = editor.execute("git", "status", "--porcelain", {
|
|
162
172
|
* reload_resources: false,
|
|
163
173
|
* out: "capture",
|
|
@@ -840,7 +850,7 @@ declare global {
|
|
|
840
850
|
*
|
|
841
851
|
* const counterButton = editor.ui.component((props) => {
|
|
842
852
|
* const [count, setCount] = editor.ui.use_state((props as { count: unknown }).count);
|
|
843
|
-
* const onPressed = editor.ui.use_memo(makeListener, setCount);
|
|
853
|
+
* const onPressed = editor.ui.use_memo(makeListener, setCount) as () => void;
|
|
844
854
|
* return editor.ui.button({
|
|
845
855
|
* text: tostring(count),
|
|
846
856
|
* on_pressed: onPressed,
|