@defold-typescript/library-types 0.23.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.
Files changed (120) hide show
  1. package/api-doc/boom.json +3870 -0
  2. package/api-doc/bridge.json +10 -5
  3. package/api-doc/bzAnim.json +338 -0
  4. package/api-doc/decore.json +1 -1
  5. package/api-doc/defcon.json +150 -0
  6. package/api-doc/{defmath.defmath.json → defmath.json} +6 -46
  7. package/api-doc/defsave.json +518 -0
  8. package/api-doc/deftest.json +741 -0
  9. package/api-doc/{dicebag.dicebag.json → dicebag.json} +19 -1
  10. package/api-doc/druid.json +90 -92
  11. package/api-doc/event.json +16 -16
  12. package/api-doc/gooey.json +2050 -0
  13. package/api-doc/in.accelerometer.json +75 -1
  14. package/api-doc/in.button.json +17 -10
  15. package/api-doc/in.cursor.json +26 -0
  16. package/api-doc/in.gesture.json +401 -6
  17. package/api-doc/in.keyboard.json +2 -0
  18. package/api-doc/in.mapper.json +12 -8
  19. package/api-doc/in.onscreen.json +61 -5
  20. package/api-doc/in.state.json +61 -13
  21. package/api-doc/in.textbox.json +23 -12
  22. package/api-doc/in.triggers.json +336 -0
  23. package/api-doc/lang.json +5 -5
  24. package/api-doc/log.json +1 -1
  25. package/api-doc/metrics.fps.json +61 -2
  26. package/api-doc/metrics.mem.json +61 -2
  27. package/api-doc/monarch.monarch.json +249 -7
  28. package/api-doc/monarch.transitions.easings.json +19 -26
  29. package/api-doc/monarch.transitions.gui.json +782 -79
  30. package/api-doc/nakama.engine.defold.json +31 -18
  31. package/api-doc/{nakama.nakama.json → nakama.json} +4752 -2554
  32. package/api-doc/nakama.util.log.json +32 -4
  33. package/api-doc/narrator.json +1 -1
  34. package/api-doc/openapi/nakama.nakama.json +7680 -0
  35. package/api-doc/orthographic.camera.json +96 -98
  36. package/api-doc/orthographic.json +602 -0
  37. package/api-doc/panthera.json +1183 -0
  38. package/api-doc/{persist.persist.json → persist.json} +26 -1
  39. package/api-doc/{platypus.platypus.json → platypus.json} +68 -14
  40. package/api-doc/{rendy.rendy.json → rendy.json} +46 -99
  41. package/api-doc/richtext.color.json +77 -0
  42. package/api-doc/richtext.richtext.json +375 -5
  43. package/api-doc/saver.saver.json +2 -1
  44. package/api-doc/saver.storage.json +2 -1
  45. package/api-doc/{starly.starly.json → starly.json} +1 -1
  46. package/api-doc/{yagames.yagames.json → yagames.json} +784 -189
  47. package/api-doc/{zzfx.api.json → zzfx.json} +9 -9
  48. package/authored-targets.json +403 -0
  49. package/generated/{boom.boom.d.ts → boom.d.ts} +14 -0
  50. package/generated/bridge.d.ts +5 -5
  51. package/generated/{bzAnim.bzLibrary.d.ts → bzAnim.d.ts} +6 -0
  52. package/generated/decore.d.ts +1 -1
  53. package/generated/defcon.d.ts +43 -0
  54. package/generated/{defmath.defmath.d.ts → defmath.d.ts} +3 -2
  55. package/generated/defsave.d.ts +144 -0
  56. package/generated/{dicebag.dicebag.d.ts → dicebag.d.ts} +25 -0
  57. package/generated/druid.d.ts +81 -79
  58. package/generated/event.d.ts +15 -15
  59. package/generated/{gooey.gooey.d.ts → gooey.d.ts} +61 -6
  60. package/generated/in.onscreen.d.ts +5 -0
  61. package/generated/in.textbox.d.ts +4 -0
  62. package/generated/lang.d.ts +5 -5
  63. package/generated/log.d.ts +1 -1
  64. package/generated/metrics.fps.d.ts +19 -1
  65. package/generated/metrics.mem.d.ts +19 -1
  66. package/generated/monarch.monarch.d.ts +44 -1
  67. package/generated/monarch.transitions.easings.d.ts +0 -1
  68. package/generated/monarch.transitions.gui.d.ts +96 -12
  69. package/generated/nakama.d.ts +1158 -0
  70. package/generated/nakama.engine.defold.d.ts +3 -1
  71. package/generated/nakama.util.log.d.ts +6 -0
  72. package/generated/narrator.d.ts +1 -1
  73. package/generated/openapi/nakama.nakama.d.ts +884 -0
  74. package/generated/orthographic.camera.d.ts +24 -38
  75. package/generated/orthographic.d.ts +155 -0
  76. package/generated/panthera.d.ts +170 -0
  77. package/generated/{persist.persist.d.ts → persist.d.ts} +3 -0
  78. package/generated/{platypus.platypus.d.ts → platypus.d.ts} +9 -0
  79. package/generated/{rendy.rendy.d.ts → rendy.d.ts} +33 -80
  80. package/generated/richtext.color.d.ts +15 -0
  81. package/generated/saver.saver.d.ts +2 -0
  82. package/generated/saver.storage.d.ts +2 -0
  83. package/generated/{yagames.yagames.d.ts → yagames.d.ts} +151 -29
  84. package/generated/{zzfx.api.d.ts → zzfx.d.ts} +7 -0
  85. package/library-classification.json +0 -156
  86. package/library-targets.json +1 -218
  87. package/luals-targets.json +56 -3
  88. package/openapi-targets.json +17 -0
  89. package/package.json +7 -57
  90. package/scripts/__snapshots__/parse-luals.test.ts.snap +164 -10
  91. package/scripts/apply-luals-overrides.ts +39 -7
  92. package/scripts/authored-parity.ts +718 -0
  93. package/scripts/emit-library-dts.ts +94 -17
  94. package/scripts/extract-api-doc.ts +189 -38
  95. package/scripts/fidelity-floor.ts +178 -0
  96. package/scripts/import-upstream-docs.ts +125 -0
  97. package/scripts/lower-api-doc.ts +21 -3
  98. package/scripts/luals-fidelity.ts +16 -11
  99. package/scripts/map-luals-types.ts +52 -21
  100. package/scripts/parse-lua-surface.ts +187 -0
  101. package/scripts/parse-luals.ts +50 -4
  102. package/scripts/parse-markdown-api.ts +247 -0
  103. package/scripts/parse-openapi-api.ts +313 -0
  104. package/scripts/sync-authored-types.ts +249 -0
  105. package/scripts/sync-library-types.ts +99 -3
  106. package/scripts/sync-luals-types.ts +14 -1
  107. package/scripts/sync-markdown-types.ts +761 -0
  108. package/scripts/sync-openapi-types.ts +308 -0
  109. package/scripts/sync-script-api-types.ts +16 -17
  110. package/api-doc/boom.boom.json +0 -26
  111. package/api-doc/bzAnim.bzLibrary.json +0 -156
  112. package/api-doc/defcon.console.json +0 -109
  113. package/api-doc/defsave.defsave.json +0 -175
  114. package/api-doc/deftest.deftest.json +0 -71
  115. package/api-doc/gooey.gooey.json +0 -963
  116. package/generated/defcon.console.d.ts +0 -24
  117. package/generated/defsave.defsave.d.ts +0 -31
  118. package/generated/nakama.nakama.d.ts +0 -594
  119. /package/generated/{deftest.deftest.d.ts → deftest.d.ts} +0 -0
  120. /package/generated/{starly.starly.d.ts → starly.d.ts} +0 -0
