@defold-typescript/types 0.26.0 → 0.27.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 (70) hide show
  1. package/api-availability.json +307 -307
  2. package/api-signatures.json +1311 -0
  3. package/api-targets.json +342 -0
  4. package/examples/translations.json +1984 -0
  5. package/fixtures/messages_doc.json +880 -0
  6. package/generated/versions/defold-1.12.4/gui.d.ts +43 -43
  7. package/generated/versions/defold-1.12.4/liveupdate.d.ts +22 -22
  8. package/generated/versions/defold-1.12.4/physics.d.ts +78 -75
  9. package/generated/versions/defold-1.12.4/render.d.ts +75 -55
  10. package/generated/versions/defold-1.12.4/resource.d.ts +187 -175
  11. package/generated/versions/defold-1.13.0/b2d.d.ts +33 -0
  12. package/generated/versions/defold-1.13.0/b2d_body.d.ts +676 -0
  13. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +106 -0
  14. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +155 -0
  15. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +823 -0
  16. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +215 -0
  17. package/generated/versions/defold-1.13.0/b2d_world.d.ts +314 -0
  18. package/generated/versions/defold-1.13.0/buffer.d.ts +176 -0
  19. package/generated/versions/defold-1.13.0/camera.d.ts +302 -0
  20. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +146 -0
  21. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +71 -0
  22. package/generated/versions/defold-1.13.0/compute.d.ts +306 -0
  23. package/generated/versions/defold-1.13.0/crash.d.ts +143 -0
  24. package/generated/versions/defold-1.13.0/editor-vm/http.d.ts +56 -0
  25. package/generated/versions/defold-1.13.0/editor-vm/json.d.ts +10 -0
  26. package/generated/versions/defold-1.13.0/editor-vm/localization.d.ts +42 -0
  27. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +80 -0
  28. package/generated/versions/defold-1.13.0/editor-vm/zip.d.ts +10 -0
  29. package/generated/versions/defold-1.13.0/editor-vm/zlib.d.ts +24 -0
  30. package/generated/versions/defold-1.13.0/editor.d.ts +1092 -0
  31. package/generated/versions/defold-1.13.0/factory.d.ts +123 -0
  32. package/generated/versions/defold-1.13.0/font.d.ts +81 -0
  33. package/generated/versions/defold-1.13.0/go.d.ts +1054 -0
  34. package/generated/versions/defold-1.13.0/graphics.d.ts +321 -0
  35. package/generated/versions/defold-1.13.0/gui.d.ts +2370 -0
  36. package/generated/versions/defold-1.13.0/html5.d.ts +53 -0
  37. package/generated/versions/defold-1.13.0/http.d.ts +84 -0
  38. package/generated/versions/defold-1.13.0/iac.d.ts +18 -0
  39. package/generated/versions/defold-1.13.0/iap.d.ts +60 -0
  40. package/generated/versions/defold-1.13.0/image.d.ts +139 -0
  41. package/generated/versions/defold-1.13.0/index.d.ts +48 -0
  42. package/generated/versions/defold-1.13.0/json.d.ts +76 -0
  43. package/generated/versions/defold-1.13.0/kinds/editor-script.d.ts +13 -0
  44. package/generated/versions/defold-1.13.0/label.d.ts +94 -0
  45. package/generated/versions/defold-1.13.0/liveupdate.d.ts +140 -0
  46. package/generated/versions/defold-1.13.0/material.d.ts +444 -0
  47. package/generated/versions/defold-1.13.0/model.d.ts +246 -0
  48. package/generated/versions/defold-1.13.0/msg.d.ts +10 -0
  49. package/generated/versions/defold-1.13.0/particlefx.d.ts +166 -0
  50. package/generated/versions/defold-1.13.0/physics.d.ts +548 -0
  51. package/generated/versions/defold-1.13.0/profiler.d.ts +233 -0
  52. package/generated/versions/defold-1.13.0/push.d.ts +66 -0
  53. package/generated/versions/defold-1.13.0/render.d.ts +1185 -0
  54. package/generated/versions/defold-1.13.0/resource.d.ts +1530 -0
  55. package/generated/versions/defold-1.13.0/socket.d.ts +795 -0
  56. package/generated/versions/defold-1.13.0/sound.d.ts +291 -0
  57. package/generated/versions/defold-1.13.0/sprite.d.ts +157 -0
  58. package/generated/versions/defold-1.13.0/sys.d.ts +695 -0
  59. package/generated/versions/defold-1.13.0/tilemap.d.ts +195 -0
  60. package/generated/versions/defold-1.13.0/timer.d.ts +114 -0
  61. package/generated/versions/defold-1.13.0/types.d.ts +61 -0
  62. package/generated/versions/defold-1.13.0/vmath.d.ts +806 -0
  63. package/generated/versions/defold-1.13.0/webview.d.ts +68 -0
  64. package/generated/versions/defold-1.13.0/window.d.ts +198 -0
  65. package/generated/versions/defold-1.13.0/zlib.d.ts +40 -0
  66. package/index.d.ts +4 -84
  67. package/package.json +11 -3
  68. package/scripts/import-defold-release.ts +18 -1
  69. package/src/example-store.ts +5 -0
  70. package/scripts/lua-types-signature-index.ts +0 -151
