@defold-typescript/types 0.5.4 → 0.6.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.
Files changed (59) hide show
  1. package/api-targets.json +1 -1
  2. package/generated/b2d.d.ts +3 -0
  3. package/generated/buffer.d.ts +44 -38
  4. package/generated/builtin-messages.d.ts +1 -1
  5. package/generated/camera.d.ts +3 -0
  6. package/generated/collectionfactory.d.ts +47 -40
  7. package/generated/collectionproxy.d.ts +23 -18
  8. package/generated/crash.d.ts +3 -0
  9. package/generated/factory.d.ts +32 -24
  10. package/generated/go.d.ts +293 -293
  11. package/generated/graphics.d.ts +3 -0
  12. package/generated/gui.d.ts +303 -283
  13. package/generated/http.d.ts +26 -16
  14. package/generated/iac.d.ts +3 -0
  15. package/generated/iap.d.ts +6 -3
  16. package/generated/image.d.ts +30 -26
  17. package/generated/json.d.ts +36 -32
  18. package/generated/kinds/gui-script.d.ts +7 -5
  19. package/generated/kinds/render-script.d.ts +7 -5
  20. package/generated/kinds/script.d.ts +7 -5
  21. package/generated/label.d.ts +16 -9
  22. package/generated/liveupdate.d.ts +29 -26
  23. package/generated/model.d.ts +57 -45
  24. package/generated/msg.d.ts +12 -9
  25. package/generated/particlefx.d.ts +50 -34
  26. package/generated/physics.d.ts +153 -133
  27. package/generated/profiler.d.ts +45 -41
  28. package/generated/push.d.ts +5 -2
  29. package/generated/render.d.ts +410 -349
  30. package/generated/resource.d.ts +619 -572
  31. package/generated/socket.d.ts +49 -33
  32. package/generated/sound.d.ts +83 -72
  33. package/generated/sprite.d.ts +36 -32
  34. package/generated/sys.d.ts +198 -189
  35. package/generated/tilemap.d.ts +43 -39
  36. package/generated/timer.d.ts +42 -36
  37. package/generated/vmath.d.ts +254 -229
  38. package/generated/webview.d.ts +3 -0
  39. package/generated/window.d.ts +23 -17
  40. package/generated/zlib.d.ts +15 -12
  41. package/index.d.ts +3 -1
  42. package/package.json +6 -2
  43. package/scripts/example-store-io.ts +18 -0
  44. package/scripts/fidelity-audit.ts +61 -1
  45. package/scripts/fidelity-baseline.json +10 -10
  46. package/scripts/ref-doc-delta.ts +143 -0
  47. package/scripts/regen.ts +23 -10
  48. package/src/core-types.ts +14 -0
  49. package/src/doc-comment.ts +2 -1
  50. package/src/emit-dts.ts +238 -18
  51. package/src/engine-globals.d.ts +2 -0
  52. package/src/example-store.ts +44 -0
  53. package/src/go-overloads.d.ts +73 -0
  54. package/src/index.ts +5 -0
  55. package/src/lifecycle.ts +157 -16
  56. package/src/message-dispatch.d.ts +21 -0
  57. package/src/message-guard.d.ts +19 -0
  58. package/src/msg-overloads.d.ts +20 -0
  59. package/src/publish-dts.ts +1 -1
@@ -2,6 +2,10 @@
2
2
  import type { Opaque } from "../src/core-types";
3
3
 
