@defold-typescript/types 0.34.0 → 0.36.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-signatures.json +9547 -186
- package/api-targets.json +9 -66
- package/examples/translations.json +6 -6
- package/generated/buffer.d.ts +2 -2
- package/generated/collectionfactory.d.ts +2 -2
- package/generated/factory.d.ts +13 -12
- package/generated/gui.d.ts +23 -23
- package/generated/kinds/gui-script.d.ts +0 -4
- package/generated/kinds/render-script.d.ts +1 -4
- package/generated/kinds/script.d.ts +0 -4
- package/generated/model.d.ts +2 -2
- package/generated/profiler.d.ts +2 -4
- package/generated/render.d.ts +7 -155
- package/generated/sys.d.ts +1 -1
- package/generated/versions/defold-1.12.4/buffer.d.ts +2 -2
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +2 -2
- package/generated/versions/defold-1.12.4/factory.d.ts +13 -12
- package/generated/versions/defold-1.12.4/gui.d.ts +23 -23
- package/generated/versions/defold-1.12.4/index.d.ts +9 -4
- package/generated/versions/defold-1.12.4/model.d.ts +2 -2
- package/generated/versions/defold-1.12.4/profiler.d.ts +2 -4
- package/generated/versions/defold-1.12.4/render.d.ts +7 -155
- package/generated/versions/defold-1.12.4/sys.d.ts +1 -1
- package/generated/versions/defold-1.12.4/vmath.d.ts +0 -19
- package/generated/versions/defold-1.12.4/window.d.ts +2 -4
- package/generated/versions/defold-1.12.4/zlib.d.ts +2 -1
- package/generated/versions/defold-1.13.0/buffer.d.ts +2 -2
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +2 -2
- package/generated/versions/defold-1.13.0/factory.d.ts +13 -12
- package/generated/versions/defold-1.13.0/gui.d.ts +23 -23
- package/generated/versions/defold-1.13.0/index.d.ts +9 -4
- package/generated/versions/defold-1.13.0/model.d.ts +2 -2
- package/generated/versions/defold-1.13.0/profiler.d.ts +2 -4
- package/generated/versions/defold-1.13.0/render.d.ts +7 -155
- package/generated/versions/defold-1.13.0/sys.d.ts +1 -1
- package/generated/versions/defold-1.13.0/vmath.d.ts +0 -19
- package/generated/versions/defold-1.13.0/window.d.ts +2 -4
- package/generated/versions/defold-1.13.0/zlib.d.ts +2 -1
- package/generated/vmath.d.ts +0 -19
- package/generated/window.d.ts +2 -4
- package/generated/zlib.d.ts +2 -1
- package/index.d.ts +2 -4
- package/package.json +7 -2
- package/scripts/extension-goldens.ts +23 -0
- package/scripts/generate-api-signatures.ts +72 -8
- package/scripts/materialize-version.ts +15 -1
- package/scripts/regen.ts +109 -27
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +5 -61
- package/src/emit-dts.ts +359 -58
- package/src/index.ts +1 -0
- package/src/optional-correction-provenance.ts +13 -2
- package/src/render-overloads.d.ts +46 -0
- package/src/vmath-overloads.d.ts +19 -0
- package/generated/iac.d.ts +0 -18
- package/generated/iap.d.ts +0 -60
- package/generated/push.d.ts +0 -66
- package/generated/versions/defold-1.12.4/iac.d.ts +0 -18
- package/generated/versions/defold-1.12.4/iap.d.ts +0 -60
- package/generated/versions/defold-1.12.4/push.d.ts +0 -66
- package/generated/versions/defold-1.12.4/webview.d.ts +0 -71
- package/generated/versions/defold-1.13.0/iac.d.ts +0 -18
- package/generated/versions/defold-1.13.0/iap.d.ts +0 -60
- package/generated/versions/defold-1.13.0/push.d.ts +0 -66
- package/generated/versions/defold-1.13.0/webview.d.ts +0 -71
- package/generated/webview.d.ts +0 -71
- package/scripts/fidelity-audit.ts +0 -684
|
@@ -46,13 +46,13 @@ declare global {
|
|
|
46
46
|
* @example
|
|
47
47
|
* ```ts
|
|
48
48
|
* // Clear the color buffer and the depth buffer.
|
|
49
|
-
* render.
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* const buffers = new LuaMap<render.ClearBufferKey, number | Vector4>();
|
|
50
|
+
* buffers.set(graphics.BUFFER_TYPE_COLOR0_BIT, vmath.vector4(0, 0, 0, 0));
|
|
51
|
+
* buffers.set(graphics.BUFFER_TYPE_DEPTH_BIT, 1);
|
|
52
|
+
* render.clear(buffers);
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
function clear(buffers: LuaMap<number, number | Vector4>): void;
|
|
55
|
+
function clear(buffers: LuaMap<number & { readonly __brand: "graphics.BUFFER_TYPE_COLOR0_BIT" } | number & { readonly __brand: "graphics.BUFFER_TYPE_DEPTH_BIT" } | number & { readonly __brand: "graphics.BUFFER_TYPE_STENCIL_BIT" }, number | Vector4>): void;
|
|
56
56
|
/**
|
|
57
57
|
* Constant buffers are used to set shader program variables and are optionally passed to the `render.draw()` function.
|
|
58
58
|
* The buffer's constant elements can be indexed like an ordinary Lua table, but you can't iterate over them with pairs() or ipairs().
|
|
@@ -136,7 +136,7 @@ declare global {
|
|
|
136
136
|
* render.draw(self.tile_pred);
|
|
137
137
|
* ```
|
|
138
138
|
*/
|
|
139
|
-
function disable_state(state:
|
|
139
|
+
function disable_state(state: number & { readonly __brand: "graphics.STATE_DEPTH_TEST" } | number & { readonly __brand: "graphics.STATE_STENCIL_TEST" } | number & { readonly __brand: "graphics.STATE_BLEND" } | number & { readonly __brand: "graphics.STATE_ALPHA_TEST" } | number & { readonly __brand: "graphics.STATE_CULL_FACE" } | number & { readonly __brand: "graphics.STATE_POLYGON_OFFSET_FILL" }): void;
|
|
140
140
|
/**
|
|
141
141
|
* Disables a texture that has previourly been enabled.
|
|
142
142
|
*
|
|
@@ -315,7 +315,7 @@ declare global {
|
|
|
315
315
|
* render.disable_state(graphics.STATE_STENCIL_TEST);
|
|
316
316
|
* ```
|
|
317
317
|
*/
|
|
318
|
-
function enable_state(state:
|
|
318
|
+
function enable_state(state: number & { readonly __brand: "graphics.STATE_DEPTH_TEST" } | number & { readonly __brand: "graphics.STATE_STENCIL_TEST" } | number & { readonly __brand: "graphics.STATE_BLEND" } | number & { readonly __brand: "graphics.STATE_ALPHA_TEST" } | number & { readonly __brand: "graphics.STATE_CULL_FACE" } | number & { readonly __brand: "graphics.STATE_POLYGON_OFFSET_FILL" }): void;
|
|
319
319
|
/**
|
|
320
320
|
* Sets the specified texture handle for a render target attachment or a regular texture
|
|
321
321
|
* that should be used for rendering. The texture can be bound to either a texture unit
|
|
@@ -510,154 +510,6 @@ declare global {
|
|
|
510
510
|
* ```
|
|
511
511
|
*/
|
|
512
512
|
function predicate(tags: (string | Hash)[]): number;
|
|
513
|
-
/**
|
|
514
|
-
* Creates a new render target according to the supplied
|
|
515
|
-
* specification table.
|
|
516
|
-
* The table should contain keys specifying which buffers should be created
|
|
517
|
-
* with what parameters. Each buffer key should have a table value consisting
|
|
518
|
-
* of parameters. The following parameter keys are available:
|
|
519
|
-
*
|
|
520
|
-
* Key
|
|
521
|
-
* Values
|
|
522
|
-
*
|
|
523
|
-
* `format`
|
|
524
|
-
* `graphics.TEXTURE_FORMAT_LUMINANCE`
|
|
525
|
-
* `graphics.TEXTURE_FORMAT_RGB`
|
|
526
|
-
* `graphics.TEXTURE_FORMAT_RGBA`
|
|
527
|
-
* `graphics.TEXTURE_FORMAT_DEPTH`
|
|
528
|
-
* `graphics.TEXTURE_FORMAT_STENCIL`
|
|
529
|
-
* `graphics.TEXTURE_FORMAT_RGBA32F`
|
|
530
|
-
* `graphics.TEXTURE_FORMAT_RGBA16F`
|
|
531
|
-
*
|
|
532
|
-
* `width`
|
|
533
|
-
* number
|
|
534
|
-
*
|
|
535
|
-
* `height`
|
|
536
|
-
* number
|
|
537
|
-
*
|
|
538
|
-
* `min_filter` (optional)
|
|
539
|
-
* `graphics.TEXTURE_FILTER_LINEAR`
|
|
540
|
-
* `graphics.TEXTURE_FILTER_NEAREST`
|
|
541
|
-
*
|
|
542
|
-
* `mag_filter` (optional)
|
|
543
|
-
* `graphics.TEXTURE_FILTER_LINEAR`
|
|
544
|
-
* `graphics.TEXTURE_FILTER_NEAREST`
|
|
545
|
-
*
|
|
546
|
-
* `u_wrap` (optional)
|
|
547
|
-
* `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
548
|
-
* `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
549
|
-
* `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
550
|
-
* `graphics.TEXTURE_WRAP_REPEAT`
|
|
551
|
-
*
|
|
552
|
-
* `v_wrap` (optional)
|
|
553
|
-
* `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
554
|
-
* `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
555
|
-
* `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
556
|
-
* `graphics.TEXTURE_WRAP_REPEAT`
|
|
557
|
-
*
|
|
558
|
-
* `flags` (optional)
|
|
559
|
-
* `render.TEXTURE_BIT` (only applicable to depth and stencil buffers)
|
|
560
|
-
*
|
|
561
|
-
* The render target can be created to support multiple color attachments. Each attachment can have different format settings and texture filters,
|
|
562
|
-
* but attachments must be added in sequence, meaning you cannot create a render target at slot 0 and 3.
|
|
563
|
-
* Instead it has to be created with all four buffer types ranging from [0..3] (as denoted by graphics.BUFFER_TYPE_COLORX_BIT where 'X' is the attachment you want to create).
|
|
564
|
-
* It is not guaranteed that the device running the script can support creating render targets with multiple color attachments. To check if the device can support multiple attachments,
|
|
565
|
-
* you can check if the `render` table contains any of the `BUFFER_TYPE_COLOR1_BIT`, `BUFFER_TYPE_COLOR2_BIT` or `BUFFER_TYPE_COLOR3_BIT` constants:
|
|
566
|
-
*
|
|
567
|
-
* `function init(self)
|
|
568
|
-
* if graphics.BUFFER_TYPE_COLOR1_BIT == nil then
|
|
569
|
-
* -- this devices does not support multiple color attachments
|
|
570
|
-
* end
|
|
571
|
-
* end
|
|
572
|
-
* `
|
|
573
|
-
*
|
|
574
|
-
* @param name - render target name
|
|
575
|
-
* @param parameters - table of buffer parameters, see the description for available keys and values
|
|
576
|
-
* @returns new render target
|
|
577
|
-
* @example
|
|
578
|
-
* ```ts
|
|
579
|
-
* // How to create a new render target and draw to it:
|
|
580
|
-
* export default defineScript({
|
|
581
|
-
* init() {
|
|
582
|
-
* // render target buffer parameters
|
|
583
|
-
* const color_params = {
|
|
584
|
-
* format: graphics.TEXTURE_FORMAT_RGBA,
|
|
585
|
-
* width: render.get_window_width(),
|
|
586
|
-
* height: render.get_window_height(),
|
|
587
|
-
* min_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
588
|
-
* mag_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
589
|
-
* u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
590
|
-
* v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
591
|
-
* };
|
|
592
|
-
* const depth_params = {
|
|
593
|
-
* format: graphics.TEXTURE_FORMAT_DEPTH,
|
|
594
|
-
* width: render.get_window_width(),
|
|
595
|
-
* height: render.get_window_height(),
|
|
596
|
-
* u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
597
|
-
* v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
598
|
-
* };
|
|
599
|
-
* return {
|
|
600
|
-
* my_render_target: render.render_target({
|
|
601
|
-
* [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params,
|
|
602
|
-
* [graphics.BUFFER_TYPE_DEPTH_BIT]: depth_params,
|
|
603
|
-
* }),
|
|
604
|
-
* };
|
|
605
|
-
* },
|
|
606
|
-
*
|
|
607
|
-
* update(self, dt) {
|
|
608
|
-
* // enable target so all drawing is done to it
|
|
609
|
-
* render.set_render_target(self.my_render_target);
|
|
610
|
-
*
|
|
611
|
-
* // draw a predicate to the render target
|
|
612
|
-
* render.draw(self.my_pred);
|
|
613
|
-
* },
|
|
614
|
-
* });
|
|
615
|
-
*
|
|
616
|
-
* // How to create a render target with multiple outputs:
|
|
617
|
-
* export default defineScript({
|
|
618
|
-
* init() {
|
|
619
|
-
* // render target buffer parameters
|
|
620
|
-
* const color_params_rgba = {
|
|
621
|
-
* format: graphics.TEXTURE_FORMAT_RGBA,
|
|
622
|
-
* width: render.get_window_width(),
|
|
623
|
-
* height: render.get_window_height(),
|
|
624
|
-
* min_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
625
|
-
* mag_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
626
|
-
* u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
627
|
-
* v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
628
|
-
* };
|
|
629
|
-
* const color_params_float = {
|
|
630
|
-
* format: graphics.TEXTURE_FORMAT_RG32F,
|
|
631
|
-
* width: render.get_window_width(),
|
|
632
|
-
* height: render.get_window_height(),
|
|
633
|
-
* min_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
634
|
-
* mag_filter: graphics.TEXTURE_FILTER_LINEAR,
|
|
635
|
-
* u_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
636
|
-
* v_wrap: graphics.TEXTURE_WRAP_CLAMP_TO_EDGE,
|
|
637
|
-
* };
|
|
638
|
-
*
|
|
639
|
-
* // Create a render target with three color attachments
|
|
640
|
-
* // Note: No depth buffer is attached here
|
|
641
|
-
* return {
|
|
642
|
-
* my_render_target: render.render_target({
|
|
643
|
-
* [graphics.BUFFER_TYPE_COLOR0_BIT]: color_params_rgba,
|
|
644
|
-
* [graphics.BUFFER_TYPE_COLOR1_BIT]: color_params_rgba,
|
|
645
|
-
* [graphics.BUFFER_TYPE_COLOR2_BIT]: color_params_float,
|
|
646
|
-
* }),
|
|
647
|
-
* };
|
|
648
|
-
* },
|
|
649
|
-
*
|
|
650
|
-
* update(self, dt) {
|
|
651
|
-
* // enable target so all drawing is done to it
|
|
652
|
-
* render.enable_render_target(self.my_render_target);
|
|
653
|
-
*
|
|
654
|
-
* // draw a predicate to the render target
|
|
655
|
-
* render.draw(self.my_pred);
|
|
656
|
-
* },
|
|
657
|
-
* });
|
|
658
|
-
* ```
|
|
659
|
-
*/
|
|
660
|
-
function render_target(name: string, parameters: Record<string | number, unknown>): Opaque<"render_target">;
|
|
661
513
|
/**
|
|
662
514
|
* Specifies the arithmetic used when computing pixel values that are written to the frame
|
|
663
515
|
* buffer. In RGBA mode, pixels can be drawn using a function that blends the source RGBA
|
|
@@ -228,7 +228,7 @@ declare global {
|
|
|
228
228
|
* }
|
|
229
229
|
* ```
|
|
230
230
|
*/
|
|
231
|
-
function get_connectivity():
|
|
231
|
+
function get_connectivity(): number & { readonly __brand: "sys.NETWORK_DISCONNECTED" } | number & { readonly __brand: "sys.NETWORK_CONNECTED_CELLULAR" } | number & { readonly __brand: "sys.NETWORK_CONNECTED" };
|
|
232
232
|
/**
|
|
233
233
|
* Returns a table with engine information.
|
|
234
234
|
*
|
|
@@ -91,25 +91,6 @@ declare global {
|
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
93
|
function dot(v1: Vector3 | Vector4, v2: Vector3 | Vector4): number;
|
|
94
|
-
/**
|
|
95
|
-
* Converts euler angles (x, y, z) in degrees into a quaternion
|
|
96
|
-
* The error is guaranteed to be less than 0.001.
|
|
97
|
-
* If the first argument is vector3, its values are used as x, y, z angles.
|
|
98
|
-
*
|
|
99
|
-
* @param x - rotation around x-axis in degrees or vector3 with euler angles in degrees
|
|
100
|
-
* @param y - rotation around y-axis in degrees
|
|
101
|
-
* @param z - rotation around z-axis in degrees
|
|
102
|
-
* @returns quaternion describing an equivalent rotation (231 (YZX) rotation sequence)
|
|
103
|
-
* @example
|
|
104
|
-
* ```ts
|
|
105
|
-
* const q = vmath.euler_to_quat(0, 45, 90);
|
|
106
|
-
* print(q); // => vmath.quat(0.27059805393219, 0.27059805393219, 0.65328145027161, 0.65328145027161)
|
|
107
|
-
*
|
|
108
|
-
* const v = vmath.vector3(0, 0, 90);
|
|
109
|
-
* print(vmath.euler_to_quat(v)); // => vmath.quat(0, 0, 0.70710676908493, 0.70710676908493)
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
function euler_to_quat(x: number | Vector3, y: number, z: number): Quaternion;
|
|
113
94
|
/**
|
|
114
95
|
* The resulting matrix is the inverse of the supplied matrix.
|
|
115
96
|
* For ortho-normal matrices, e.g. regular object transformation,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Opaque } from "../../../src/core-types";
|
|
3
|
-
|
|
4
2
|
declare global {
|
|
5
3
|
/**
|
|
6
4
|
* Functions and constants to access the window, window event listeners
|
|
@@ -58,7 +56,7 @@ declare global {
|
|
|
58
56
|
*
|
|
59
57
|
* - `window.DIMMING_OFF`
|
|
60
58
|
*/
|
|
61
|
-
function get_dim_mode():
|
|
59
|
+
function get_dim_mode(): number & { readonly __brand: "window.DIMMING_UNKNOWN" } | number & { readonly __brand: "window.DIMMING_ON" } | number & { readonly __brand: "window.DIMMING_OFF" };
|
|
62
60
|
/**
|
|
63
61
|
* This returns the content scale of the current display.
|
|
64
62
|
*
|
|
@@ -113,7 +111,7 @@ declare global {
|
|
|
113
111
|
*
|
|
114
112
|
* - `window.DIMMING_OFF`
|
|
115
113
|
*/
|
|
116
|
-
function set_dim_mode(mode:
|
|
114
|
+
function set_dim_mode(mode: number & { readonly __brand: "window.DIMMING_ON" } | number & { readonly __brand: "window.DIMMING_OFF" }): void;
|
|
117
115
|
/**
|
|
118
116
|
* Sets a window event listener. Only one window event listener can be set at a time.
|
|
119
117
|
*
|
|
@@ -28,7 +28,8 @@ declare global {
|
|
|
28
28
|
* @returns inflated buffer
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
31
|
-
* const data =
|
|
31
|
+
* const data =
|
|
32
|
+
* "\x78\x5e\x0b\xc9\xc8\x2c\x56\x00\xa2\x44\x85\xe2\x92\xa2\xcc\xbc\x74\x85\xf2\xcc\x92\x0c\x85\xd2\xbc\xe4\xfc\xdc\x82\xa2\xd4\xe2\xe2\xd4\x14\x85\x94\xc4\x92\x44\x3d\x00\x2c\x43\x0e\xc9";
|
|
32
33
|
* const uncompressed_data = zlib.inflate(data);
|
|
33
34
|
* print(uncompressed_data); //> This is a string with uncompressed data.
|
|
34
35
|
* ```
|
|
@@ -142,7 +142,7 @@ declare global {
|
|
|
142
142
|
* if (values) print(`${values.length} values in 'somefloats'`);
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
|
-
function get_metadata(buf: Opaque<"buffer">, metadata_name: Hash | string): LuaMultiReturn<[number[] | undefined,
|
|
145
|
+
function get_metadata(buf: Opaque<"buffer">, metadata_name: Hash | string): LuaMultiReturn<[number[] | undefined, number & { readonly __brand: "buffer.VALUE_TYPE_FLOAT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT16" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT64" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT8" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT16" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT64" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT8" } | undefined]>;
|
|
146
146
|
/**
|
|
147
147
|
* Get a specified stream from a buffer.
|
|
148
148
|
*
|
|
@@ -169,7 +169,7 @@ declare global {
|
|
|
169
169
|
* buffer.set_metadata(buf, hash("somefloats"), [-2.5, 10.0, 32.2], buffer.VALUE_TYPE_FLOAT32);
|
|
170
170
|
* ```
|
|
171
171
|
*/
|
|
172
|
-
function set_metadata(buf: Opaque<"buffer">, metadata_name: Hash | string, values: number[], value_type:
|
|
172
|
+
function set_metadata(buf: Opaque<"buffer">, metadata_name: Hash | string, values: number[], value_type: number & { readonly __brand: "buffer.VALUE_TYPE_FLOAT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT16" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT64" } | number & { readonly __brand: "buffer.VALUE_TYPE_INT8" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT16" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT32" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT64" } | number & { readonly __brand: "buffer.VALUE_TYPE_UINT8" }): void;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Hash,
|
|
2
|
+
import type { Hash, Quaternion, Url, Vector3 } from "../../../src/core-types";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
/**
|
|
@@ -92,7 +92,7 @@ declare global {
|
|
|
92
92
|
*
|
|
93
93
|
* - `collectionfactory.STATUS_LOADED`
|
|
94
94
|
*/
|
|
95
|
-
function get_status(url?: string | Hash | Url):
|
|
95
|
+
function get_status(url?: string | Hash | Url): number & { readonly __brand: "collectionfactory.STATUS_UNLOADED" } | number & { readonly __brand: "collectionfactory.STATUS_LOADING" } | number & { readonly __brand: "collectionfactory.STATUS_LOADED" };
|
|
96
96
|
/**
|
|
97
97
|
* Resources loaded are referenced by the collection factory component until the existing (parent) collection is destroyed or collectionfactory.unload is called.
|
|
98
98
|
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Hash,
|
|
2
|
+
import type { Hash, Quaternion, Url, Vector3 } from "../../../src/core-types";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
/**
|
|
@@ -39,20 +39,21 @@ declare global {
|
|
|
39
39
|
* export default defineScript({
|
|
40
40
|
* init(self) {
|
|
41
41
|
* // create a new game object and provide property values
|
|
42
|
-
*
|
|
42
|
+
* const created = factory.create("#factory", undefined, undefined, { my_value: 1 });
|
|
43
43
|
* // communicate with the object
|
|
44
|
-
* msg.post(
|
|
44
|
+
* msg.post(created, "hello");
|
|
45
45
|
* },
|
|
46
46
|
* });
|
|
47
47
|
*
|
|
48
|
-
* // And then let the new game object have a script attached:
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* }
|
|
48
|
+
* // And then let the new game object have a script attached, in its own file:
|
|
49
|
+
* //
|
|
50
|
+
* // go.property("my_value", 0);
|
|
51
|
+
* //
|
|
52
|
+
* // export default defineScript({
|
|
53
|
+
* // init(self) {
|
|
54
|
+
* // // do something with self.my_value which is now one
|
|
55
|
+
* // },
|
|
56
|
+
* // });
|
|
56
57
|
* ```
|
|
57
58
|
*/
|
|
58
59
|
function create(url: string | Hash | Url, position?: Vector3, rotation?: Quaternion, properties?: Record<string | number, unknown>, scale?: number | Vector3): Hash;
|
|
@@ -70,7 +71,7 @@ declare global {
|
|
|
70
71
|
*
|
|
71
72
|
* - `factory.STATUS_LOADED`
|
|
72
73
|
*/
|
|
73
|
-
function get_status(url?: string | Hash | Url):
|
|
74
|
+
function get_status(url?: string | Hash | Url): number & { readonly __brand: "factory.STATUS_UNLOADED" } | number & { readonly __brand: "factory.STATUS_LOADING" } | number & { readonly __brand: "factory.STATUS_LOADED" };
|
|
74
75
|
/**
|
|
75
76
|
* Resources are referenced by the factory component until the existing (parent) collection is destroyed or factory.unload is called.
|
|
76
77
|
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
@@ -561,7 +561,7 @@ declare global {
|
|
|
561
561
|
* });
|
|
562
562
|
* ```
|
|
563
563
|
*/
|
|
564
|
-
function animate(node: Opaque<"node">, property: string |
|
|
564
|
+
function animate(node: Opaque<"node">, property: string | number & { readonly __brand: "gui.PROP_POSITION" } | number & { readonly __brand: "gui.PROP_ROTATION" } | number & { readonly __brand: "gui.PROP_EULER" } | number & { readonly __brand: "gui.PROP_SCALE" } | number & { readonly __brand: "gui.PROP_COLOR" } | number & { readonly __brand: "gui.PROP_OUTLINE" } | number & { readonly __brand: "gui.PROP_SHADOW" } | number & { readonly __brand: "gui.PROP_SIZE" } | number & { readonly __brand: "gui.PROP_FILL_ANGLE" } | number & { readonly __brand: "gui.PROP_INNER_RADIUS" } | number & { readonly __brand: "gui.PROP_LEADING" } | number & { readonly __brand: "gui.PROP_TRACKING" } | number & { readonly __brand: "gui.PROP_SLICE9" }, to: number | Vector3 | Vector4 | Quaternion, easing: number & { readonly __brand: "gui.EASING_INBACK" } | number & { readonly __brand: "gui.EASING_INBOUNCE" } | number & { readonly __brand: "gui.EASING_INCIRC" } | number & { readonly __brand: "gui.EASING_INCUBIC" } | number & { readonly __brand: "gui.EASING_INELASTIC" } | number & { readonly __brand: "gui.EASING_INEXPO" } | number & { readonly __brand: "gui.EASING_INOUTBACK" } | number & { readonly __brand: "gui.EASING_INOUTBOUNCE" } | number & { readonly __brand: "gui.EASING_INOUTCIRC" } | number & { readonly __brand: "gui.EASING_INOUTCUBIC" } | number & { readonly __brand: "gui.EASING_INOUTELASTIC" } | number & { readonly __brand: "gui.EASING_INOUTEXPO" } | number & { readonly __brand: "gui.EASING_INOUTQUAD" } | number & { readonly __brand: "gui.EASING_INOUTQUART" } | number & { readonly __brand: "gui.EASING_INOUTQUINT" } | number & { readonly __brand: "gui.EASING_INOUTSINE" } | number & { readonly __brand: "gui.EASING_INQUAD" } | number & { readonly __brand: "gui.EASING_INQUART" } | number & { readonly __brand: "gui.EASING_INQUINT" } | number & { readonly __brand: "gui.EASING_INSINE" } | number & { readonly __brand: "gui.EASING_LINEAR" } | number & { readonly __brand: "gui.EASING_OUTBACK" } | number & { readonly __brand: "gui.EASING_OUTBOUNCE" } | number & { readonly __brand: "gui.EASING_OUTCIRC" } | number & { readonly __brand: "gui.EASING_OUTCUBIC" } | number & { readonly __brand: "gui.EASING_OUTELASTIC" } | number & { readonly __brand: "gui.EASING_OUTEXPO" } | number & { readonly __brand: "gui.EASING_OUTINBACK" } | number & { readonly __brand: "gui.EASING_OUTINBOUNCE" } | number & { readonly __brand: "gui.EASING_OUTINCIRC" } | number & { readonly __brand: "gui.EASING_OUTINCUBIC" } | number & { readonly __brand: "gui.EASING_OUTINELASTIC" } | number & { readonly __brand: "gui.EASING_OUTINEXPO" } | number & { readonly __brand: "gui.EASING_OUTINQUAD" } | number & { readonly __brand: "gui.EASING_OUTINQUART" } | number & { readonly __brand: "gui.EASING_OUTINQUINT" } | number & { readonly __brand: "gui.EASING_OUTINSINE" } | number & { readonly __brand: "gui.EASING_OUTQUAD" } | number & { readonly __brand: "gui.EASING_OUTQUART" } | number & { readonly __brand: "gui.EASING_OUTQUINT" } | number & { readonly __brand: "gui.EASING_OUTSINE" } | Vector, duration: number, delay?: number, complete_function?: (self: unknown, node: unknown) => void, playback?: number & { readonly __brand: "gui.PLAYBACK_ONCE_FORWARD" } | number & { readonly __brand: "gui.PLAYBACK_ONCE_BACKWARD" } | number & { readonly __brand: "gui.PLAYBACK_ONCE_PINGPONG" } | number & { readonly __brand: "gui.PLAYBACK_LOOP_FORWARD" } | number & { readonly __brand: "gui.PLAYBACK_LOOP_BACKWARD" } | number & { readonly __brand: "gui.PLAYBACK_LOOP_PINGPONG" }): void;
|
|
565
565
|
/**
|
|
566
566
|
* If one or more animations of the specified node is currently running (started by `gui.animate`), they will immediately be canceled.
|
|
567
567
|
*
|
|
@@ -614,7 +614,7 @@ declare global {
|
|
|
614
614
|
* gui.cancel_animations(node);
|
|
615
615
|
* ```
|
|
616
616
|
*/
|
|
617
|
-
function cancel_animations(node: Opaque<"node">, property?: string |
|
|
617
|
+
function cancel_animations(node: Opaque<"node">, property?: string | number & { readonly __brand: "gui.PROP_POSITION" } | number & { readonly __brand: "gui.PROP_ROTATION" } | number & { readonly __brand: "gui.PROP_EULER" } | number & { readonly __brand: "gui.PROP_SCALE" } | number & { readonly __brand: "gui.PROP_COLOR" } | number & { readonly __brand: "gui.PROP_OUTLINE" } | number & { readonly __brand: "gui.PROP_SHADOW" } | number & { readonly __brand: "gui.PROP_SIZE" } | number & { readonly __brand: "gui.PROP_FILL_ANGLE" } | number & { readonly __brand: "gui.PROP_INNER_RADIUS" } | number & { readonly __brand: "gui.PROP_LEADING" } | number & { readonly __brand: "gui.PROP_TRACKING" } | number & { readonly __brand: "gui.PROP_SLICE9" }): void;
|
|
618
618
|
/**
|
|
619
619
|
* Cancels any running flipbook animation on the specified node.
|
|
620
620
|
*
|
|
@@ -744,7 +744,7 @@ declare global {
|
|
|
744
744
|
* const node_position = gui.get(node, "position");
|
|
745
745
|
* ```
|
|
746
746
|
*/
|
|
747
|
-
function get(node: Opaque<"node">, property: string | Hash |
|
|
747
|
+
function get(node: Opaque<"node">, property: string | Hash | number & { readonly __brand: "gui.PROP_POSITION" } | number & { readonly __brand: "gui.PROP_ROTATION" } | number & { readonly __brand: "gui.PROP_EULER" } | number & { readonly __brand: "gui.PROP_SCALE" } | number & { readonly __brand: "gui.PROP_COLOR" } | number & { readonly __brand: "gui.PROP_OUTLINE" } | number & { readonly __brand: "gui.PROP_SHADOW" } | number & { readonly __brand: "gui.PROP_SIZE" } | number & { readonly __brand: "gui.PROP_FILL_ANGLE" } | number & { readonly __brand: "gui.PROP_INNER_RADIUS" } | number & { readonly __brand: "gui.PROP_LEADING" } | number & { readonly __brand: "gui.PROP_TRACKING" } | number & { readonly __brand: "gui.PROP_SLICE9" }, options?: { index?: number }): unknown;
|
|
748
748
|
/**
|
|
749
749
|
* Returns the adjust mode of a node.
|
|
750
750
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -759,7 +759,7 @@ declare global {
|
|
|
759
759
|
*
|
|
760
760
|
* - `gui.ADJUST_STRETCH`
|
|
761
761
|
*/
|
|
762
|
-
function get_adjust_mode(node: Opaque<"node">):
|
|
762
|
+
function get_adjust_mode(node: Opaque<"node">): number & { readonly __brand: "gui.ADJUST_FIT" } | number & { readonly __brand: "gui.ADJUST_ZOOM" } | number & { readonly __brand: "gui.ADJUST_STRETCH" };
|
|
763
763
|
/**
|
|
764
764
|
* gets the node alpha
|
|
765
765
|
*
|
|
@@ -784,7 +784,7 @@ declare global {
|
|
|
784
784
|
*
|
|
785
785
|
* - `gui.BLEND_SCREEN`
|
|
786
786
|
*/
|
|
787
|
-
function get_blend_mode(node: Opaque<"node">):
|
|
787
|
+
function get_blend_mode(node: Opaque<"node">): number & { readonly __brand: "gui.BLEND_ALPHA" } | number & { readonly __brand: "gui.BLEND_ADD" } | number & { readonly __brand: "gui.BLEND_ADD_ALPHA" } | number & { readonly __brand: "gui.BLEND_MULT" } | number & { readonly __brand: "gui.BLEND_SCREEN" };
|
|
788
788
|
/**
|
|
789
789
|
* If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
|
|
790
790
|
*
|
|
@@ -802,7 +802,7 @@ declare global {
|
|
|
802
802
|
*
|
|
803
803
|
* - `gui.CLIPPING_MODE_STENCIL`
|
|
804
804
|
*/
|
|
805
|
-
function get_clipping_mode(node: Opaque<"node">):
|
|
805
|
+
function get_clipping_mode(node: Opaque<"node">): number & { readonly __brand: "gui.CLIPPING_MODE_NONE" } | number & { readonly __brand: "gui.CLIPPING_MODE_STENCIL" };
|
|
806
806
|
/**
|
|
807
807
|
* If node is set as visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
|
|
808
808
|
*
|
|
@@ -1028,7 +1028,7 @@ declare global {
|
|
|
1028
1028
|
*
|
|
1029
1029
|
* - `gui.PIEBOUNDS_ELLIPSE`
|
|
1030
1030
|
*/
|
|
1031
|
-
function get_outer_bounds(node: Opaque<"node">):
|
|
1031
|
+
function get_outer_bounds(node: Opaque<"node">): number & { readonly __brand: "gui.PIEBOUNDS_RECTANGLE" } | number & { readonly __brand: "gui.PIEBOUNDS_ELLIPSE" };
|
|
1032
1032
|
/**
|
|
1033
1033
|
* Returns the outline color of the supplied node.
|
|
1034
1034
|
* See gui.get_color for info how vectors encode color values.
|
|
@@ -1084,7 +1084,7 @@ declare global {
|
|
|
1084
1084
|
*
|
|
1085
1085
|
* - `gui.PIVOT_NW`
|
|
1086
1086
|
*/
|
|
1087
|
-
function get_pivot(node: Opaque<"node">):
|
|
1087
|
+
function get_pivot(node: Opaque<"node">): number & { readonly __brand: "gui.PIVOT_CENTER" } | number & { readonly __brand: "gui.PIVOT_N" } | number & { readonly __brand: "gui.PIVOT_NE" } | number & { readonly __brand: "gui.PIVOT_E" } | number & { readonly __brand: "gui.PIVOT_SE" } | number & { readonly __brand: "gui.PIVOT_S" } | number & { readonly __brand: "gui.PIVOT_SW" } | number & { readonly __brand: "gui.PIVOT_W" } | number & { readonly __brand: "gui.PIVOT_NW" };
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Returns the position of the supplied node.
|
|
1090
1090
|
*
|
|
@@ -1146,7 +1146,7 @@ declare global {
|
|
|
1146
1146
|
*
|
|
1147
1147
|
* - `gui.SIZE_MODE_AUTO`
|
|
1148
1148
|
*/
|
|
1149
|
-
function get_size_mode(node: Opaque<"node">):
|
|
1149
|
+
function get_size_mode(node: Opaque<"node">): number & { readonly __brand: "gui.SIZE_MODE_MANUAL" } | number & { readonly __brand: "gui.SIZE_MODE_AUTO" };
|
|
1150
1150
|
/**
|
|
1151
1151
|
* Returns the slice9 configuration values for the node.
|
|
1152
1152
|
*
|
|
@@ -1189,7 +1189,7 @@ declare global {
|
|
|
1189
1189
|
*
|
|
1190
1190
|
* @param node - node from which to get the type
|
|
1191
1191
|
*/
|
|
1192
|
-
function get_type(node: Opaque<"node">): LuaMultiReturn<[
|
|
1192
|
+
function get_type(node: Opaque<"node">): LuaMultiReturn<[number & { readonly __brand: "gui.TYPE_BOX" } | number & { readonly __brand: "gui.TYPE_TEXT" } | number & { readonly __brand: "gui.TYPE_PIE" } | number & { readonly __brand: "gui.TYPE_PARTICLEFX" } | number & { readonly __brand: "gui.TYPE_CUSTOM" }, number | undefined]>;
|
|
1193
1193
|
/**
|
|
1194
1194
|
* Returns `true` if a node is visible and `false` if it's not.
|
|
1195
1195
|
* Invisible nodes are not rendered.
|
|
@@ -1216,7 +1216,7 @@ declare global {
|
|
|
1216
1216
|
*
|
|
1217
1217
|
* - `gui.ANCHOR_RIGHT`
|
|
1218
1218
|
*/
|
|
1219
|
-
function get_xanchor(node: Opaque<"node">):
|
|
1219
|
+
function get_xanchor(node: Opaque<"node">): number & { readonly __brand: "gui.ANCHOR_NONE" } | number & { readonly __brand: "gui.ANCHOR_LEFT" } | number & { readonly __brand: "gui.ANCHOR_RIGHT" };
|
|
1220
1220
|
/**
|
|
1221
1221
|
* The y-anchor specifies how the node is moved when the game is run in a different resolution.
|
|
1222
1222
|
*
|
|
@@ -1229,7 +1229,7 @@ declare global {
|
|
|
1229
1229
|
*
|
|
1230
1230
|
* - `gui.ANCHOR_BOTTOM`
|
|
1231
1231
|
*/
|
|
1232
|
-
function get_yanchor(node: Opaque<"node">):
|
|
1232
|
+
function get_yanchor(node: Opaque<"node">): number & { readonly __brand: "gui.ANCHOR_NONE" } | number & { readonly __brand: "gui.ANCHOR_TOP" } | number & { readonly __brand: "gui.ANCHOR_BOTTOM" };
|
|
1233
1233
|
/**
|
|
1234
1234
|
* Hides the on-display touch keyboard on the device.
|
|
1235
1235
|
*/
|
|
@@ -1769,7 +1769,7 @@ declare global {
|
|
|
1769
1769
|
* });
|
|
1770
1770
|
* ```
|
|
1771
1771
|
*/
|
|
1772
|
-
function set(node: Opaque<"node"> | Url, property: string | Hash |
|
|
1772
|
+
function set(node: Opaque<"node"> | Url, property: string | Hash | number & { readonly __brand: "gui.PROP_POSITION" } | number & { readonly __brand: "gui.PROP_ROTATION" } | number & { readonly __brand: "gui.PROP_EULER" } | number & { readonly __brand: "gui.PROP_SCALE" } | number & { readonly __brand: "gui.PROP_COLOR" } | number & { readonly __brand: "gui.PROP_OUTLINE" } | number & { readonly __brand: "gui.PROP_SHADOW" } | number & { readonly __brand: "gui.PROP_SIZE" } | number & { readonly __brand: "gui.PROP_FILL_ANGLE" } | number & { readonly __brand: "gui.PROP_INNER_RADIUS" } | number & { readonly __brand: "gui.PROP_LEADING" } | number & { readonly __brand: "gui.PROP_TRACKING" } | number & { readonly __brand: "gui.PROP_SLICE9" }, value: number | Vector4 | Vector3 | Quaternion, options?: { index?: number; key?: Hash }): void;
|
|
1773
1773
|
/**
|
|
1774
1774
|
* Sets the adjust mode on a node.
|
|
1775
1775
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -1784,7 +1784,7 @@ declare global {
|
|
|
1784
1784
|
*
|
|
1785
1785
|
* - `gui.ADJUST_STRETCH`
|
|
1786
1786
|
*/
|
|
1787
|
-
function set_adjust_mode(node: Opaque<"node">, adjust_mode:
|
|
1787
|
+
function set_adjust_mode(node: Opaque<"node">, adjust_mode: number & { readonly __brand: "gui.ADJUST_FIT" } | number & { readonly __brand: "gui.ADJUST_ZOOM" } | number & { readonly __brand: "gui.ADJUST_STRETCH" }): void;
|
|
1788
1788
|
/**
|
|
1789
1789
|
* sets the node alpha
|
|
1790
1790
|
*
|
|
@@ -1809,7 +1809,7 @@ declare global {
|
|
|
1809
1809
|
*
|
|
1810
1810
|
* - `gui.BLEND_SCREEN`
|
|
1811
1811
|
*/
|
|
1812
|
-
function set_blend_mode(node: Opaque<"node">, blend_mode:
|
|
1812
|
+
function set_blend_mode(node: Opaque<"node">, blend_mode: number & { readonly __brand: "gui.BLEND_ALPHA" } | number & { readonly __brand: "gui.BLEND_ADD" } | number & { readonly __brand: "gui.BLEND_ADD_ALPHA" } | number & { readonly __brand: "gui.BLEND_MULT" } | number & { readonly __brand: "gui.BLEND_SCREEN" }): void;
|
|
1813
1813
|
/**
|
|
1814
1814
|
* If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
|
|
1815
1815
|
*
|
|
@@ -1827,7 +1827,7 @@ declare global {
|
|
|
1827
1827
|
*
|
|
1828
1828
|
* - `gui.CLIPPING_MODE_STENCIL`
|
|
1829
1829
|
*/
|
|
1830
|
-
function set_clipping_mode(node: Opaque<"node">, clipping_mode:
|
|
1830
|
+
function set_clipping_mode(node: Opaque<"node">, clipping_mode: number & { readonly __brand: "gui.CLIPPING_MODE_NONE" } | number & { readonly __brand: "gui.CLIPPING_MODE_STENCIL" }): void;
|
|
1831
1831
|
/**
|
|
1832
1832
|
* If node is set as an visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
|
|
1833
1833
|
*
|
|
@@ -1995,7 +1995,7 @@ declare global {
|
|
|
1995
1995
|
*
|
|
1996
1996
|
* - `gui.PIEBOUNDS_ELLIPSE`
|
|
1997
1997
|
*/
|
|
1998
|
-
function set_outer_bounds(node: Opaque<"node">, bounds_mode:
|
|
1998
|
+
function set_outer_bounds(node: Opaque<"node">, bounds_mode: number & { readonly __brand: "gui.PIEBOUNDS_RECTANGLE" } | number & { readonly __brand: "gui.PIEBOUNDS_ELLIPSE" }): void;
|
|
1999
1999
|
/**
|
|
2000
2000
|
* Sets the outline color of the supplied node.
|
|
2001
2001
|
* See gui.set_color for info how vectors encode color values.
|
|
@@ -2050,7 +2050,7 @@ declare global {
|
|
|
2050
2050
|
*
|
|
2051
2051
|
* - `gui.PIVOT_NW`
|
|
2052
2052
|
*/
|
|
2053
|
-
function set_pivot(node: Opaque<"node">, pivot:
|
|
2053
|
+
function set_pivot(node: Opaque<"node">, pivot: number & { readonly __brand: "gui.PIVOT_CENTER" } | number & { readonly __brand: "gui.PIVOT_N" } | number & { readonly __brand: "gui.PIVOT_NE" } | number & { readonly __brand: "gui.PIVOT_E" } | number & { readonly __brand: "gui.PIVOT_SE" } | number & { readonly __brand: "gui.PIVOT_S" } | number & { readonly __brand: "gui.PIVOT_SW" } | number & { readonly __brand: "gui.PIVOT_W" } | number & { readonly __brand: "gui.PIVOT_NW" }): void;
|
|
2054
2054
|
/**
|
|
2055
2055
|
* Sets the position of the supplied node.
|
|
2056
2056
|
*
|
|
@@ -2089,7 +2089,7 @@ declare global {
|
|
|
2089
2089
|
*
|
|
2090
2090
|
* - `gui.SAFE_AREA_BOTH`
|
|
2091
2091
|
*/
|
|
2092
|
-
function set_safe_area_mode(mode:
|
|
2092
|
+
function set_safe_area_mode(mode: number & { readonly __brand: "gui.SAFE_AREA_NONE" } | number & { readonly __brand: "gui.SAFE_AREA_LONG" } | number & { readonly __brand: "gui.SAFE_AREA_SHORT" } | number & { readonly __brand: "gui.SAFE_AREA_BOTH" }): void;
|
|
2093
2093
|
/**
|
|
2094
2094
|
* Sets the scaling of the supplied node.
|
|
2095
2095
|
*
|
|
@@ -2135,7 +2135,7 @@ declare global {
|
|
|
2135
2135
|
*
|
|
2136
2136
|
* - `gui.SIZE_MODE_AUTO`
|
|
2137
2137
|
*/
|
|
2138
|
-
function set_size_mode(node: Opaque<"node">, size_mode:
|
|
2138
|
+
function set_size_mode(node: Opaque<"node">, size_mode: number & { readonly __brand: "gui.SIZE_MODE_MANUAL" } | number & { readonly __brand: "gui.SIZE_MODE_AUTO" }): void;
|
|
2139
2139
|
/**
|
|
2140
2140
|
* Set the slice9 configuration values for the node.
|
|
2141
2141
|
*
|
|
@@ -2255,7 +2255,7 @@ declare global {
|
|
|
2255
2255
|
*
|
|
2256
2256
|
* - `gui.ANCHOR_RIGHT`
|
|
2257
2257
|
*/
|
|
2258
|
-
function set_xanchor(node: Opaque<"node">, anchor:
|
|
2258
|
+
function set_xanchor(node: Opaque<"node">, anchor: number & { readonly __brand: "gui.ANCHOR_NONE" } | number & { readonly __brand: "gui.ANCHOR_LEFT" } | number & { readonly __brand: "gui.ANCHOR_RIGHT" }): void;
|
|
2259
2259
|
/**
|
|
2260
2260
|
* The y-anchor specifies how the node is moved when the game is run in a different resolution.
|
|
2261
2261
|
*
|
|
@@ -2268,7 +2268,7 @@ declare global {
|
|
|
2268
2268
|
*
|
|
2269
2269
|
* - `gui.ANCHOR_BOTTOM`
|
|
2270
2270
|
*/
|
|
2271
|
-
function set_yanchor(node: Opaque<"node">, anchor:
|
|
2271
|
+
function set_yanchor(node: Opaque<"node">, anchor: number & { readonly __brand: "gui.ANCHOR_NONE" } | number & { readonly __brand: "gui.ANCHOR_TOP" } | number & { readonly __brand: "gui.ANCHOR_BOTTOM" }): void;
|
|
2272
2272
|
/**
|
|
2273
2273
|
* Shows the on-display touch keyboard.
|
|
2274
2274
|
* The specified type of keyboard is displayed if it is available on
|
|
@@ -2286,7 +2286,7 @@ declare global {
|
|
|
2286
2286
|
* - `gui.KEYBOARD_TYPE_PASSWORD`
|
|
2287
2287
|
* @param autoclose - if the keyboard should automatically close when clicking outside
|
|
2288
2288
|
*/
|
|
2289
|
-
function show_keyboard(type:
|
|
2289
|
+
function show_keyboard(type: number & { readonly __brand: "gui.KEYBOARD_TYPE_DEFAULT" } | number & { readonly __brand: "gui.KEYBOARD_TYPE_EMAIL" } | number & { readonly __brand: "gui.KEYBOARD_TYPE_NUMBER_PAD" } | number & { readonly __brand: "gui.KEYBOARD_TYPE_PASSWORD" }, autoclose: boolean): void;
|
|
2290
2290
|
/**
|
|
2291
2291
|
* Stops the particle fx for a gui node
|
|
2292
2292
|
*
|
|
@@ -20,8 +20,6 @@ import "./graphics";
|
|
|
20
20
|
import "./gui";
|
|
21
21
|
import "./html5";
|
|
22
22
|
import "./http";
|
|
23
|
-
import "./iac";
|
|
24
|
-
import "./iap";
|
|
25
23
|
import "./image";
|
|
26
24
|
import "./json";
|
|
27
25
|
import "./label";
|
|
@@ -32,7 +30,6 @@ import "./msg";
|
|
|
32
30
|
import "./particlefx";
|
|
33
31
|
import "./physics";
|
|
34
32
|
import "./profiler";
|
|
35
|
-
import "./push";
|
|
36
33
|
import "./render";
|
|
37
34
|
import "./resource";
|
|
38
35
|
import "./socket";
|
|
@@ -43,8 +40,16 @@ import "./tilemap";
|
|
|
43
40
|
import "./timer";
|
|
44
41
|
import "./types";
|
|
45
42
|
import "./vmath";
|
|
46
|
-
import "./webview";
|
|
47
43
|
import "./window";
|
|
48
44
|
import "./zlib";
|
|
45
|
+
import "../../../src/custom-messages";
|
|
46
|
+
import "../../../src/engine-globals";
|
|
47
|
+
import "../../../src/msg-overloads";
|
|
48
|
+
import "../../../src/message-guard";
|
|
49
|
+
import "../../../src/window-event-guard";
|
|
50
|
+
import "../../../src/scene-addresses";
|
|
51
|
+
import "../../../src/go-overloads";
|
|
52
|
+
import "../../../src/render-overloads";
|
|
53
|
+
import "../../../src/vmath-overloads";
|
|
49
54
|
|
|
50
55
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Hash,
|
|
2
|
+
import type { Hash, Url, Vector3 } from "../../../src/core-types";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
/**
|
|
@@ -173,7 +173,7 @@ declare global {
|
|
|
173
173
|
* });
|
|
174
174
|
* ```
|
|
175
175
|
*/
|
|
176
|
-
function play_anim(url: string | Hash | Url, anim_id: string | Hash, playback:
|
|
176
|
+
function play_anim(url: string | Hash | Url, anim_id: string | Hash, playback: number & { readonly __brand: "go.PLAYBACK_ONCE_FORWARD" } | number & { readonly __brand: "go.PLAYBACK_ONCE_BACKWARD" } | number & { readonly __brand: "go.PLAYBACK_ONCE_PINGPONG" } | number & { readonly __brand: "go.PLAYBACK_LOOP_FORWARD" } | number & { readonly __brand: "go.PLAYBACK_LOOP_BACKWARD" } | number & { readonly __brand: "go.PLAYBACK_LOOP_PINGPONG" }, play_properties?: { blend_duration?: number; offset?: number; playback_rate?: number }, complete_function?: (self: unknown, message_id: unknown, message: unknown, sender: unknown) => void): void;
|
|
177
177
|
/**
|
|
178
178
|
* Resets a shader constant for a model component.
|
|
179
179
|
* The constant must be defined in the material assigned to the model.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Opaque } from "../../../src/core-types";
|
|
3
|
-
|
|
4
2
|
declare global {
|
|
5
3
|
/**
|
|
6
4
|
* Functions for getting profiling data in runtime.
|
|
@@ -175,7 +173,7 @@ declare global {
|
|
|
175
173
|
* }
|
|
176
174
|
* ```
|
|
177
175
|
*/
|
|
178
|
-
function set_ui_mode(mode:
|
|
176
|
+
function set_ui_mode(mode: number & { readonly __brand: "profiler.MODE_RUN" } | number & { readonly __brand: "profiler.MODE_PAUSE" } | number & { readonly __brand: "profiler.MODE_SHOW_PEAK_FRAME" } | number & { readonly __brand: "profiler.MODE_RECORD" }): void;
|
|
179
177
|
/**
|
|
180
178
|
* Set the on-screen profile view mode - minimized or expanded
|
|
181
179
|
*
|
|
@@ -190,7 +188,7 @@ declare global {
|
|
|
190
188
|
* profiler.set_ui_view_mode(profiler.VIEW_MODE_MINIMIZED);
|
|
191
189
|
* ```
|
|
192
190
|
*/
|
|
193
|
-
function set_ui_view_mode(mode:
|
|
191
|
+
function set_ui_view_mode(mode: number & { readonly __brand: "profiler.VIEW_MODE_FULL" } | number & { readonly __brand: "profiler.VIEW_MODE_MINIMIZED" }): void;
|
|
194
192
|
/**
|
|
195
193
|
* Shows or hides the time the engine waits for vsync in the on-screen profiler
|
|
196
194
|
* Each frame the engine waits for vsync and depending on your vsync settings and how much time
|