@defold-typescript/library-types 0.22.0 → 0.23.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 (56) hide show
  1. package/api-doc/{bridge.bridge.json → bridge.json} +749 -844
  2. package/api-doc/decore.json +22 -22
  3. package/api-doc/druid.json +195 -1790
  4. package/api-doc/event.json +1074 -0
  5. package/api-doc/immutable.json +65 -0
  6. package/api-doc/lang.json +528 -0
  7. package/api-doc/{event.event.json → log.json} +96 -101
  8. package/api-doc/narrator.json +647 -0
  9. package/api-doc/proto.json +995 -0
  10. package/api-doc/saver.saver.json +713 -263
  11. package/api-doc/saver.storage.json +282 -52
  12. package/api-doc/squid.json +846 -0
  13. package/api-doc/tweener.json +277 -0
  14. package/generated/bridge.d.ts +468 -0
  15. package/generated/decore.d.ts +36 -36
  16. package/generated/druid.d.ts +137 -443
  17. package/generated/event.d.ts +318 -0
  18. package/generated/immutable.d.ts +13 -0
  19. package/generated/lang.d.ts +101 -0
  20. package/generated/log.d.ts +36 -0
  21. package/generated/narrator.d.ts +121 -0
  22. package/generated/proto.d.ts +146 -0
  23. package/generated/saver.saver.d.ts +287 -42
  24. package/generated/saver.storage.d.ts +77 -14
  25. package/generated/squid.d.ts +127 -0
  26. package/generated/tweener.d.ts +42 -0
  27. package/library-classification.json +0 -71
  28. package/library-targets.json +0 -66
  29. package/luals-targets.json +114 -0
  30. package/package.json +4 -33
  31. package/script-api-targets.json +15 -0
  32. package/scripts/__snapshots__/parse-luals.test.ts.snap +340 -75
  33. package/scripts/apply-luals-overrides.ts +63 -0
  34. package/scripts/emit-library-dts.ts +84 -3
  35. package/scripts/lower-api-doc.ts +48 -16
  36. package/scripts/luals-fidelity.ts +7 -0
  37. package/scripts/map-luals-types.ts +34 -1
  38. package/scripts/parse-luals.ts +423 -18
  39. package/scripts/sync-luals-types.ts +15 -1
  40. package/scripts/sync-script-api-types.ts +368 -0
  41. package/api-doc/immutable.immutable.json +0 -63
  42. package/api-doc/lang.lang.json +0 -411
  43. package/api-doc/log.log.json +0 -50
  44. package/api-doc/narrator.narrator.json +0 -150
  45. package/api-doc/proto.proto.json +0 -355
  46. package/api-doc/squid.squid.json +0 -660
  47. package/api-doc/tweener.tweener.json +0 -419
  48. package/generated/bridge.bridge.d.ts +0 -533
  49. package/generated/event.event.d.ts +0 -54
  50. package/generated/immutable.immutable.d.ts +0 -13
  51. package/generated/lang.lang.d.ts +0 -33
  52. package/generated/log.log.d.ts +0 -40
  53. package/generated/narrator.narrator.d.ts +0 -66
  54. package/generated/proto.proto.d.ts +0 -36
  55. package/generated/squid.squid.d.ts +0 -106
  56. package/generated/tweener.tweener.d.ts +0 -151