@@ -0,0 +1,233 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque } from "../../../src/core-types";
3
+
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
+ */
9
+ namespace profiler {
10
+ /**
11
+ * pause on current frame
12
+ */
13
+ const MODE_PAUSE: number & { readonly __brand: "profiler.MODE_PAUSE" };
14
+ /**
15
+ * start recording
16
+ */
17
+ const MODE_RECORD: number & { readonly __brand: "profiler.MODE_RECORD" };
18
+ /**
19
+ * continously show latest frame
20
+ */
21
+ const MODE_RUN: number & { readonly __brand: "profiler.MODE_RUN" };
22
+ /**
23
+ * pause at peak frame
24
+ */
25
+ const MODE_SHOW_PEAK_FRAME: number & { readonly __brand: "profiler.MODE_SHOW_PEAK_FRAME" };
26
+ /**
27
+ * show full profiler ui
28
+ */
29
+ const VIEW_MODE_FULL: number & { readonly __brand: "profiler.VIEW_MODE_FULL" };
30
+ /**
31
+ * show mimimal profiler ui
32
+ */
33
+ const VIEW_MODE_MINIMIZED: number & { readonly __brand: "profiler.VIEW_MODE_MINIMIZED" };
34
+ /**
35
+ * logs the current frame to the console
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * profiler.dump_frame();
40
+ * ```
41
+ */
42
+ function dump_frame(): void;
43
+ /**
44
+ * The profiler is a real-time tool that shows the numbers of milliseconds spent
45
+ * in each scope per frame as well as counters. The profiler is very useful for
46
+ * tracking down performance and resource problems.
47
+ *
48
+ * @param enabled - true to enable, false to disable
49
+ * @example
50
+ * ```ts
51
+ * // Show the profiler UI
52
+ * profiler.enable(true);
53
+ * ```
54
+ */
55
+ function enable(enabled: boolean): void;
56
+ /**
57
+ * Creates and shows or hides and destroys the on-sceen profiler ui
58
+ * The profiler is a real-time tool that shows the numbers of milliseconds spent
59
+ * in each scope per frame as well as counters. The profiler is very useful for
60
+ * tracking down performance and resource problems.
61
+ *
62
+ * @param enabled - true to enable, false to disable
63
+ * @example
64
+ * ```ts
65
+ * // Show the profiler UI
66
+ * profiler.enable_ui(true);
67
+ * ```
68
+ */
69
+ function enable_ui(enabled: boolean): void;
70
+ /**
71
+ * Get the percent of CPU usage by the application, as reported by the OS.
72
+ * This function is not available on HTML5.
73
+ * For some platforms ( Android, Linux and Windows), this information is only available
74
+ * by default in the debug version of the engine. It can be enabled in release version as well
75
+ * by checking `track_cpu` under `profiler` in the `game.project` file.
76
+ * (This means that the engine will sample the CPU usage in intervalls during execution even in release mode.)
77
+ *
78
+ * @returns of CPU used by the application
79
+ */
80
+ function get_cpu_usage(): number;
81
+ /**
82
+ * Get the detailed amount of memory used by the application in bytes, as reported by the platform.
83
+ * The values are gathered from internal OS functions which correspond to the following;
84
+ *
85
+ * OS
86
+ * Value
87
+ *
88
+ * iOS
89
+ * MacOS
90
+ *
91
+ * Android
92
+ * Linux
93
+ * Resident memory
94
+ *
95
+ * Windows
96
+ * Working set
97
+ *
98
+ * HTML5
99
+ * Allocated bytes reported by `mallinfo().uordblks`
100
+ *
101
+ * @returns used by the application
102
+ * @example
103
+ * ```ts
104
+ * // Get memory usage before and after loading a collection:
105
+ * print(profiler.get_memory_usage());
106
+ * msg.post("#collectionproxy", "load");
107
+ * // ...
108
+ * print(profiler.get_memory_usage()); // will report a higher number than the initial call
109
+ * ```
110
+ */
111
+ function get_memory_usage(): number;
112
+ /**
113
+ * Send a text to the connected profiler
114
+ *
115
+ * @param text - the string to send to the connected profiler
116
+ * @example
117
+ * ```ts
118
+ * profiler.log_text(`Event: ${name}`);
119
+ * ```
120
+ */
121
+ function log_text(text: string): void;
122
+ /**
123
+ * Get the number of recorded frames in the on-screen profiler ui recording buffer
124
+ *
125
+ * @returns the number of recorded frames, zero if on-screen profiler is disabled
126
+ * @example
127
+ * ```ts
128
+ * // Show the last recorded frame
129
+ * const recorded_frame_count = profiler.recorded_frame_count();
130
+ * profiler.view_recorded_frame(recorded_frame_count);
131
+ * ```
132
+ */
133
+ function recorded_frame_count(): number;
134
+ /**
135
+ * Starts a profile scope.
136
+ *
137
+ * @param name - The name of the scope
138
+ * @example
139
+ * ```ts
140
+ * // Go back one frame
141
+ * profiler.scope_begin("test_function");
142
+ * test_function();
143
+ * profiler.scope_end();
144
+ * ```
145
+ */
146
+ function scope_begin(name: string): void;
147
+ /**
148
+ * End the current profile scope.
149
+ */
150
+ function scope_end(): void;
151
+ /**
152
+ * Set the on-screen profile mode - run, pause, record or show peak frame
153
+ *
154
+ * @param mode - the mode to set the ui profiler in
155
+ *
156
+ * - `profiler.MODE_RUN` This is default mode that continously shows the last frame
157
+ *
158
+ * - `profiler.MODE_PAUSE` Pauses on the currently displayed frame
159
+ *
160
+ * - `profiler.MODE_SHOW_PEAK_FRAME` Pauses on the currently displayed frame but shows a new frame if that frame is slower
161
+ *
162
+ * - `profiler.MODE_RECORD` Records all incoming frames to the recording buffer
163
+ *
164
+ * To stop recording, switch to a different mode such as `MODE_PAUSE` or `MODE_RUN`.
165
+ * You can also use the `view_recorded_frame` function to display a recorded frame. Doing so stops the recording as well.
166
+ * Every time you switch to recording mode the recording buffer is cleared.
167
+ * @example
168
+ * ```ts
169
+ * function start_recording() {
170
+ * profiler.set_ui_mode(profiler.MODE_RECORD);
171
+ * }
172
+ *
173
+ * function stop_recording() {
174
+ * profiler.set_ui_mode(profiler.MODE_PAUSE);
175
+ * }
176
+ * ```
177
+ */
178
+ function set_ui_mode(mode: Opaque<"constant">): void;
179
+ /**
180
+ * Set the on-screen profile view mode - minimized or expanded
181
+ *
182
+ * @param mode - the view mode to set the ui profiler in
183
+ *
184
+ * - `profiler.VIEW_MODE_FULL` The default mode which displays all the ui profiler details
185
+ *
186
+ * - `profiler.VIEW_MODE_MINIMIZED` Minimized mode which only shows the top header (fps counters and ui profiler mode)
187
+ * @example
188
+ * ```ts
189
+ * // Minimize the profiler view
190
+ * profiler.set_ui_view_mode(profiler.VIEW_MODE_MINIMIZED);
191
+ * ```
192
+ */
193
+ function set_ui_view_mode(mode: Opaque<"constant">): void;
194
+ /**
195
+ * Shows or hides the time the engine waits for vsync in the on-screen profiler
196
+ * Each frame the engine waits for vsync and depending on your vsync settings and how much time
197
+ * your game logic takes this time can dwarf the time in the game logic making it hard to
198
+ * see details in the on-screen profiler graph and lists.
199
+ * Also, by hiding this the FPS times in the header show the time spent each time excuding the
200
+ * time spent waiting for vsync. This shows you how long time your game is spending actively
201
+ * working each frame.
202
+ * This setting also effects the display of recorded frames but does not affect the actual
203
+ * recorded frames so it is possible to toggle this on and off when viewing recorded frames.
204
+ * By default the vsync wait times is displayed in the profiler.
205
+ *
206
+ * @param visible - true to include it in the display, false to hide it.
207
+ * @example
208
+ * ```ts
209
+ * // Exclude frame wait time from the profiler ui
210
+ * profiler.set_ui_vsync_wait_visible(false);
211
+ * ```
212
+ */
213
+ function set_ui_vsync_wait_visible(visible: boolean): void;
214
+ /**
215
+ * Pauses and displays a frame from the recording buffer in the on-screen profiler ui
216
+ * The frame to show can either be an absolute frame or a relative frame to the current frame.
217
+ *
218
+ * @param frame_index - a table where you specify one of the following parameters:
219
+ *
220
+ * - `distance` The offset from the currently displayed frame (this is truncated between zero and the number of recorded frames)
221
+ *
222
+ * - `frame` The frame index in the recording buffer (1 is first recorded frame)
223
+ * @example
224
+ * ```ts
225
+ * // Go back one frame
226
+ * profiler.view_recorded_frame({ distance: -1 });
227
+ * ```
228
+ */
229
+ function view_recorded_frame(frame_index: { distance?: number; frame?: number }): void;
230
+ }
231
+ }
232
+
233
+ export {};
@@ -0,0 +1,66 @@
1
+ /** @noSelfInFile */
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
+ */
6
+ namespace push {
7
+ /**
8
+ * Use this function to cancel a previously scheduled local push notification.
9
+ * The notification is identified by a numeric id as returned by `push.schedule()`.
10
+ *
11
+ * @param id - The numeric id of the local push notification
12
+ */
13
+ function cancel(id: number): void;
14
+ /**
15
+ * Use this function to cancel a previously issued local push notifications.
16
+ */
17
+ function cancel_all_issued(): void;
18
+ /**
19
+ * Returns a table with all data associated with all scheduled local push notifications.
20
+ * The table contains key, value pairs where the key is the push notification id and the value is a table with the notification data, corresponding to the data given by `push.get_scheduled(id)`.
21
+ *
22
+ * @returns Table with all data associated with all scheduled notifications.
23
+ */
24
+ function get_all_scheduled(): Record<string | number, unknown>;
25
+ /**
26
+ * Returns a table with all data associated with a specified local push notification.
27
+ * The notification is identified by a numeric id as returned by `push.schedule()`.
28
+ *
29
+ * @param id - The numeric id of the local push notification.
30
+ * @returns Table with all data associated with the notification.
31
+ */
32
+ function get_scheduled(id: number): Record<string | number, unknown>;
33
+ /**
34
+ * Send a request for push notifications. Note that the notifications table parameter is iOS only and will be ignored on Android.
35
+ *
36
+ * @param notifications - The types of notifications to listen to. [icon:ios]
37
+ * @param callback - Register callback function.
38
+ */
39
+ function register(notifications: number[], callback: (...args: unknown[]) => unknown): void;
40
+ /**
41
+ * Local push notifications are scheduled with this function.
42
+ * The returned `id` value is uniquely identifying the scheduled notification and can be stored for later reference.
43
+ *
44
+ * @param time - Number of seconds into the future until the notification should be triggered.
45
+ * @param title - Localized title to be displayed to the user if the application is not running.
46
+ * @param alert - Localized body message of the notification to be displayed to the user if the application is not running.
47
+ * @param payload - JSON string to be passed to the registered listener function.
48
+ * @param notification_settings - Table with notification and platform specific fields
49
+ */
50
+ function schedule(time: number, title: string, alert: string, payload: string, notification_settings: { action?: string; badge_count?: number; priority?: number }): LuaMultiReturn<[number, string]>;
51
+ /**
52
+ * Set the badge count for application icon. This function is only available on iOS. [icon:ios]
53
+ *
54
+ * @param count - Badge count
55
+ */
56
+ function set_badge_count(count: number): void;
57
+ /**
58
+ * Sets a listener function to listen to push notifications.
59
+ *
60
+ * @param listener - Listener callback function.
61
+ */
62
+ function set_listener(listener: (...args: unknown[]) => unknown): void;
63
+ }
64
+ }
65
+
66
+ export {};