@@ -29,7 +29,21 @@ declare module 'yagames.yagames' {
29
29
  }
30
30
  export function adv_show_rewarded_video(callbacks: RewardedCallbacks): void;
31
31
 
32
- //* Authentication + Player
32
+ export interface StickyBannerStatus {
33
+ stickyAdvIsShowing: boolean;
34
+ reason?: "ADV_IS_NOT_CONNECTED" | "UNKNOWN";
35
+ }
36
+ export type StickyBannerCallback = (ctx: Context, err?: string, result?: StickyBannerStatus) => void;
37
+ export function adv_get_banner_adv_status(callback: StickyBannerCallback): void;
38
+
39
+ export function adv_show_banner_adv(callback?: StickyBannerCallback): void;
40
+
41
+ export type StickyBannerHideCallback = (ctx: Context, err?: string, result?: {
42
+ stickyAdvIsShowing: boolean;
43
+ }) => void;
44
+ export function adv_hide_banner_adv(callback?: StickyBannerHideCallback): void;
45
+
46
+ //* Authentication + Player
33
47
 
34
48
  export function auth_open_auth_dialog(callback: ApiCallback): void;
35
49
 
@@ -50,7 +64,7 @@ declare module 'yagames.yagames' {
50
64
  export function player_get_stats(keys: Array<string> | undefined, callback: ApiCallback): void;
51
65
 
52
66
  /**
53
- * @deprecated Use `player_get_unqiue_id` instead.
67
+ * @deprecated Use `player_get_unique_id` instead.
54
68
  */
55
69
  export function player_get_id(): string;
56
70
 
@@ -66,6 +80,24 @@ declare module 'yagames.yagames' {
66
80
 
67
81
  export function player_get_photo(size: 'small' | 'medium' | 'large'): string;
68
82
 
83
+ export function player_get_paying_status(): 'paying' | 'partially_paying' | 'not_paying' | 'unknown';
84
+
85
+ /**
86
+ * Upstream types the result as "table or nil" and publishes no field list for the
87
+ * SDK's `_personalInfo` object, so the shape stays open rather than invented.
88
+ */
89
+ export type PlayerPersonalInfo = Record<string, unknown>;
90
+ export function player_get_personal_info(): PlayerPersonalInfo | undefined;
91
+
92
+ export function player_get_signature(): string | undefined;
93
+
94
+ /**
95
+ * @deprecated Use `player_is_authorized` instead.
96
+ */
97
+ export function player_get_mode(): 'lite' | '';
98
+
99
+ export function player_is_authorized(): boolean;
100
+
69
101
  //* In-Game Purchases
70
102
 
71
103
  export function payments_init(options: { signed?: boolean } | undefined, callback: ApiCallback): void;
@@ -101,12 +133,19 @@ declare module 'yagames.yagames' {
101
133
  priceValue: string;
102
134
  priceCurrencyCode: string;
103
135
  }>) => void;
104
- export function payments_get_catalog(callback: PaymentsCatalogCallback): void;
136
+ export interface PaymentsCatalogOptions {
137
+ getPriceCurrencyImage?: 'medium' | 'small' | 'svg';
138
+ }
139
+ export function payments_get_catalog(options: PaymentsCatalogOptions | undefined, callback: PaymentsCatalogCallback): void;
105
140
 
106
141
  export function payments_consume_purchase(purchase_token: string, callback: ApiCallback): void;
107
142
 
108
143
  //* Leaderboards
109
144
 
145
+ /**
146
+ * @deprecated The leaderboards subsystem no longer needs initializing; the other
147
+ * `leaderboards_*` functions work without it.
148
+ */
110
149
  export function leaderboards_init(callback: ApiCallback): void;
111
150
 
112
151
  export type LeaderboardsDescriptionCallback = (ctx: Context, err?: string, data?: {
@@ -177,6 +216,33 @@ declare module 'yagames.yagames' {
177
216
 
178
217
  export function leaderboards_set_score(leaderboard_name: string, score: number, extra_data: string, callback: ApiCallback): void;
179
218
 
219
+ //* Features
220
+
221
+ export function features_loadingapi_ready(): void;
222
+
223
+ export function features_gameplayapi_start(): void;
224
+
225
+ export function features_gameplayapi_stop(): void;
226
+
227
+ export interface GamesApiGame {
228
+ appID: string;
229
+ title: string;
230
+ url: string;
231
+ coverURL: string;
232
+ iconURL: string;
233
+ }
234
+ export type GamesApiAllGamesCallback = (ctx: Context, err?: string, result?: {
235
+ games: Array<GamesApiGame>;
236
+ developerURL: string;
237
+ }) => void;
238
+ export function features_gamesapi_get_all_games(callback: GamesApiAllGamesCallback): void;
239
+
240
+ export type GamesApiGameByIdCallback = (ctx: Context, err?: string, result?: {
241
+ isAvailable: boolean;
242
+ game?: GamesApiGame;
243
+ }) => void;
244
+ export function features_gamesapi_get_game_by_id(app_id: number, callback: GamesApiGameByIdCallback): void;
245
+
180
246
  //* Feedback
181
247
 
182
248
  export type FeedbackCanReviewCallback = (ctx: Context, err?: string, data?: {
@@ -204,6 +270,8 @@ declare module 'yagames.yagames' {
204
270
 
205
271
  export function device_info_is_tablet(): boolean;
206
272
 
273
+ export function device_info_is_tv(): boolean;
274
+
207
275
  //* Environment
208
276
 
209
277
  export interface EnvironmentResults {
@@ -229,6 +297,18 @@ declare module 'yagames.yagames' {
229
297
 
230
298
  export function screen_fullscreen_exit(callback?: ApiCallback): void;
231
299
 
300
+ //* Shortcuts
301
+
302
+ export type ShortcutCanShowCallback = (ctx: Context, err?: string, result?: {
303
+ canShow: boolean;
304
+ }) => void;
305
+ export function shortcut_can_show_prompt(callback: ShortcutCanShowCallback): void;
306
+
307
+ export type ShortcutShowPromptCallback = (ctx: Context, err?: string, result?: {
308
+ outcome: string;
309
+ }) => void;
310
+ export function shortcut_show_prompt(callback?: ShortcutShowPromptCallback): void;
311
+
232
312
  //* Safe Storage
233
313
 
234
314
  export function storage_init(callback: ApiCallback): void;
@@ -245,35 +325,77 @@ declare module 'yagames.yagames' {
245
325
 
246
326
  export function storage_length(): number;
247
327
 
248
- //* Banner Ads
328
+ //* Remote Config
329
+
330
+ export interface FlagsClientFeature {
331
+ name: string;
332
+ value: string;
333
+ }
334
+ export interface FlagsOptions {
335
+ defaultFlags?: Record<string, string>;
336
+ clientFeatures?: Array<FlagsClientFeature>;
337
+ }
338
+ export type FlagsCallback = (ctx: Context, err?: string, flags?: Record<string, string>) => void;
339
+ export function flags_get(options: FlagsOptions | undefined, callback: FlagsCallback): void;
340
+
341
+ //* Events
249
342
 
250
- export function banner_init(callback: ApiCallback): void;
343
+ export function event_on(event_name: string, listener: ApiCallback): void;
251
344
 
252
- export interface BannerCreateOptions {
253
- stat_id?: number;
254
- css_styles?: string;
255
- css_class?: string;
256
- display?: "none" | "block";
345
+ export function event_off(event_name: string, listener: ApiCallback): void;
346
+
347
+ export function event_dispatch(event_name: string): void;
348
+
349
+ //* Multiplayer Sessions
350
+
351
+ export interface MultiplayerSessionsMetaRange {
352
+ min: number;
353
+ max: number;
257
354
  }
258
- export type BannerCreateCallback = (ctx: Context, err?: string, data?: {
259
- product: "direct" | "rtb";
260
- }) => void;
261
- export function banner_create(rtb_id: string, options: BannerCreateOptions, callback?: BannerCreateCallback): void;
262
-
263
- export function banner_delete(rtb_id: string): void;
264
-
265
- export function banner_refresh(rtb_id: string, callback?: BannerCreateCallback): void;
266
-
267
- export function banner_set(rtb_id: string, property: "stat_id" | "css_styles" | "css_class" | "display", value: string): void;
355
+ export interface MultiplayerSessionsMeta {
356
+ meta1?: MultiplayerSessionsMetaRange;
357
+ meta2?: MultiplayerSessionsMetaRange;
358
+ meta3?: MultiplayerSessionsMetaRange;
359
+ }
360
+ export interface MultiplayerSessionsInitOptions {
361
+ count: number;
362
+ isEventBased: boolean;
363
+ maxOpponentTurnTime?: number;
364
+ meta: MultiplayerSessionsMeta;
365
+ }
366
+ export interface MultiplayerSessionEvent {
367
+ id: string;
368
+ payload: Record<string, unknown>;
369
+ time: number;
370
+ }
371
+ export interface MultiplayerSession {
372
+ id: string;
373
+ meta1?: number;
374
+ meta2?: number;
375
+ meta3?: number;
376
+ player: {
377
+ avatar: string;
378
+ name: string;
379
+ }
380
+ timeline: Array<MultiplayerSessionEvent>;
381
+ }
382
+ export type MultiplayerSessionsInitCallback = (ctx: Context, err?: string, result?: Array<MultiplayerSession>) => void;
383
+ export function multiplayer_sessions_init(options: MultiplayerSessionsInitOptions, callback: MultiplayerSessionsInitCallback): void;
268
384
 
269
- //* Sitelock
270
-
271
- export function add_domain(domain: string): void;
272
-
273
- export function verify_domain(): boolean;
274
-
275
- export function get_current_domain(): string;
276
-
277
- export function is_release_build(): boolean;
385
+ export function multiplayer_sessions_commit(data: Record<string, unknown>): void;
386
+
387
+ export interface MultiplayerSessionsPushMeta {
388
+ meta1?: number;
389
+ meta2?: number;
390
+ meta3?: number;
391
+ }
392
+ export function multiplayer_sessions_push(data: MultiplayerSessionsPushMeta): void;
393
+
394
+ //* Miscellaneous
395
+
396
+ export type AvailableMethodCallback = (ctx: Context, err?: string, result?: boolean) => void;
397
+ export function is_available_method(name: string, callback: AvailableMethodCallback): void;
398
+
399
+ export function server_time(): number;
278
400
 
279
401
  }
@@ -10,11 +10,18 @@ type ZzFXSample = LuaUserdata & {
10
10
  * @noResolution
11
11
  */
12
12
  declare module 'zzfx.api' {
13
+ /**
14
+ * Build a sample from a ZzFX parameter list and play it in one call.
15
+ * @see {@link https://killedbyapixel.github.io/ZzFX/|the ZzFX sound designer}
16
+ */
13
17
  export function play(...args: number[]): void;
14
18
 
19
+ /** Set the sample rate used to render subsequent samples. Defaults to 44100. */
15
20
  export function samplerate(rate: number): void;
16
21
 
22
+ /** Play a sample previously returned by {@link build_sample}. */
17
23
  export function play_sample(sample: ZzFXSample): void;
18
24
 
25
+ /** Build a reusable sample from a ZzFX parameter list, without playing it. */
19
26
  export function build_sample(...args: number[]): ZzFXSample;
20
27
  }
@@ -27,20 +27,6 @@
27
27
  "lua_script_instance"
28
28
  ]
29
29
  },
30
- {
31
- "dir": "boom",
32
- "classification": "already-vendored",
33
- "modules": [
34
- "boom.boom"
35
- ]
36
- },
37
- {
38
- "dir": "bzAnim",
39
- "classification": "already-vendored",
40
- "modules": [
41
- "bzAnim.bzAnim"
42
- ]
43
- },
44
30
  {
45
31
  "dir": "def-setv",
46
32
  "classification": "native",
@@ -62,20 +48,6 @@
62
48
  "taptic_engine"
63
49
  ]
64
50
  },
65
- {
66
- "dir": "defcon",
67
- "classification": "already-vendored",
68
- "modules": [
69
- "defcon.console"
70
- ]
71
- },
72
- {
73
- "dir": "defmath",
74
- "classification": "already-vendored",
75
- "modules": [
76
- "defmath.defmath"
77
- ]
78
- },
79
51
  {
80
52
  "dir": "defold-apkx",
81
53
  "classification": "native",
@@ -118,22 +90,6 @@
118
90
  "imagepicker"
119
91
  ]
120
92
  },
121
- {
122
- "dir": "defold-input",
123
- "classification": "already-vendored",
124
- "modules": [
125
- "in.accelerometer",
126
- "in.button",
127
- "in.cursor",
128
- "in.gesture",
129
- "in.keyboard",
130
- "in.mapper",
131
- "in.onscreen",
132
- "in.state",
133
- "in.textbox",
134
- "in.triggers"
135
- ]
136
- },
137
93
  {
138
94
  "dir": "defold-lfs",
139
95
  "classification": "native",
@@ -148,21 +104,6 @@
148
104
  "lldebugger.debug"
149
105
  ]
150
106
  },
151
- {
152
- "dir": "defold-metrics",
153
- "classification": "already-vendored",
154
- "modules": [
155
- "metrics.fps",
156
- "metrics.mem"
157
- ]
158
- },
159
- {
160
- "dir": "defold-orthographic",
161
- "classification": "already-vendored",
162
- "modules": [
163
- "orthographic.camera"
164
- ]
165
- },
166
107
  {
167
108
  "dir": "defold-playable-ads",
168
109
  "classification": "native",
@@ -191,15 +132,6 @@
191
132
  "rnd"
192
133
  ]
193
134
  },
194
- {
195
- "dir": "defold-richtext",
196
- "classification": "already-vendored",
197
- "modules": [
198
- "richtext.color",
199
- "richtext.richtext",
200
- "richtext.tags"
201
- ]
202
- },
203
135
  {
204
136
  "dir": "defold-scene3d",
205
137
  "classification": "native",
@@ -277,13 +209,6 @@
277
209
  "xmath"
278
210
  ]
279
211
  },
280
- {
281
- "dir": "defold-yagames",
282
- "classification": "already-vendored",
283
- "modules": [
284
- "yagames.yagames"
285
- ]
286
- },
287
212
  {
288
213
  "dir": "defold-yametrica",
289
214
  "classification": "native",
@@ -305,13 +230,6 @@
305
230
  "zstd"
306
231
  ]
307
232
  },
308
- {
309
- "dir": "defold-zzfx",
310
- "classification": "already-vendored",
311
- "modules": [
312
- "zzfx.api"
313
- ]
314
- },
315
233
  {
316
234
  "dir": "defos",
317
235
  "classification": "native",
@@ -319,27 +237,6 @@
319
237
  "defos"
320
238
  ]
321
239
  },
322
- {
323
- "dir": "defsave",
324
- "classification": "already-vendored",
325
- "modules": [
326
- "defsave.defsave"
327
- ]
328
- },
329
- {
330
- "dir": "deftest",
331
- "classification": "already-vendored",
332
- "modules": [
333
- "deftest.deftest"
334
- ]
335
- },
336
- {
337
- "dir": "dicebag",
338
- "classification": "already-vendored",
339
- "modules": [
340
- "dicebag.dicebag"
341
- ]
342
- },
343
240
  {
344
241
  "dir": "drawpixels",
345
242
  "classification": "native",
@@ -591,65 +488,12 @@
591
488
  "classification": "native",
592
489
  "modules": []
593
490
  },
594
- {
595
- "dir": "gooey",
596
- "classification": "already-vendored",
597
- "modules": [
598
- "gooey.gooey"
599
- ]
600
- },
601
491
  {
602
492
  "dir": "jstodef",
603
493
  "classification": "native",
604
494
  "modules": [
605
495
  "jstodef"
606
496
  ]
607
- },
608
- {
609
- "dir": "library-defold-persist",
610
- "classification": "already-vendored",
611
- "modules": [
612
- "persist.persist"
613
- ]
614
- },
615
- {
616
- "dir": "library-defold-rendy",
617
- "classification": "already-vendored",
618
- "modules": [
619
- "rendy.rendy"
620
- ]
621
- },
622
- {
623
- "dir": "monarch",
624
- "classification": "already-vendored",
625
- "modules": [
626
- "monarch.monarch",
627
- "monarch.transitions.easings",
628
- "monarch.transitions.gui"
629
- ]
630
- },
631
- {
632
- "dir": "nakama-defold",
633
- "classification": "already-vendored",
634
- "modules": [
635
- "nakama.engine.defold",
636
- "nakama.nakama",
637
- "nakama.util.log"
638
- ]
639
- },
640
- {
641
- "dir": "platypus",
642
- "classification": "already-vendored",
643
- "modules": [
644
- "platypus.platypus"
645
- ]
646
- },
647
- {
648
- "dir": "starly",
649
- "classification": "already-vendored",
650
- "modules": [
651
- "starly.starly"
652
- ]
653
497
  }
654
498
  ]
655
499
  }