@defold-typescript/library-types 0.22.0 → 0.24.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-doc/boom.json +3870 -0
- package/api-doc/{bridge.bridge.json → bridge.json} +754 -844
- package/api-doc/bzAnim.json +338 -0
- package/api-doc/decore.json +23 -23
- package/api-doc/defcon.json +150 -0
- package/api-doc/{defmath.defmath.json → defmath.json} +6 -46
- package/api-doc/defsave.json +518 -0
- package/api-doc/deftest.json +741 -0
- package/api-doc/{dicebag.dicebag.json → dicebag.json} +19 -1
- package/api-doc/druid.json +249 -1846
- package/api-doc/event.json +1074 -0
- package/api-doc/gooey.json +2050 -0
- package/api-doc/immutable.json +65 -0
- package/api-doc/in.accelerometer.json +75 -1
- package/api-doc/in.button.json +17 -10
- package/api-doc/in.cursor.json +26 -0
- package/api-doc/in.gesture.json +401 -6
- package/api-doc/in.keyboard.json +2 -0
- package/api-doc/in.mapper.json +12 -8
- package/api-doc/in.onscreen.json +61 -5
- package/api-doc/in.state.json +61 -13
- package/api-doc/in.textbox.json +23 -12
- package/api-doc/in.triggers.json +336 -0
- package/api-doc/lang.json +528 -0
- package/api-doc/{event.event.json → log.json} +96 -101
- package/api-doc/metrics.fps.json +61 -2
- package/api-doc/metrics.mem.json +61 -2
- package/api-doc/monarch.monarch.json +249 -7
- package/api-doc/monarch.transitions.easings.json +19 -26
- package/api-doc/monarch.transitions.gui.json +782 -79
- package/api-doc/nakama.engine.defold.json +31 -18
- package/api-doc/{nakama.nakama.json → nakama.json} +4752 -2554
- package/api-doc/nakama.util.log.json +32 -4
- package/api-doc/narrator.json +647 -0
- package/api-doc/openapi/nakama.nakama.json +7680 -0
- package/api-doc/orthographic.camera.json +96 -98
- package/api-doc/orthographic.json +602 -0
- package/api-doc/panthera.json +1183 -0
- package/api-doc/{persist.persist.json → persist.json} +26 -1
- package/api-doc/{platypus.platypus.json → platypus.json} +68 -14
- package/api-doc/proto.json +995 -0
- package/api-doc/{rendy.rendy.json → rendy.json} +46 -99
- package/api-doc/richtext.color.json +77 -0
- package/api-doc/richtext.richtext.json +375 -5
- package/api-doc/saver.saver.json +714 -263
- package/api-doc/saver.storage.json +283 -52
- package/api-doc/squid.json +846 -0
- package/api-doc/{starly.starly.json → starly.json} +1 -1
- package/api-doc/tweener.json +277 -0
- package/api-doc/{yagames.yagames.json → yagames.json} +784 -189
- package/api-doc/{zzfx.api.json → zzfx.json} +9 -9
- package/authored-targets.json +403 -0
- package/generated/{boom.boom.d.ts → boom.d.ts} +14 -0
- package/generated/bridge.d.ts +468 -0
- package/generated/{bzAnim.bzLibrary.d.ts → bzAnim.d.ts} +6 -0
- package/generated/decore.d.ts +37 -37
- package/generated/defcon.d.ts +43 -0
- package/generated/{defmath.defmath.d.ts → defmath.d.ts} +3 -2
- package/generated/defsave.d.ts +144 -0
- package/generated/{dicebag.dicebag.d.ts → dicebag.d.ts} +25 -0
- package/generated/druid.d.ts +198 -502
- package/generated/event.d.ts +318 -0
- package/generated/{gooey.gooey.d.ts → gooey.d.ts} +61 -6
- package/generated/immutable.d.ts +13 -0
- package/generated/in.onscreen.d.ts +5 -0
- package/generated/in.textbox.d.ts +4 -0
- package/generated/lang.d.ts +101 -0
- package/generated/log.d.ts +36 -0
- package/generated/metrics.fps.d.ts +19 -1
- package/generated/metrics.mem.d.ts +19 -1
- package/generated/monarch.monarch.d.ts +44 -1
- package/generated/monarch.transitions.easings.d.ts +0 -1
- package/generated/monarch.transitions.gui.d.ts +96 -12
- package/generated/nakama.d.ts +1158 -0
- package/generated/nakama.engine.defold.d.ts +3 -1
- package/generated/nakama.util.log.d.ts +6 -0
- package/generated/narrator.d.ts +121 -0
- package/generated/openapi/nakama.nakama.d.ts +884 -0
- package/generated/orthographic.camera.d.ts +24 -38
- package/generated/orthographic.d.ts +155 -0
- package/generated/panthera.d.ts +170 -0
- package/generated/{persist.persist.d.ts → persist.d.ts} +3 -0
- package/generated/{platypus.platypus.d.ts → platypus.d.ts} +9 -0
- package/generated/proto.d.ts +146 -0
- package/generated/{rendy.rendy.d.ts → rendy.d.ts} +33 -80
- package/generated/richtext.color.d.ts +15 -0
- package/generated/saver.saver.d.ts +289 -42
- package/generated/saver.storage.d.ts +79 -14
- package/generated/squid.d.ts +127 -0
- package/generated/tweener.d.ts +42 -0
- package/generated/{yagames.yagames.d.ts → yagames.d.ts} +151 -29
- package/generated/{zzfx.api.d.ts → zzfx.d.ts} +7 -0
- package/library-classification.json +0 -227
- package/library-targets.json +1 -284
- package/luals-targets.json +168 -1
- package/openapi-targets.json +17 -0
- package/package.json +9 -88
- package/script-api-targets.json +15 -0
- package/scripts/__snapshots__/parse-luals.test.ts.snap +504 -85
- package/scripts/apply-luals-overrides.ts +95 -0
- package/scripts/authored-parity.ts +718 -0
- package/scripts/emit-library-dts.ts +177 -19
- package/scripts/extract-api-doc.ts +189 -38
- package/scripts/fidelity-floor.ts +178 -0
- package/scripts/import-upstream-docs.ts +125 -0
- package/scripts/lower-api-doc.ts +69 -19
- package/scripts/luals-fidelity.ts +22 -10
- package/scripts/map-luals-types.ts +86 -22
- package/scripts/parse-lua-surface.ts +187 -0
- package/scripts/parse-luals.ts +473 -22
- package/scripts/parse-markdown-api.ts +247 -0
- package/scripts/parse-openapi-api.ts +313 -0
- package/scripts/sync-authored-types.ts +249 -0
- package/scripts/sync-library-types.ts +99 -3
- package/scripts/sync-luals-types.ts +29 -2
- package/scripts/sync-markdown-types.ts +761 -0
- package/scripts/sync-openapi-types.ts +308 -0
- package/scripts/sync-script-api-types.ts +367 -0
- package/api-doc/boom.boom.json +0 -26
- package/api-doc/bzAnim.bzLibrary.json +0 -156
- package/api-doc/defcon.console.json +0 -109
- package/api-doc/defsave.defsave.json +0 -175
- package/api-doc/deftest.deftest.json +0 -71
- package/api-doc/gooey.gooey.json +0 -963
- package/api-doc/immutable.immutable.json +0 -63
- package/api-doc/lang.lang.json +0 -411
- package/api-doc/log.log.json +0 -50
- package/api-doc/narrator.narrator.json +0 -150
- package/api-doc/proto.proto.json +0 -355
- package/api-doc/squid.squid.json +0 -660
- package/api-doc/tweener.tweener.json +0 -419
- package/generated/bridge.bridge.d.ts +0 -533
- package/generated/defcon.console.d.ts +0 -24
- package/generated/defsave.defsave.d.ts +0 -31
- package/generated/event.event.d.ts +0 -54
- package/generated/immutable.immutable.d.ts +0 -13
- package/generated/lang.lang.d.ts +0 -33
- package/generated/log.log.d.ts +0 -40
- package/generated/nakama.nakama.d.ts +0 -594
- package/generated/narrator.narrator.d.ts +0 -66
- package/generated/proto.proto.d.ts +0 -36
- package/generated/squid.squid.d.ts +0 -106
- package/generated/tweener.tweener.d.ts +0 -151
- /package/generated/{deftest.deftest.d.ts → deftest.d.ts} +0 -0
- /package/generated/{starly.starly.d.ts → starly.d.ts} +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
/** @noResolution */
|
|
3
|
+
declare module 'bridge.bridge' {
|
|
4
|
+
/**
|
|
5
|
+
* Functions and constants for interacting with bridge
|
|
6
|
+
*/
|
|
7
|
+
export namespace bridge {
|
|
8
|
+
namespace achievements {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the achievement list in JSON.
|
|
11
|
+
*
|
|
12
|
+
* @param on_success - function(_, list)
|
|
13
|
+
* @param on_failure - function(_, error)
|
|
14
|
+
*/
|
|
15
|
+
function get_achievements(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
16
|
+
/**
|
|
17
|
+
* Unlocks achievement for a player.
|
|
18
|
+
*
|
|
19
|
+
* @param on_success - function(_, result)
|
|
20
|
+
* @param on_failure - function(_, error)
|
|
21
|
+
*/
|
|
22
|
+
function unlock(id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
23
|
+
}
|
|
24
|
+
namespace advertisement {
|
|
25
|
+
/**
|
|
26
|
+
* Track the state of the advanced banners to manage ad display and user experience.
|
|
27
|
+
*/
|
|
28
|
+
function advanced_banners_state(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Hide the currently displayed banner ad when it is no longer needed.
|
|
31
|
+
*/
|
|
32
|
+
function banner_state(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Check if the ad blocker is enabled.
|
|
35
|
+
*
|
|
36
|
+
* @param on_success - function(_, bool)
|
|
37
|
+
* @param on_failure - function(_, error)
|
|
38
|
+
*/
|
|
39
|
+
function check_ad_block(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
40
|
+
/**
|
|
41
|
+
* Hide the currently displayed advanced banners when they are no longer needed.
|
|
42
|
+
*/
|
|
43
|
+
function hide_advanced_banners(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Hide the currently displayed banner ad when it is no longer needed.
|
|
46
|
+
*/
|
|
47
|
+
function hide_banner(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Track the state of the interstitial ad to manage ad display and user experience.
|
|
50
|
+
*/
|
|
51
|
+
function interstitial_state(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the platform supports displaying advanced banner ads.
|
|
54
|
+
*/
|
|
55
|
+
function is_advanced_banners_supported(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Check if the platform supports displaying banner ads. Use this to determine if you can include banner advertisements in your game.
|
|
58
|
+
*/
|
|
59
|
+
function is_banner_supported(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Check if the platform supports displaying interstitial ads. Use this to determine if you can include interstitial advertisements in your game.
|
|
62
|
+
*/
|
|
63
|
+
function is_interstitial_supported(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Check if the platform supports displaying rewarded ads. Use this to determine if you can include rewarded advertisements in your game.
|
|
66
|
+
*/
|
|
67
|
+
function is_rewarded_supported(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Minimum time interval between interstitial ad displays to comply with platform requirements and improve user experience.
|
|
70
|
+
*/
|
|
71
|
+
function minimum_delay_between_interstitial(): number;
|
|
72
|
+
/**
|
|
73
|
+
* State changed events.
|
|
74
|
+
*
|
|
75
|
+
* @param callback - function(_, state)
|
|
76
|
+
*/
|
|
77
|
+
function on(event_name: string, callback: (...args: unknown[]) => unknown): void;
|
|
78
|
+
/**
|
|
79
|
+
* Monitor the placement of the rewarded ad to manage the reward process.
|
|
80
|
+
*/
|
|
81
|
+
function rewarded_placement(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Monitor the state of the rewarded ad (loading, opened, closed, rewarded, failed) to manage the reward process.
|
|
84
|
+
*/
|
|
85
|
+
function rewarded_state(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Set the minimum time interval between interstitial ad displays to comply with platform requirements and improve user experience.
|
|
88
|
+
*
|
|
89
|
+
* @param delay - 60 from default
|
|
90
|
+
*/
|
|
91
|
+
function set_minimum_delay_between_interstitial(delay: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* Display advanced banners at appropriate moments of the game.
|
|
94
|
+
*/
|
|
95
|
+
function show_advanced_banners(placement: string): void;
|
|
96
|
+
/**
|
|
97
|
+
* Display a banner ad within your game to generate revenue through advertising.
|
|
98
|
+
*/
|
|
99
|
+
function show_banner(position: string, placement: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Display an interstitial ad at appropriate moments, such as during level transitions or game over screens.
|
|
102
|
+
*/
|
|
103
|
+
function show_interstitial(placement: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Display a rewarded ad and provide incentives to players for watching the entire ad.
|
|
106
|
+
*/
|
|
107
|
+
function show_rewarded(placement: string): void;
|
|
108
|
+
}
|
|
109
|
+
namespace cross_promo {
|
|
110
|
+
/**
|
|
111
|
+
* Get the cross-promo games list. Resolves to an empty array when unsupported. Each game has the shape { id, name, url, icon_url, cover_url, payload }.
|
|
112
|
+
*
|
|
113
|
+
* @param on_success - function(_, games)
|
|
114
|
+
* @param on_failure - function(_, error)
|
|
115
|
+
*/
|
|
116
|
+
function get_games(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
117
|
+
/**
|
|
118
|
+
* Hide the built-in cross-promo HTML overlay.
|
|
119
|
+
*/
|
|
120
|
+
function hide(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Check whether the cross-promo overlay is currently shown.
|
|
123
|
+
*/
|
|
124
|
+
function is_visible(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Show the built-in cross-promo HTML overlay.
|
|
127
|
+
*/
|
|
128
|
+
function show(): void;
|
|
129
|
+
}
|
|
130
|
+
namespace daily_rewards {
|
|
131
|
+
/**
|
|
132
|
+
* Claims the reward available today. Calls on_success when claimed, on_failure otherwise.
|
|
133
|
+
*
|
|
134
|
+
* @param on_success - function(_)
|
|
135
|
+
* @param on_failure - function(_, error)
|
|
136
|
+
*/
|
|
137
|
+
function claim_current_reward(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
138
|
+
/**
|
|
139
|
+
* Returns the 0-based index of the reward the player is currently on.
|
|
140
|
+
*
|
|
141
|
+
* @param on_success - function(_, day)
|
|
142
|
+
* @param on_failure - function(_, error)
|
|
143
|
+
*/
|
|
144
|
+
function get_current_day(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
145
|
+
/**
|
|
146
|
+
* Returns the id of the reward claimable today, or nil when nothing can be claimed.
|
|
147
|
+
*
|
|
148
|
+
* @param on_success - function(_, reward)
|
|
149
|
+
* @param on_failure - function(_, error)
|
|
150
|
+
*/
|
|
151
|
+
function get_current_reward(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
152
|
+
/**
|
|
153
|
+
* Returns the configured ordered list of reward ids as a JSON string.
|
|
154
|
+
*
|
|
155
|
+
* @param on_success - function(_, rewards)
|
|
156
|
+
* @param on_failure - function(_, error)
|
|
157
|
+
*/
|
|
158
|
+
function get_rewards(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
159
|
+
}
|
|
160
|
+
namespace device {
|
|
161
|
+
/**
|
|
162
|
+
* Determine the type of device (mobile, tablet, desktop, tv) the game is being played on to adjust the game`s interface and performance settings.
|
|
163
|
+
*/
|
|
164
|
+
function type(): string;
|
|
165
|
+
}
|
|
166
|
+
namespace leaderboards {
|
|
167
|
+
/**
|
|
168
|
+
* Retrieve entries from the leaderboard, including the player's rank and score, to display a comprehensive leaderboard.
|
|
169
|
+
*
|
|
170
|
+
* @param on_success - function(_, entries)
|
|
171
|
+
* @param on_failure - function(_, error)
|
|
172
|
+
*/
|
|
173
|
+
function get_entries(id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
174
|
+
/**
|
|
175
|
+
* Submit the player's score to the leaderboard to update their rank and position.
|
|
176
|
+
*
|
|
177
|
+
* @param on_success - function()
|
|
178
|
+
* @param on_failure - function(_, error)
|
|
179
|
+
*/
|
|
180
|
+
function set_score(id: string, score: number, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
181
|
+
/**
|
|
182
|
+
* Show native popup leaderboard.
|
|
183
|
+
*
|
|
184
|
+
* @param on_success - function()
|
|
185
|
+
* @param on_failure - function(_, error)
|
|
186
|
+
*/
|
|
187
|
+
function show_native_popup(id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
188
|
+
/**
|
|
189
|
+
* Check the leaderboards type on the platform.
|
|
190
|
+
*/
|
|
191
|
+
function type(): string;
|
|
192
|
+
}
|
|
193
|
+
namespace payments {
|
|
194
|
+
/**
|
|
195
|
+
* Consume purchased items, such as in-game currency, once they are used, to manage inventory and player progression.
|
|
196
|
+
*
|
|
197
|
+
* @param on_success - function(_, purchase)
|
|
198
|
+
* @param on_failure - function(_, error)
|
|
199
|
+
*/
|
|
200
|
+
function consume_purchase(id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieve a list of all available in-game items that players can purchase to display in the game store.
|
|
203
|
+
*
|
|
204
|
+
* @param on_success - function(_, catalogItems)
|
|
205
|
+
* @param on_failure - function(_, error)
|
|
206
|
+
*/
|
|
207
|
+
function get_catalog(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve a list of items that the player has purchased to manage their inventory and provide access to purchased content.
|
|
210
|
+
*
|
|
211
|
+
* @param on_success - function(nil, purchases)
|
|
212
|
+
* @param on_failure - function(_, error)
|
|
213
|
+
*/
|
|
214
|
+
function get_purchases(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
215
|
+
/**
|
|
216
|
+
* Check if in-game purchases are supported to offer items or upgrades within the game.
|
|
217
|
+
*/
|
|
218
|
+
function is_supported(): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Allow players to buy items or upgrades in your game to enhance their gameplay experience.
|
|
221
|
+
*
|
|
222
|
+
* @param on_success - function(_, purchase)
|
|
223
|
+
* @param on_failure - function(_, error)
|
|
224
|
+
*/
|
|
225
|
+
function purchase(id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
226
|
+
}
|
|
227
|
+
namespace platform {
|
|
228
|
+
/**
|
|
229
|
+
* Server Time
|
|
230
|
+
*
|
|
231
|
+
* @param on_success - function(_, time)
|
|
232
|
+
* @param on_failure - function(_, error)
|
|
233
|
+
*/
|
|
234
|
+
function get_server_time(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
235
|
+
/**
|
|
236
|
+
* Identify the platform on which the game is currently running to customize features and settings accordingly.
|
|
237
|
+
*/
|
|
238
|
+
function id(): string | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Check if the audio is enabled on the platform.
|
|
241
|
+
*/
|
|
242
|
+
function is_audio_enabled(): boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Check if external calls are supported on the platform.
|
|
245
|
+
*/
|
|
246
|
+
function is_external_calls_supported(): boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Check if external links are allowed on the platform.
|
|
249
|
+
*/
|
|
250
|
+
function is_external_links_allowed(): boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Get the language set by the user on the platform or the browser language if not provided by the platform, to localize game content.
|
|
253
|
+
*/
|
|
254
|
+
function language(): string;
|
|
255
|
+
/**
|
|
256
|
+
* State changed events.
|
|
257
|
+
*
|
|
258
|
+
* @param callback - function(_, state)
|
|
259
|
+
*/
|
|
260
|
+
function on(event_name: string, callback: (...args: unknown[]) => unknown): void;
|
|
261
|
+
/**
|
|
262
|
+
* Embed auxiliary information into the game URL to pass additional data or settings when launching the game.
|
|
263
|
+
*/
|
|
264
|
+
function payload(): string | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Send a custom message with an arbitrary id to the platform.
|
|
267
|
+
*
|
|
268
|
+
* @param id - The custom message id.
|
|
269
|
+
* @param options - Optional message-specific options (may be omitted).
|
|
270
|
+
*/
|
|
271
|
+
function send_custom_message(id: string, options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
272
|
+
/**
|
|
273
|
+
* Send predefined messages to the platform to trigger specific actions or events, such as signaling that the game is ready.
|
|
274
|
+
*
|
|
275
|
+
* @param message - One of message types: `game_ready` `in_game_loading_started`
|
|
276
|
+
* @param options - Optional message-specific options (may be omitted).
|
|
277
|
+
*/
|
|
278
|
+
function send_message(message: string, options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
279
|
+
/**
|
|
280
|
+
* Retrieve the top-level domain of the platform to handle domain-specific configurations and behavior.
|
|
281
|
+
*/
|
|
282
|
+
function tld(): string | undefined;
|
|
283
|
+
}
|
|
284
|
+
namespace player {
|
|
285
|
+
/**
|
|
286
|
+
* Authorize the player on the platform to access protected features and personalize the game experience. For example, prompting the player to log in to save their progress or unlock social sharing features.
|
|
287
|
+
*
|
|
288
|
+
* @param on_success - function()
|
|
289
|
+
* @param on_failure - function(_, error)
|
|
290
|
+
*/
|
|
291
|
+
function authorize(options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
292
|
+
/**
|
|
293
|
+
* Get the extra information about player.
|
|
294
|
+
*/
|
|
295
|
+
function extra(): Record<string | number, unknown>;
|
|
296
|
+
/**
|
|
297
|
+
* Get the player’s unique ID on the platform to manage user-specific data and settings. Use this ID to track player progress, achievements, and purchases.
|
|
298
|
+
*/
|
|
299
|
+
function id(): string | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* Check if the platform supports player authorization to enable features that require user authentication, such as saving game progress or accessing social features.
|
|
302
|
+
*/
|
|
303
|
+
function is_authorization_supported(): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Verify if the player is currently authorized on the platform. This allows you to enable personalized features, such as saving high scores or providing user-specific content.
|
|
306
|
+
*/
|
|
307
|
+
function is_authorized(): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Check if the player is unauthorized or running as a guest.
|
|
310
|
+
*/
|
|
311
|
+
function is_guest(): boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Retrieve the player's name to personalize the game experience. Display the name in leaderboards, friend lists, or when sending notifications and messages.
|
|
314
|
+
*/
|
|
315
|
+
function name(): string | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* Get the count of player avatars available. Use this to manage and display user profile images effectively, such as showing the avatar in multiplayer lobbies or profile screens.
|
|
318
|
+
*/
|
|
319
|
+
function photos(): Record<string | number, unknown>;
|
|
320
|
+
}
|
|
321
|
+
namespace remote_config {
|
|
322
|
+
/**
|
|
323
|
+
* Encourage players to rate your game, providing valuable feedback and improving visibility.
|
|
324
|
+
*
|
|
325
|
+
* @param on_success - function(_, data)
|
|
326
|
+
* @param on_failure - function(_)
|
|
327
|
+
*/
|
|
328
|
+
function get(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
329
|
+
/**
|
|
330
|
+
* Check if remote configuration is supported to manage game settings without releasing updates.
|
|
331
|
+
*/
|
|
332
|
+
function is_supported(): boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Set dynamic game/player parameters used for config segmentation. Accumulates across calls; only used by platforms that support it.
|
|
335
|
+
*/
|
|
336
|
+
function set_context(parameters: Record<string | number, unknown>): void;
|
|
337
|
+
}
|
|
338
|
+
namespace social {
|
|
339
|
+
/**
|
|
340
|
+
* Allow players to bookmark your game for easy access in the future.
|
|
341
|
+
*
|
|
342
|
+
* @param on_success - function(_)
|
|
343
|
+
* @param on_failure - function(_)
|
|
344
|
+
*/
|
|
345
|
+
function add_to_favorites(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
346
|
+
/**
|
|
347
|
+
* Enable players to add a shortcut to your game on their home screen for quick access.
|
|
348
|
+
*
|
|
349
|
+
* @param on_success - function(_)
|
|
350
|
+
* @param on_failure - function(_)
|
|
351
|
+
*/
|
|
352
|
+
function add_to_home_screen(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
353
|
+
/**
|
|
354
|
+
* Use this to let players create posts about their achievements or updates directly from the game.
|
|
355
|
+
*
|
|
356
|
+
* @param on_success - function(_)
|
|
357
|
+
* @param on_failure - function(_)
|
|
358
|
+
*/
|
|
359
|
+
function create_post(options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
360
|
+
/**
|
|
361
|
+
* Allow players to invite their friends to play the game, helping to grow your player base organically.
|
|
362
|
+
*
|
|
363
|
+
* @param on_success - function(_)
|
|
364
|
+
* @param on_failure - function(_)
|
|
365
|
+
*/
|
|
366
|
+
function invite_friends(options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
367
|
+
/**
|
|
368
|
+
* Check if the add to favorites functionality is supported on the platform.
|
|
369
|
+
*/
|
|
370
|
+
function is_add_to_favorites_supported(): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Check if the add to home screen functionality is supported on the platform.
|
|
373
|
+
*/
|
|
374
|
+
function is_add_to_home_screen_supported(): boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Check if the create post functionality is supported on the platform.
|
|
377
|
+
*/
|
|
378
|
+
function is_create_post_supported(): boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Check if the invite friends functionality is supported on the platform.
|
|
381
|
+
*/
|
|
382
|
+
function is_invite_friends_supported(): boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Check if the join community functionality is supported on the platform.
|
|
385
|
+
*/
|
|
386
|
+
function is_join_community_supported(): boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Check if the rate game functionality is supported on the platform.
|
|
389
|
+
*/
|
|
390
|
+
function is_rate_supported(): boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Check if the share functionality is supported on the platform.
|
|
393
|
+
*/
|
|
394
|
+
function is_share_supported(): boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Use this to allow players to share game content or achievements on social media platforms.
|
|
397
|
+
*
|
|
398
|
+
* @param on_success - function(_)
|
|
399
|
+
* @param on_failure - function(_)
|
|
400
|
+
*/
|
|
401
|
+
function join_community(options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
402
|
+
/**
|
|
403
|
+
* Encourage players to rate your game, providing valuable feedback and improving visibility.
|
|
404
|
+
*
|
|
405
|
+
* @param on_success - function(_)
|
|
406
|
+
* @param on_failure - function(_)
|
|
407
|
+
*/
|
|
408
|
+
function rate(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
409
|
+
/**
|
|
410
|
+
* Use this to allow players to share game content or achievements on social media platforms.
|
|
411
|
+
*
|
|
412
|
+
* @param on_success - function(_)
|
|
413
|
+
* @param on_failure - function(_)
|
|
414
|
+
*/
|
|
415
|
+
function share(options: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
416
|
+
}
|
|
417
|
+
namespace storage {
|
|
418
|
+
/**
|
|
419
|
+
* Remove data from the storage by key to manage player data and settings effectively.
|
|
420
|
+
*
|
|
421
|
+
* @param on_success - function(_)
|
|
422
|
+
* @param on_failure - function(_, error)
|
|
423
|
+
*/
|
|
424
|
+
function _delete(table_keys: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
425
|
+
/**
|
|
426
|
+
* Retrieve stored data based on a key or multiple keys to restore player progress or settings.
|
|
427
|
+
*
|
|
428
|
+
* @param on_success - function(_, data)
|
|
429
|
+
* @param on_failure - function(_, error)
|
|
430
|
+
*/
|
|
431
|
+
export function get(table_keys: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
432
|
+
/**
|
|
433
|
+
* Save data to the storage with a key to retain player progress or settings.
|
|
434
|
+
*
|
|
435
|
+
* @param on_success - function(_)
|
|
436
|
+
* @param on_failure - function(_, error)
|
|
437
|
+
*/
|
|
438
|
+
export function set(table_data: Record<string | number, unknown>, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
439
|
+
export { _delete as delete };
|
|
440
|
+
}
|
|
441
|
+
namespace tasks {
|
|
442
|
+
/**
|
|
443
|
+
* Advances every active target whose id equals the given metric, clamped to the target amount.
|
|
444
|
+
*
|
|
445
|
+
* @param metric - The metric id to advance.
|
|
446
|
+
* @param amount - The amount to add (defaults to 1).
|
|
447
|
+
* @param on_success - function(_)
|
|
448
|
+
* @param on_failure - function(_, error)
|
|
449
|
+
*/
|
|
450
|
+
function add_progress(metric: string, amount: number, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
451
|
+
/**
|
|
452
|
+
* Claims a completed task's rewards. Calls on_success with true when claimed, false otherwise.
|
|
453
|
+
*
|
|
454
|
+
* @param task_id - The id of the task to claim.
|
|
455
|
+
* @param on_success - function(_, claimed)
|
|
456
|
+
* @param on_failure - function(_, error)
|
|
457
|
+
*/
|
|
458
|
+
function claim_reward(task_id: string, on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
459
|
+
/**
|
|
460
|
+
* Returns every active task across all groups, with live progress, as a JSON string.
|
|
461
|
+
*
|
|
462
|
+
* @param on_success - function(_, tasks)
|
|
463
|
+
* @param on_failure - function(_, error)
|
|
464
|
+
*/
|
|
465
|
+
function get_tasks(on_success: (...args: unknown[]) => unknown, on_failure: (...args: unknown[]) => unknown): void;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
@@ -90,4 +90,10 @@ declare module "bzAnim.bzLibrary" {
|
|
|
90
90
|
export function isReady(): boolean;
|
|
91
91
|
|
|
92
92
|
export function setDebugLevel(level: number): void;
|
|
93
|
+
|
|
94
|
+
export function setMaxPoints(num: number): void;
|
|
95
|
+
|
|
96
|
+
export function registerController(obj: Hash | string): void;
|
|
97
|
+
|
|
98
|
+
export function unregisterController(obj: Hash | string): void;
|
|
93
99
|
}
|
package/generated/decore.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare module 'decore.decore' {
|
|
|
4
4
|
event_bus: decore_event_bus;
|
|
5
5
|
entities: entity[];
|
|
6
6
|
systems: system[];
|
|
7
|
-
speed
|
|
7
|
+
speed?: number | undefined;
|
|
8
8
|
add?(...args: any[]): unknown;
|
|
9
9
|
addEntity?(...args: any[]): entity;
|
|
10
10
|
addSystem?(...args: any[]): system;
|
|
@@ -42,13 +42,13 @@ declare module 'decore.decore' {
|
|
|
42
42
|
components: LuaTable<string, unknown>;
|
|
43
43
|
}
|
|
44
44
|
interface entity {
|
|
45
|
-
id
|
|
46
|
-
prefab_id
|
|
47
|
-
pack_id
|
|
48
|
-
parent_prefab_id
|
|
49
|
-
child_instancies
|
|
50
|
-
parent_id
|
|
51
|
-
children_ids
|
|
45
|
+
id?: number | undefined;
|
|
46
|
+
prefab_id?: string | undefined;
|
|
47
|
+
pack_id?: string | undefined;
|
|
48
|
+
parent_prefab_id?: string | undefined;
|
|
49
|
+
child_instancies?: entity | undefined;
|
|
50
|
+
parent_id?: number | undefined;
|
|
51
|
+
children_ids?: number[] | undefined;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* System Decore class to manage child-parent relationships and default components
|
|
@@ -74,24 +74,24 @@ declare module 'decore.decore' {
|
|
|
74
74
|
nocache: boolean;
|
|
75
75
|
index: number;
|
|
76
76
|
modified: boolean;
|
|
77
|
-
interval
|
|
78
|
-
bufferedTime
|
|
77
|
+
interval?: number | undefined;
|
|
78
|
+
bufferedTime?: number | undefined;
|
|
79
79
|
onAdd?(...args: any[]): void;
|
|
80
80
|
onRemove?(...args: any[]): void;
|
|
81
81
|
onModify?(...args: any[]): void;
|
|
82
82
|
onAddToWorld?(...args: any[]): void;
|
|
83
83
|
onRemoveFromWorld?(...args: any[]): void;
|
|
84
|
-
preWrap
|
|
85
|
-
postWrap
|
|
86
|
-
update
|
|
87
|
-
fixed_update
|
|
88
|
-
late_update
|
|
89
|
-
preProcess
|
|
90
|
-
process
|
|
91
|
-
postProcess
|
|
92
|
-
compare
|
|
84
|
+
preWrap?: ((system: system, dt: number) => void) | undefined;
|
|
85
|
+
postWrap?: ((system: system, dt: number) => void) | undefined;
|
|
86
|
+
update?: ((system: system, dt: number) => void) | undefined;
|
|
87
|
+
fixed_update?: ((system: system, dt: number) => void) | undefined;
|
|
88
|
+
late_update?: ((system: system, dt: number) => void) | undefined;
|
|
89
|
+
preProcess?: ((system: system, dt: number) => void) | undefined;
|
|
90
|
+
process?: ((system: system, entity: entity, dt: number) => void) | undefined;
|
|
91
|
+
postProcess?: ((system: system, dt: number) => void) | undefined;
|
|
92
|
+
compare?: ((e1: entity, e2: entity) => void) | undefined;
|
|
93
93
|
}
|
|
94
|
-
interface
|
|
94
|
+
interface tiny_ecs {
|
|
95
95
|
requireAll: (...args: unknown[]) => unknown;
|
|
96
96
|
requireAny: (...args: unknown[]) => unknown;
|
|
97
97
|
rejectAll: (...args: unknown[]) => unknown;
|
|
@@ -101,7 +101,7 @@ declare module 'decore.decore' {
|
|
|
101
101
|
processingSystem: (table: system | undefined) => system;
|
|
102
102
|
sortedSystem: (table: system | undefined) => system;
|
|
103
103
|
sortedProcessingSystem: (table: system | undefined) => system;
|
|
104
|
-
world: (...args: unknown[]) => LuaMultiReturn<[world, unknown]>;
|
|
104
|
+
world: (...args: unknown[]) => LuaMultiReturn<[world, ...unknown[]]>;
|
|
105
105
|
addEntity: (world: world, entity: entity) => entity;
|
|
106
106
|
addSystem: (world: world, system: system) => system;
|
|
107
107
|
add: (world: world, ...args: unknown[]) => unknown;
|
|
@@ -129,12 +129,12 @@ declare module 'decore.decore' {
|
|
|
129
129
|
/**
|
|
130
130
|
* Processes a specified event, returning the list of events and optionally calling callback with the full list.
|
|
131
131
|
*/
|
|
132
|
-
process(event_name: Hash | string, callback
|
|
132
|
+
process(event_name: Hash | string, callback?: ((events: unknown[]) => void) | ((context: unknown, events: unknown[]) => void) | undefined, context?: unknown | undefined): unknown[] | undefined;
|
|
133
133
|
process_all(): void;
|
|
134
134
|
/**
|
|
135
135
|
* You can set the merge policy for an event. This is useful when you want to merge events of the same type.
|
|
136
136
|
*/
|
|
137
|
-
set_merge_policy(event_name: string, merge_callback
|
|
137
|
+
set_merge_policy(event_name: string, merge_callback?: ((new_event: unknown, events: unknown[], entity_map: LuaTable<entity, unknown[]>) => boolean) | undefined): void;
|
|
138
138
|
clear_events(): void;
|
|
139
139
|
stash_to_events(): void;
|
|
140
140
|
get_events(): void;
|
|
@@ -154,15 +154,15 @@ declare module 'decore.decore' {
|
|
|
154
154
|
/**
|
|
155
155
|
* Add window event to the world event bus
|
|
156
156
|
*/
|
|
157
|
-
export function on_message(this: void, world: world, message_id: Hash, message
|
|
158
|
-
export function system<T>(this: void, system_module: T, system_id: string, require_all_filters
|
|
159
|
-
export function processing_system<T>(this: void, system_module: T, system_id: string, require_all_filters
|
|
160
|
-
export function sorted_system<T>(this: void, system_module: T, system_id: string, require_all_filters
|
|
161
|
-
export function sorted_processing_system<T>(this: void, system_module: T, system_id: string, require_all_filters
|
|
157
|
+
export function on_message(this: void, world: world, message_id: Hash, message?: LuaTable | undefined, sender?: Url | undefined): void;
|
|
158
|
+
export function system<T>(this: void, system_module: T, system_id: string, require_all_filters?: string | string[] | undefined): T;
|
|
159
|
+
export function processing_system<T>(this: void, system_module: T, system_id: string, require_all_filters?: string | string[] | undefined): T;
|
|
160
|
+
export function sorted_system<T>(this: void, system_module: T, system_id: string, require_all_filters?: string | string[] | undefined): T;
|
|
161
|
+
export function sorted_processing_system<T>(this: void, system_module: T, system_id: string, require_all_filters?: string | string[] | undefined): T;
|
|
162
162
|
/**
|
|
163
163
|
* Register entity to create it with `create_prefab` function
|
|
164
164
|
*/
|
|
165
|
-
export function register_entity(this: void, entity_id: string, entity_data: LuaTable, pack_id
|
|
165
|
+
export function register_entity(this: void, entity_id: string, entity_data: LuaTable, pack_id?: string | undefined): void;
|
|
166
166
|
/**
|
|
167
167
|
* Add entities pack to decore entities
|
|
168
168
|
* If entities pack with same id already loaded, do nothing.
|
|
@@ -180,11 +180,11 @@ declare module 'decore.decore' {
|
|
|
180
180
|
/**
|
|
181
181
|
* Create new entity instance from prefab
|
|
182
182
|
*/
|
|
183
|
-
export function create_prefab(this: void, prefab_id
|
|
183
|
+
export function create_prefab(this: void, prefab_id?: string | Hash | undefined, pack_id?: string | undefined, components?: LuaTable<string, unknown> | undefined): entity;
|
|
184
184
|
/**
|
|
185
185
|
* Register component to decore components
|
|
186
186
|
*/
|
|
187
|
-
export function register_component(this: void, component_id: string, component_data: LuaTable | string | number | boolean, pack_id
|
|
187
|
+
export function register_component(this: void, component_id: string, component_data: LuaTable | string | number | boolean, pack_id?: string | undefined): void;
|
|
188
188
|
/**
|
|
189
189
|
* Register components pack to decore components
|
|
190
190
|
*/
|
|
@@ -196,25 +196,25 @@ declare module 'decore.decore' {
|
|
|
196
196
|
/**
|
|
197
197
|
* Return new component instance from prefab
|
|
198
198
|
*/
|
|
199
|
-
export function create_component(this: void, component_id: string, component_pack_id
|
|
199
|
+
export function create_component(this: void, component_id: string, component_pack_id?: string | undefined): unknown | undefined;
|
|
200
200
|
/**
|
|
201
201
|
* Add component to entity.
|
|
202
202
|
* If component not exists, it will be created with default values
|
|
203
203
|
* If component already exists, it will be merged with the new data
|
|
204
204
|
* To refresh system filters, call world:addEntity(entity) after this function
|
|
205
205
|
*/
|
|
206
|
-
export function apply_component(this: void, entity: entity, component_id: string, component_data
|
|
206
|
+
export function apply_component(this: void, entity: entity, component_id: string, component_data?: unknown | undefined): entity;
|
|
207
207
|
/**
|
|
208
208
|
* Add components to entity
|
|
209
209
|
* To refresh system filters, call world:addEntity(entity) after this function
|
|
210
210
|
*/
|
|
211
|
-
export function apply_components(this: void, entity: entity, components
|
|
211
|
+
export function apply_components(this: void, entity: entity, components?: LuaTable<string, unknown> | undefined): entity;
|
|
212
212
|
export function get_entity_by_id(this: void, world: world, id: number): entity | undefined;
|
|
213
213
|
/**
|
|
214
214
|
* Return all entities with component_id equal to component_value or all entities with component_id if component_value is nil.
|
|
215
215
|
* It looks for component_id in entity and entityToChange tables
|
|
216
216
|
*/
|
|
217
|
-
export function find_entities(this: void, world: world, component_id: string, component_value
|
|
217
|
+
export function find_entities(this: void, world: world, component_id: string, component_value?: unknown | undefined): entity[];
|
|
218
218
|
/**
|
|
219
219
|
* Log all loaded packs for entities, components and worlds
|
|
220
220
|
*/
|
|
@@ -223,6 +223,6 @@ declare module 'decore.decore' {
|
|
|
223
223
|
* Log all loaded systems
|
|
224
224
|
*/
|
|
225
225
|
export function print_loaded_systems_debug_info(this: void, world: world): void;
|
|
226
|
-
export function set_logger(this: void, logger_instance
|
|
227
|
-
export function get_logger(this: void, name
|
|
226
|
+
export function set_logger(this: void, logger_instance?: decore_logger | LuaTable | undefined): void;
|
|
227
|
+
export function get_logger(this: void, name?: string | undefined, level?: string | undefined): decore_logger;
|
|
228
228
|
}
|