@@ -0,0 +1,647 @@
1
+ {
2
+ "info": {
3
+ "namespace": "narrator",
4
+ "brief": "",
5
+ "description": ""
6
+ },
7
+ "elements": [
8
+ {
9
+ "type": "FUNCTION",
10
+ "name": "parse_file",
11
+ "brief": "Parse a book from an Ink file\nUse it during development, but prefer already parsed and stored books in production\nRequires `lpeg` and `io`.",
12
+ "description": "Parse a book from an Ink file\nUse it during development, but prefer already parsed and stored books in production\nRequires `lpeg` and `io`.",
13
+ "parameters": [
14
+ {
15
+ "name": "path",
16
+ "doc": "",
17
+ "types": [
18
+ "string"
19
+ ],
20
+ "is_optional": "False",
21
+ "is_vararg": "False"
22
+ },
23
+ {
24
+ "name": "params",
25
+ "doc": "",
26
+ "types": [
27
+ "Narrator_ParsingParams | undefined"
28
+ ],
29
+ "is_optional": "True",
30
+ "is_vararg": "False"
31
+ }
32
+ ],
33
+ "returnvalues": [
34
+ {
35
+ "name": "",
36
+ "doc": "",
37
+ "types": [
38
+ "Narrator_Book"
39
+ ]
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "type": "FUNCTION",
45
+ "name": "parse_content",
46
+ "brief": "Parse a book from the ink content string\nUse it during development, but prefer already parsed and stored books in production\nRequires `lpeg`",
47
+ "description": "Parse a book from the ink content string\nUse it during development, but prefer already parsed and stored books in production\nRequires `lpeg`",
48
+ "parameters": [
49
+ {
50
+ "name": "content",
51
+ "doc": "",
52
+ "types": [
53
+ "string"
54
+ ],
55
+ "is_optional": "False",
56
+ "is_vararg": "False"
57
+ },
58
+ {
59
+ "name": "inclusions",
60
+ "doc": "",
61
+ "types": [
62
+ "string[]"
63
+ ],
64
+ "is_optional": "True",
65
+ "is_vararg": "False"
66
+ }
67
+ ],
68
+ "returnvalues": [
69
+ {
70
+ "name": "",
71
+ "doc": "",
72
+ "types": [
73
+ "Narrator_Book"
74
+ ]
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "type": "FUNCTION",
80
+ "name": "init_story",
81
+ "brief": "Init a story based on the book",
82
+ "description": "Init a story based on the book",
83
+ "parameters": [
84
+ {
85
+ "name": "book",
86
+ "doc": "",
87
+ "types": [
88
+ "Narrator_Book"
89
+ ],
90
+ "is_optional": "False",
91
+ "is_vararg": "False"
92
+ }
93
+ ],
94
+ "returnvalues": [
95
+ {
96
+ "name": "",
97
+ "doc": "",
98
+ "types": [
99
+ "Narrator_Story"
100
+ ]
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "type": "TYPEDEF",
106
+ "name": "Narrator_Book_Version",
107
+ "properties": [
108
+ {
109
+ "name": "engine",
110
+ "brief": "",
111
+ "description": "",
112
+ "types": [
113
+ "number"
114
+ ]
115
+ },
116
+ {
117
+ "name": "tree",
118
+ "brief": "",
119
+ "description": "",
120
+ "types": [
121
+ "number"
122
+ ]
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "type": "TYPEDEF",
128
+ "name": "Narrator_Book",
129
+ "properties": [
130
+ {
131
+ "name": "version",
132
+ "brief": "",
133
+ "description": "",
134
+ "types": [
135
+ "Narrator_Book_Version"
136
+ ]
137
+ },
138
+ {
139
+ "name": "inclusions",
140
+ "brief": "",
141
+ "description": "",
142
+ "types": [
143
+ "string[]"
144
+ ]
145
+ },
146
+ {
147
+ "name": "lists",
148
+ "brief": "",
149
+ "description": "",
150
+ "types": [
151
+ "LuaTable"
152
+ ]
153
+ },
154
+ {
155
+ "name": "constants",
156
+ "brief": "",
157
+ "description": "",
158
+ "types": [
159
+ "LuaTable"
160
+ ]
161
+ },
162
+ {
163
+ "name": "variables",
164
+ "brief": "",
165
+ "description": "",
166
+ "types": [
167
+ "LuaTable"
168
+ ]
169
+ },
170
+ {
171
+ "name": "params",
172
+ "brief": "",
173
+ "description": "",
174
+ "types": [
175
+ "LuaTable"
176
+ ]
177
+ },
178
+ {
179
+ "name": "tree",
180
+ "brief": "",
181
+ "description": "",
182
+ "types": [
183
+ "LuaTable"
184
+ ]
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "type": "TYPEDEF",
190
+ "name": "Narrator_ParsingParams",
191
+ "properties": [
192
+ {
193
+ "name": "save",
194
+ "brief": "Save a parsed book to the lua file",
195
+ "description": "Save a parsed book to the lua file",
196
+ "types": [
197
+ "boolean"
198
+ ]
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ "type": "TYPEDEF",
204
+ "name": "Narrator_Paragraph",
205
+ "properties": [
206
+ {
207
+ "name": "text",
208
+ "brief": "",
209
+ "description": "",
210
+ "types": [
211
+ "string"
212
+ ]
213
+ },
214
+ {
215
+ "name": "tags",
216
+ "brief": "",
217
+ "description": "",
218
+ "types": [
219
+ "string[] | undefined"
220
+ ]
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ "type": "TYPEDEF",
226
+ "name": "Narrator_Choice",
227
+ "properties": [
228
+ {
229
+ "name": "text",
230
+ "brief": "",
231
+ "description": "",
232
+ "types": [
233
+ "string"
234
+ ]
235
+ },
236
+ {
237
+ "name": "tags",
238
+ "brief": "",
239
+ "description": "",
240
+ "types": [
241
+ "string[] | undefined"
242
+ ]
243
+ }
244
+ ]
245
+ },
246
+ {
247
+ "type": "TYPEDEF",
248
+ "name": "Narrator_State",
249
+ "properties": [
250
+ {
251
+ "name": "version",
252
+ "brief": "",
253
+ "description": "",
254
+ "types": [
255
+ "number"
256
+ ]
257
+ },
258
+ {
259
+ "name": "temp",
260
+ "brief": "",
261
+ "description": "",
262
+ "types": [
263
+ "LuaTable"
264
+ ]
265
+ },
266
+ {
267
+ "name": "seeds",
268
+ "brief": "",
269
+ "description": "",
270
+ "types": [
271
+ "LuaTable"
272
+ ]
273
+ },
274
+ {
275
+ "name": "variables",
276
+ "brief": "",
277
+ "description": "",
278
+ "types": [
279
+ "LuaTable"
280
+ ]
281
+ },
282
+ {
283
+ "name": "params",
284
+ "brief": "",
285
+ "description": "",
286
+ "types": [
287
+ "LuaTable | undefined"
288
+ ]
289
+ },
290
+ {
291
+ "name": "visits",
292
+ "brief": "",
293
+ "description": "",
294
+ "types": [
295
+ "LuaTable"
296
+ ]
297
+ },
298
+ {
299
+ "name": "current_path",
300
+ "brief": "",
301
+ "description": "",
302
+ "types": [
303
+ "LuaTable"
304
+ ]
305
+ },
306
+ {
307
+ "name": "paragraphs",
308
+ "brief": "",
309
+ "description": "",
310
+ "types": [
311
+ "LuaTable"
312
+ ]
313
+ },
314
+ {
315
+ "name": "choices",
316
+ "brief": "",
317
+ "description": "",
318
+ "types": [
319
+ "LuaTable"
320
+ ]
321
+ },
322
+ {
323
+ "name": "output",
324
+ "brief": "",
325
+ "description": "",
326
+ "types": [
327
+ "LuaTable"
328
+ ]
329
+ },
330
+ {
331
+ "name": "tunnels",
332
+ "brief": "",
333
+ "description": "",
334
+ "types": [
335
+ "LuaTable | undefined"
336
+ ]
337
+ },
338
+ {
339
+ "name": "path",
340
+ "brief": "",
341
+ "description": "",
342
+ "types": [
343
+ "LuaTable"
344
+ ]
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "type": "TYPEDEF",
350
+ "name": "Narrator_Story",
351
+ "functions": [
352
+ {
353
+ "type": "FUNCTION",
354
+ "name": "begin",
355
+ "brief": "Start a story\nGenerate the first chunk of paragraphs and choices",
356
+ "description": "Start a story\nGenerate the first chunk of paragraphs and choices",
357
+ "parameters": [],
358
+ "returnvalues": []
359
+ },
360
+ {
361
+ "type": "FUNCTION",
362
+ "name": "can_continue",
363
+ "brief": "Does the story have paragraphs to output or not",
364
+ "description": "Does the story have paragraphs to output or not",
365
+ "parameters": [],
366
+ "returnvalues": [
367
+ {
368
+ "name": "",
369
+ "doc": "",
370
+ "types": [
371
+ "boolean"
372
+ ]
373
+ }
374
+ ]
375
+ },
376
+ {
377
+ "type": "FUNCTION",
378
+ "name": "continue",
379
+ "brief": "Pull the current paragraphs from the queue.",
380
+ "description": "Pull the current paragraphs from the queue.",
381
+ "parameters": [
382
+ {
383
+ "name": "steps",
384
+ "doc": "Count of paragraphs to pull",
385
+ "types": [
386
+ "number | undefined"
387
+ ],
388
+ "is_optional": "True",
389
+ "is_vararg": "False"
390
+ }
391
+ ],
392
+ "returnvalues": [
393
+ {
394
+ "name": "",
395
+ "doc": "",
396
+ "types": [
397
+ "Narrator_Paragraph[] | Narrator_Paragraph"
398
+ ]
399
+ }
400
+ ]
401
+ },
402
+ {
403
+ "type": "FUNCTION",
404
+ "name": "can_choose",
405
+ "brief": "Does the story have choices to output or not.\nAlso returns false if there are available paragraphs to continue.",
406
+ "description": "Does the story have choices to output or not.\nAlso returns false if there are available paragraphs to continue.",
407
+ "parameters": [],
408
+ "returnvalues": [
409
+ {
410
+ "name": "",
411
+ "doc": "",
412
+ "types": [
413
+ "boolean"
414
+ ]
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "type": "FUNCTION",
420
+ "name": "get_choices",
421
+ "brief": "Returns an array of available choice titles.\nAlso returns an empty array if there are available paragraphs to continue.",
422
+ "description": "Returns an array of available choice titles.\nAlso returns an empty array if there are available paragraphs to continue.",
423
+ "parameters": [],
424
+ "returnvalues": [
425
+ {
426
+ "name": "",
427
+ "doc": "",
428
+ "types": [
429
+ "Narrator_Choice[]"
430
+ ]
431
+ }
432
+ ]
433
+ },
434
+ {
435
+ "type": "FUNCTION",
436
+ "name": "choose",
437
+ "brief": "Make a choice to continue the story.",
438
+ "description": "Make a choice to continue the story.",
439
+ "parameters": [
440
+ {
441
+ "name": "index",
442
+ "doc": "an index of the choice",
443
+ "types": [
444
+ "number"
445
+ ],
446
+ "is_optional": "False",
447
+ "is_vararg": "False"
448
+ }
449
+ ],
450
+ "returnvalues": []
451
+ },
452
+ {
453
+ "type": "FUNCTION",
454
+ "name": "jump_to",
455
+ "brief": "Jump to the path",
456
+ "description": "Jump to the path",
457
+ "parameters": [
458
+ {
459
+ "name": "path_string",
460
+ "doc": "a path string like 'knot.stitch.label'",
461
+ "types": [
462
+ "string"
463
+ ],
464
+ "is_optional": "False",
465
+ "is_vararg": "False"
466
+ }
467
+ ],
468
+ "returnvalues": []
469
+ },
470
+ {
471
+ "type": "FUNCTION",
472
+ "name": "get_visits",
473
+ "brief": "Get the number of visits for the path.",
474
+ "description": "Get the number of visits for the path.",
475
+ "parameters": [
476
+ {
477
+ "name": "path_string",
478
+ "doc": "a path string like 'knot.stitch.label'",
479
+ "types": [
480
+ "string"
481
+ ],
482
+ "is_optional": "False",
483
+ "is_vararg": "False"
484
+ }
485
+ ],
486
+ "returnvalues": [
487
+ {
488
+ "name": "",
489
+ "doc": "",
490
+ "types": [
491
+ "number"
492
+ ]
493
+ }
494
+ ]
495
+ },
496
+ {
497
+ "type": "FUNCTION",
498
+ "name": "get_tags",
499
+ "brief": "Get tags for the path",
500
+ "description": "Get tags for the path",
501
+ "parameters": [
502
+ {
503
+ "name": "path_string",
504
+ "doc": "a path string with knot or stitch",
505
+ "types": [
506
+ "string | undefined"
507
+ ],
508
+ "is_optional": "True",
509
+ "is_vararg": "False"
510
+ }
511
+ ],
512
+ "returnvalues": [
513
+ {
514
+ "name": "",
515
+ "doc": "",
516
+ "types": [
517
+ "string[]"
518
+ ]
519
+ }
520
+ ]
521
+ },
522
+ {
523
+ "type": "FUNCTION",
524
+ "name": "save_state",
525
+ "brief": "Creates a table with the story state that can be saved and loaded later.\nUse it to save the game.",
526
+ "description": "Creates a table with the story state that can be saved and loaded later.\nUse it to save the game.",
527
+ "parameters": [],
528
+ "returnvalues": [
529
+ {
530
+ "name": "",
531
+ "doc": "",
532
+ "types": [
533
+ "Narrator_State"
534
+ ]
535
+ }
536
+ ]
537
+ },
538
+ {
539
+ "type": "FUNCTION",
540
+ "name": "load_state",
541
+ "brief": "Restore the story state from the saved state.\nUse it to load the game.",
542
+ "description": "Restore the story state from the saved state.\nUse it to load the game.",
543
+ "parameters": [
544
+ {
545
+ "name": "state",
546
+ "doc": "",
547
+ "types": [
548
+ "Narrator_State"
549
+ ],
550
+ "is_optional": "False",
551
+ "is_vararg": "False"
552
+ }
553
+ ],
554
+ "returnvalues": []
555
+ },
556
+ {
557
+ "type": "FUNCTION",
558
+ "name": "observe",
559
+ "brief": "Assign an observer function to the variable's changes.",
560
+ "description": "Assign an observer function to the variable's changes.",
561
+ "parameters": [
562
+ {
563
+ "name": "variable",
564
+ "doc": "",
565
+ "types": [
566
+ "string"
567
+ ],
568
+ "is_optional": "False",
569
+ "is_vararg": "False"
570
+ },
571
+ {
572
+ "name": "observer",
573
+ "doc": "",
574
+ "types": [
575
+ "(variable: unknown) => void"
576
+ ],
577
+ "is_optional": "False",
578
+ "is_vararg": "False"
579
+ }
580
+ ],
581
+ "returnvalues": []
582
+ },
583
+ {
584
+ "type": "FUNCTION",
585
+ "name": "bind",
586
+ "brief": "Bind a function to external calling from the Ink.\nThe function can returns the value or not.",
587
+ "description": "Bind a function to external calling from the Ink.\nThe function can returns the value or not.",
588
+ "parameters": [
589
+ {
590
+ "name": "func_name",
591
+ "doc": "",
592
+ "types": [
593
+ "string"
594
+ ],
595
+ "is_optional": "False",
596
+ "is_vararg": "False"
597
+ },
598
+ {
599
+ "name": "handler",
600
+ "doc": "",
601
+ "types": [
602
+ "(...args: unknown[]) => unknown"
603
+ ],
604
+ "is_optional": "False",
605
+ "is_vararg": "False"
606
+ }
607
+ ],
608
+ "returnvalues": []
609
+ }
610
+ ],
611
+ "properties": [
612
+ {
613
+ "name": "global_tags",
614
+ "brief": "",
615
+ "description": "",
616
+ "types": [
617
+ "string[]"
618
+ ]
619
+ },
620
+ {
621
+ "name": "constants",
622
+ "brief": "",
623
+ "description": "",
624
+ "types": [
625
+ "LuaTable<string, unknown>"
626
+ ]
627
+ },
628
+ {
629
+ "name": "variables",
630
+ "brief": "",
631
+ "description": "",
632
+ "types": [
633
+ "LuaTable<string, unknown>"
634
+ ]
635
+ },
636
+ {
637
+ "name": "migrate",
638
+ "brief": "",
639
+ "description": "",
640
+ "types": [
641
+ "(state: Narrator_State, old_version: number, new_version: number) => Narrator_State"
642
+ ]
643
+ }
644
+ ]
645
+ }
646
+ ]
647
+ }