@defold-typescript/types 0.48.0 → 0.50.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 +696 -624
- package/api-signatures.json +6799 -160
- package/api-targets.json +393 -2
- package/examples/translations.json +12 -0
- package/generated/b2d.d.ts +15 -0
- package/generated/bullet3d.d.ts +16 -0
- package/generated/font.d.ts +7 -3
- package/generated/graphics.d.ts +7 -0
- package/generated/gui.d.ts +5 -4
- package/generated/label.d.ts +3 -3
- package/generated/render.d.ts +16 -1
- package/generated/versions/defold-1.13.2/b2d.d.ts +709 -0
- package/generated/versions/defold-1.13.2/b2d_body.d.ts +593 -0
- package/generated/versions/defold-1.13.2/b2d_chain.d.ts +105 -0
- package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +175 -0
- package/generated/versions/defold-1.13.2/b2d_joint.d.ts +1301 -0
- package/generated/versions/defold-1.13.2/b2d_shape.d.ts +423 -0
- package/generated/versions/defold-1.13.2/b2d_world.d.ts +308 -0
- package/generated/versions/defold-1.13.2/buffer.d.ts +192 -0
- package/generated/versions/defold-1.13.2/bullet3d.d.ts +91 -0
- package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +433 -0
- package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +818 -0
- package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +429 -0
- package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +123 -0
- package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +492 -0
- package/generated/versions/defold-1.13.2/camera.d.ts +300 -0
- package/generated/versions/defold-1.13.2/collectionfactory.d.ts +148 -0
- package/generated/versions/defold-1.13.2/collectionproxy.d.ts +109 -0
- package/generated/versions/defold-1.13.2/compute.d.ts +107 -0
- package/generated/versions/defold-1.13.2/crash.d.ts +157 -0
- package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +139 -0
- package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +21 -0
- package/generated/versions/defold-1.13.2/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +126 -0
- package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +38 -0
- package/generated/versions/defold-1.13.2/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.2/editor.d.ts +2177 -0
- package/generated/versions/defold-1.13.2/factory.d.ts +121 -0
- package/generated/versions/defold-1.13.2/font.d.ts +123 -0
- package/generated/versions/defold-1.13.2/go.d.ts +1166 -0
- package/generated/versions/defold-1.13.2/graphics.d.ts +613 -0
- package/generated/versions/defold-1.13.2/gui.d.ts +2212 -0
- package/generated/versions/defold-1.13.2/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.2/http.d.ts +83 -0
- package/generated/versions/defold-1.13.2/image.d.ts +181 -0
- package/generated/versions/defold-1.13.2/index.d.ts +63 -0
- package/generated/versions/defold-1.13.2/json.d.ts +94 -0
- package/generated/versions/defold-1.13.2/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.2/label.d.ts +164 -0
- package/generated/versions/defold-1.13.2/liveupdate.d.ts +143 -0
- package/generated/versions/defold-1.13.2/material.d.ts +490 -0
- package/generated/versions/defold-1.13.2/model.d.ts +287 -0
- package/generated/versions/defold-1.13.2/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.2/particlefx.d.ts +155 -0
- package/generated/versions/defold-1.13.2/physics.d.ts +789 -0
- package/generated/versions/defold-1.13.2/profiler.d.ts +228 -0
- package/generated/versions/defold-1.13.2/render.d.ts +1153 -0
- package/generated/versions/defold-1.13.2/resource.d.ts +1628 -0
- package/generated/versions/defold-1.13.2/socket.d.ts +797 -0
- package/generated/versions/defold-1.13.2/sound.d.ts +323 -0
- package/generated/versions/defold-1.13.2/sprite.d.ts +179 -0
- package/generated/versions/defold-1.13.2/sys.d.ts +754 -0
- package/generated/versions/defold-1.13.2/tilemap.d.ts +206 -0
- package/generated/versions/defold-1.13.2/timer.d.ts +136 -0
- package/generated/versions/defold-1.13.2/types.d.ts +61 -0
- package/generated/versions/defold-1.13.2/vmath.d.ts +775 -0
- package/generated/versions/defold-1.13.2/window.d.ts +196 -0
- package/generated/versions/defold-1.13.2/zlib.d.ts +41 -0
- package/hsm/debug.d.ts +6 -3
- package/hsm/index.d.ts +309 -77
- package/identity-vocabulary.json +1 -0
- package/package.json +2 -2
- package/scripts/import-defold-release.ts +3 -31
- package/scripts/materialize-version.ts +13 -7
- package/scripts/regen.ts +63 -29
- package/scripts/sync-api-docs.ts +31 -2
- package/src/emit-dts.ts +25 -3
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Functions and constants to access the window, window event listeners
|
|
5
|
+
* and screen dimming.
|
|
6
|
+
*/
|
|
7
|
+
namespace window {
|
|
8
|
+
/**
|
|
9
|
+
* Width and height are present for window.WINDOW_EVENT_RESIZED and
|
|
10
|
+
* absent for other window events.
|
|
11
|
+
*/
|
|
12
|
+
interface event_data {
|
|
13
|
+
/**
|
|
14
|
+
* Window width after a resize.
|
|
15
|
+
*/
|
|
16
|
+
width?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Window height after a resize.
|
|
19
|
+
*/
|
|
20
|
+
height?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Window safe-area data
|
|
24
|
+
*/
|
|
25
|
+
interface safe_area {
|
|
26
|
+
/**
|
|
27
|
+
* Safe-area x-coordinate.
|
|
28
|
+
*/
|
|
29
|
+
x: number;
|
|
30
|
+
/**
|
|
31
|
+
* Safe-area y-coordinate.
|
|
32
|
+
*/
|
|
33
|
+
y: number;
|
|
34
|
+
/**
|
|
35
|
+
* Safe-area width.
|
|
36
|
+
*/
|
|
37
|
+
width: number;
|
|
38
|
+
/**
|
|
39
|
+
* Safe-area height.
|
|
40
|
+
*/
|
|
41
|
+
height: number;
|
|
42
|
+
/**
|
|
43
|
+
* Inset from the left window edge.
|
|
44
|
+
*/
|
|
45
|
+
inset_left: number;
|
|
46
|
+
/**
|
|
47
|
+
* Inset from the top window edge.
|
|
48
|
+
*/
|
|
49
|
+
inset_top: number;
|
|
50
|
+
/**
|
|
51
|
+
* Inset from the right window edge.
|
|
52
|
+
*/
|
|
53
|
+
inset_right: number;
|
|
54
|
+
/**
|
|
55
|
+
* Inset from the bottom window edge.
|
|
56
|
+
*/
|
|
57
|
+
inset_bottom: number;
|
|
58
|
+
}
|
|
59
|
+
type DimModeState = typeof window.DIMMING_UNKNOWN | typeof window.DIMMING_ON | typeof window.DIMMING_OFF;
|
|
60
|
+
type DimModeStateSettable = typeof window.DIMMING_ON | typeof window.DIMMING_OFF;
|
|
61
|
+
type DIMMING = typeof window.DIMMING_OFF | typeof window.DIMMING_ON | typeof window.DIMMING_UNKNOWN;
|
|
62
|
+
type WINDOW_EVENT = typeof window.WINDOW_EVENT_DEICONIFIED | typeof window.WINDOW_EVENT_FOCUS_GAINED | typeof window.WINDOW_EVENT_FOCUS_LOST | typeof window.WINDOW_EVENT_ICONIFIED | typeof window.WINDOW_EVENT_RESIZED;
|
|
63
|
+
/**
|
|
64
|
+
* dimming mode off Dimming mode is used to control whether or not a mobile device should dim the screen after a period without user interaction.
|
|
65
|
+
*/
|
|
66
|
+
const DIMMING_OFF: number & { readonly __brand: "window.DIMMING_OFF" };
|
|
67
|
+
/**
|
|
68
|
+
* dimming mode on Dimming mode is used to control whether or not a mobile device should dim the screen after a period without user interaction.
|
|
69
|
+
*/
|
|
70
|
+
const DIMMING_ON: number & { readonly __brand: "window.DIMMING_ON" };
|
|
71
|
+
/**
|
|
72
|
+
* dimming mode unknown Dimming mode is used to control whether or not a mobile device should dim the screen after a period without user interaction. This mode indicates that the dim mode can't be determined, or that the platform doesn't support dimming.
|
|
73
|
+
*/
|
|
74
|
+
const DIMMING_UNKNOWN: number & { readonly __brand: "window.DIMMING_UNKNOWN" };
|
|
75
|
+
/**
|
|
76
|
+
* deiconified window event This event is sent to a window event listener when the game window or app screen is restored after being iconified.
|
|
77
|
+
*/
|
|
78
|
+
const WINDOW_EVENT_DEICONIFIED: number & { readonly __brand: "window.WINDOW_EVENT_DEICONIFIED" };
|
|
79
|
+
/**
|
|
80
|
+
* focus gained window event This event is sent to a window event listener when the game window or app screen has gained focus. This event is also sent at game startup and the engine gives focus to the game.
|
|
81
|
+
*/
|
|
82
|
+
const WINDOW_EVENT_FOCUS_GAINED: number & { readonly __brand: "window.WINDOW_EVENT_FOCUS_GAINED" };
|
|
83
|
+
/**
|
|
84
|
+
* focus lost window event This event is sent to a window event listener when the game window or app screen has lost focus.
|
|
85
|
+
*/
|
|
86
|
+
const WINDOW_EVENT_FOCUS_LOST: number & { readonly __brand: "window.WINDOW_EVENT_FOCUS_LOST" };
|
|
87
|
+
/**
|
|
88
|
+
* Deprecated misspelling of `window.WINDOW_EVENT_ICONIFIED`, with the same value. The engine still registers it.
|
|
89
|
+
*/
|
|
90
|
+
const WINDOW_EVENT_ICONFIED: typeof window.WINDOW_EVENT_ICONIFIED;
|
|
91
|
+
/**
|
|
92
|
+
* iconify window event This event is sent to a window event listener when the game window or app screen is iconified (reduced to an application icon in a toolbar, application tray or similar).
|
|
93
|
+
*/
|
|
94
|
+
const WINDOW_EVENT_ICONIFIED: number & { readonly __brand: "window.WINDOW_EVENT_ICONIFIED" };
|
|
95
|
+
/**
|
|
96
|
+
* resized window event This event is sent to a window event listener when the game window or app screen is resized. The new size is passed along in the data field to the event listener.
|
|
97
|
+
*/
|
|
98
|
+
const WINDOW_EVENT_RESIZED: number & { readonly __brand: "window.WINDOW_EVENT_RESIZED" };
|
|
99
|
+
/**
|
|
100
|
+
* Returns the current dimming mode set on a mobile device.
|
|
101
|
+
* The dimming mode specifies whether or not a mobile device should dim the screen after a period without user interaction.
|
|
102
|
+
* On platforms that does not support dimming, `window.DIMMING_UNKNOWN` is always returned.
|
|
103
|
+
*
|
|
104
|
+
* @returns The mode for screen dimming
|
|
105
|
+
*/
|
|
106
|
+
function get_dim_mode(): window.DIMMING;
|
|
107
|
+
/**
|
|
108
|
+
* This returns the content scale of the current display.
|
|
109
|
+
*
|
|
110
|
+
* @returns The display scale
|
|
111
|
+
*/
|
|
112
|
+
function get_display_scale(): number;
|
|
113
|
+
/**
|
|
114
|
+
* This returns the current lock state of the mouse cursor
|
|
115
|
+
*
|
|
116
|
+
* @returns The lock state
|
|
117
|
+
*/
|
|
118
|
+
function get_mouse_lock(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* This returns the safe area rectangle (x, y, width, height) and the inset
|
|
121
|
+
* values relative to the window edges. On platforms without a safe area,
|
|
122
|
+
* this returns the full window size and zero insets.
|
|
123
|
+
*
|
|
124
|
+
* @returns safe area data
|
|
125
|
+
*/
|
|
126
|
+
function get_safe_area(): window.safe_area;
|
|
127
|
+
/**
|
|
128
|
+
* This returns the current window size (width and height).
|
|
129
|
+
*/
|
|
130
|
+
function get_size(): LuaMultiReturn<[number, number]>;
|
|
131
|
+
/**
|
|
132
|
+
* Sets the dimming mode on a mobile device.
|
|
133
|
+
* The dimming mode specifies whether or not a mobile device should dim the screen after a period without user interaction. The dimming mode will only affect the mobile device while the game is in focus on the device, but not when the game is running in the background.
|
|
134
|
+
* This function has no effect on platforms that does not support dimming.
|
|
135
|
+
*
|
|
136
|
+
* @param mode - The mode for screen dimming
|
|
137
|
+
*/
|
|
138
|
+
function set_dim_mode(mode: window.DimModeStateSettable): void;
|
|
139
|
+
/**
|
|
140
|
+
* Sets a window event listener. Only one window event listener can be set at a time.
|
|
141
|
+
*
|
|
142
|
+
* @param callback - A callback which receives info about window events. Pass an empty function or `nil` if you no longer wish to receive callbacks.
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* export default defineScript({
|
|
146
|
+
* init() {
|
|
147
|
+
* window.set_listener((self, event, data) => {
|
|
148
|
+
* if (event === window.WINDOW_EVENT_FOCUS_LOST) {
|
|
149
|
+
* print("window.WINDOW_EVENT_FOCUS_LOST");
|
|
150
|
+
* } else if (event === window.WINDOW_EVENT_FOCUS_GAINED) {
|
|
151
|
+
* print("window.WINDOW_EVENT_FOCUS_GAINED");
|
|
152
|
+
* } else if (event === window.WINDOW_EVENT_ICONIFIED) {
|
|
153
|
+
* print("window.WINDOW_EVENT_ICONIFIED");
|
|
154
|
+
* } else if (event === window.WINDOW_EVENT_DEICONIFIED) {
|
|
155
|
+
* print("window.WINDOW_EVENT_DEICONIFIED");
|
|
156
|
+
* } else if (event === window.WINDOW_EVENT_RESIZED) {
|
|
157
|
+
* print("Window resized: ", data.width, data.height);
|
|
158
|
+
* }
|
|
159
|
+
* });
|
|
160
|
+
* },
|
|
161
|
+
* });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
function set_listener(callback: ((self: unknown, event: (typeof window)[Extract<keyof typeof window, `WINDOW_EVENT_${string}`>], data: Record<string | number, unknown>) => void) | undefined): void;
|
|
165
|
+
/**
|
|
166
|
+
* Set the locking state for current mouse cursor on a PC platform.
|
|
167
|
+
* This function locks or unlocks the mouse cursor to the center point of the window. While the cursor is locked,
|
|
168
|
+
* mouse position updates will still be sent to the scripts as usual.
|
|
169
|
+
*
|
|
170
|
+
* @param flag - The lock state for the mouse cursor
|
|
171
|
+
*/
|
|
172
|
+
function set_mouse_lock(flag: boolean): void;
|
|
173
|
+
/**
|
|
174
|
+
* Sets the window position.
|
|
175
|
+
*
|
|
176
|
+
* @param x - Horizontal position of window
|
|
177
|
+
* @param y - Vertical position of window
|
|
178
|
+
*/
|
|
179
|
+
function set_position(x: number, y: number): void;
|
|
180
|
+
/**
|
|
181
|
+
* Sets the window size. Works on desktop platforms only.
|
|
182
|
+
*
|
|
183
|
+
* @param width - Width of window
|
|
184
|
+
* @param height - Height of window
|
|
185
|
+
*/
|
|
186
|
+
function set_size(width: number, height: number): void;
|
|
187
|
+
/**
|
|
188
|
+
* Sets the window title. Works on desktop platforms.
|
|
189
|
+
*
|
|
190
|
+
* @param title - The title, encoded as UTF-8
|
|
191
|
+
*/
|
|
192
|
+
function set_title(title: string): void;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Functions for compression and decompression of string buffers.
|
|
5
|
+
*/
|
|
6
|
+
namespace zlib {
|
|
7
|
+
/**
|
|
8
|
+
* A lua error is raised is on error
|
|
9
|
+
*
|
|
10
|
+
* @param buf - buffer to deflate
|
|
11
|
+
* @returns deflated buffer
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const data = "This is a string with uncompressed data.";
|
|
15
|
+
* const compressed_data = zlib.deflate(data);
|
|
16
|
+
* let s = "";
|
|
17
|
+
* for (const c of compressed_data) {
|
|
18
|
+
* s = s + "\\" + c.charCodeAt(0);
|
|
19
|
+
* }
|
|
20
|
+
* print(s); //> \120\94\11\201\200\44\86\0\162\68\133\226\146\162 ...
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function deflate(buf: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* A lua error is raised is on error
|
|
26
|
+
*
|
|
27
|
+
* @param buf - buffer to inflate
|
|
28
|
+
* @returns inflated buffer
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
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";
|
|
33
|
+
* const uncompressed_data = zlib.inflate(data);
|
|
34
|
+
* print(uncompressed_data); //> This is a string with uncompressed data.
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
function inflate(buf: string): string;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {};
|
package/hsm/debug.d.ts
CHANGED
|
@@ -14,8 +14,11 @@ export interface MachineInspector {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Prints one line when it is called, then one line for each move `instance` makes, each starting
|
|
17
|
-
* with `hsm` and the label.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* with `hsm` and the label. A move's line names the state whose rule made it and that rule's key.
|
|
18
|
+
* An event no active state takes prints an `unhandled` line with its `type` and the active
|
|
19
|
+
* leaves, once per type until the next move. Call it once after `start`. A label another
|
|
20
|
+
* `inspect` call already used gets an ordinal, such as `enemy#2`. In a release build it registers
|
|
21
|
+
* nothing and returns an inspector whose `draw` does nothing, so the calls can stay in shipped
|
|
22
|
+
* code.
|
|
20
23
|
*/
|
|
21
24
|
export declare function inspect<Ctx, E extends EventObject, P extends string>(instance: MachineInstance<Ctx, E, P>, label: string): MachineInspector;
|