4
4
  declare global {
5
+ /**
6
+ * Functions for getting profiling data in runtime.
7
+ * More detailed [profiling](https://www.defold.com/manuals/profiling/) and [debugging](http://www.defold.com/manuals/debugging/) information available in the manuals.
8
+ */
5
9
  namespace profiler {
6
10
  /**
7
11
  * pause on current frame
@@ -31,8 +35,8 @@ declare global {
31
35
  * logs the current frame to the console
32
36
  *
33
37
  * @example
34
- * ```lua
35
- * profiler.dump_frame()
38
+ * ```ts
39
+ * profiler.dump_frame();
36
40
  * ```
37
41
  */
38
42
  function dump_frame(): void;
@@ -43,9 +47,9 @@ declare global {
43
47
  *
44
48
  * @param enabled - true to enable, false to disable
45
49
  * @example
46
- * ```lua
47
- * -- Show the profiler UI
48
- * profiler.enable(true)
50
+ * ```ts
51
+ * // Show the profiler UI
52
+ * profiler.enable(true);
49
53
  * ```
50
54
  */
51
55
  function enable(enabled: boolean): void;
@@ -57,9 +61,9 @@ declare global {
57
61
  *
58
62
  * @param enabled - true to enable, false to disable
59
63
  * @example
60
- * ```lua
61
- * -- Show the profiler UI
62
- * profiler.enable_ui(true)
64
+ * ```ts
65
+ * // Show the profiler UI
66
+ * profiler.enable_ui(true);
63
67
  * ```
64
68
  */
65
69
  function enable_ui(enabled: boolean): void;
@@ -92,12 +96,12 @@ declare global {
92
96
  *
93
97
  * @returns used by the application
94
98
  * @example
95
- * ```lua
96
- * Get memory usage before and after loading a collection:
97
- * print(profiler.get_memory_usage())
98
- * msg.post("#collectionproxy", "load")
99
- * ...
100
- * print(profiler.get_memory_usage()) -- will report a higher number than the initial call
99
+ * ```ts
100
+ * // Get memory usage before and after loading a collection:
101
+ * print(profiler.get_memory_usage());
102
+ * msg.post("#collectionproxy", "load");
103
+ * // ...
104
+ * print(profiler.get_memory_usage()); // will report a higher number than the initial call
101
105
  * ```
102
106
  */
103
107
  function get_memory_usage(): number;
@@ -106,8 +110,8 @@ declare global {
106
110
  *
107
111
  * @param text - the string to send to the connected profiler
108
112
  * @example
109
- * ```lua
110
- * profiler.log_text("Event: " .. name)
113
+ * ```ts
114
+ * profiler.log_text(`Event: ${name}`);
111
115
  * ```
112
116
  */
113
117
  function log_text(text: string): void;
@@ -116,10 +120,10 @@ declare global {
116
120
  *
117
121
  * @returns the number of recorded frames, zero if on-screen profiler is disabled
118
122
  * @example
119
- * ```lua
120
- * -- Show the last recorded frame
121
- * local recorded_frame_count = profiler.recorded_frame_count()
122
- * profiler.view_recorded_frame(recorded_frame_count)
123
+ * ```ts
124
+ * // Show the last recorded frame
125
+ * const recorded_frame_count = profiler.recorded_frame_count();
126
+ * profiler.view_recorded_frame(recorded_frame_count);
123
127
  * ```
124
128
  */
125
129
  function recorded_frame_count(): number;
@@ -128,11 +132,11 @@ declare global {
128
132
  *
129
133
  * @param name - The name of the scope
130
134
  * @example
131
- * ```lua
132
- * -- Go back one frame
133
- * profiler.scope_begin("test_function")
134
- * test_function()
135
- * profiler.scope_end()
135
+ * ```ts
136
+ * // Go back one frame
137
+ * profiler.scope_begin("test_function");
138
+ * test_function();
139
+ * profiler.scope_end();
136
140
  * ```
137
141
  */
138
142
  function scope_begin(name: string): void;
@@ -152,14 +156,14 @@ declare global {
152
156
  * You can also use the `view_recorded_frame` function to display a recorded frame. Doing so stops the recording as well.
153
157
  * Every time you switch to recording mode the recording buffer is cleared.
154
158
  * @example
155
- * ```lua
156
- * function start_recording()
157
- * profiler.set_ui_mode(profiler.MODE_RECORD)
158
- * end
159
+ * ```ts
160
+ * function start_recording() {
161
+ * profiler.set_ui_mode(profiler.MODE_RECORD);
162
+ * }
159
163
  *
160
- * function stop_recording()
161
- * profiler.set_ui_mode(profiler.MODE_PAUSE)
162
- * end
164
+ * function stop_recording() {
165
+ * profiler.set_ui_mode(profiler.MODE_PAUSE);
166
+ * }
163
167
  * ```
164
168
  */
165
169
  function set_ui_mode(mode: Opaque<"constant">): void;
@@ -170,9 +174,9 @@ declare global {
170
174
  * - `profiler.VIEW_MODE_FULL` The default mode which displays all the ui profiler details
171
175
  * - `profiler.VIEW_MODE_MINIMIZED` Minimized mode which only shows the top header (fps counters and ui profiler mode)
172
176
  * @example
173
- * ```lua
174
- * -- Minimize the profiler view
175
- * profiler.set_ui_view_mode(profiler.VIEW_MODE_MINIMIZED)
177
+ * ```ts
178
+ * // Minimize the profiler view
179
+ * profiler.set_ui_view_mode(profiler.VIEW_MODE_MINIMIZED);
176
180
  * ```
177
181
  */
178
182
  function set_ui_view_mode(mode: Opaque<"constant">): void;
@@ -190,9 +194,9 @@ declare global {
190
194
  *
191
195
  * @param visible - true to include it in the display, false to hide it.
192
196
  * @example
193
- * ```lua
194
- * -- Exclude frame wait time form the profiler ui
195
- * profiler.set_ui_vsync_wait_visible(false)
197
+ * ```ts
198
+ * // Exclude frame wait time from the profiler ui
199
+ * profiler.set_ui_vsync_wait_visible(false);
196
200
  * ```
197
201
  */
198
202
  function set_ui_vsync_wait_visible(visible: boolean): void;
@@ -204,9 +208,9 @@ declare global {
204
208
  * - `distance` The offset from the currently displayed frame (this is truncated between zero and the number of recorded frames)
205
209
  * - `frame` The frame index in the recording buffer (1 is first recorded frame)
206
210
  * @example
207
- * ```lua
208
- * -- Go back one frame
209
- * profiler.view_recorded_frame({distance = -1})
211
+ * ```ts
212
+ * // Go back one frame
213
+ * profiler.view_recorded_frame({ distance: -1 });
210
214
  * ```
211
215
  */
212
216
  function view_recorded_frame(frame_index: Record<string | number, unknown>): void;
@@ -1,5 +1,8 @@
1
1
  /** @noSelfInFile */
2
2
  declare global {
3
+ /**
4
+ * Functions and constants for interacting with local, as well as Apple''s and Google''s push notification services. These API's only exist on mobile platforms. [icon:ios] [icon:android]
5
+ */
3
6
  namespace push {
4
7
  /**
5
8
  * Use this function to cancel a previously scheduled local push notification.
@@ -33,7 +36,7 @@ declare global {
33
36
  * @param notifications - The types of notifications to listen to. [icon:ios]
34
37
  * @param callback - Register callback function.
35
38
  */
36
- function register(notifications: Record<string | number, unknown>, callback: (...args: unknown[]) => unknown): void;
39
+ function register(notifications: number[], callback: (...args: unknown[]) => unknown): void;
37
40
  /**
38
41
  * Local push notifications are scheduled with this function.
39
42
  * The returned `id` value is uniquely identifying the scheduled notification and can be stored for later reference.
@@ -44,7 +47,7 @@ declare global {
44
47
  * @param payload - JSON string to be passed to the registered listener function.
45
48
  * @param notification_settings - Table with notification and platform specific fields
46
49
  */
47
- function schedule(time: number, title: string, alert: string, payload: string, notification_settings: Record<string | number, unknown>): LuaMultiReturn<[number, string]>;
50
+ function schedule(time: number, title: string, alert: string, payload: string, notification_settings: { action?: string; badge_count?: number; priority?: number }): LuaMultiReturn<[number, string]>;
48
51
  /**
49
52
  * Set the badge count for application icon. This function is only available on iOS. [icon:ios]
50
53
  *