xray16 1.5.4 → 1.6.1

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 (55) hide show
  1. package/README.md +6 -0
  2. package/package.json +12 -6
  3. package/plugins/optimize_return_ternary.d.ts +6 -0
  4. package/plugins/optimize_return_ternary.js +65 -0
  5. package/xray16.d.ts +30847 -0
  6. package/types/index.d.ts +0 -55
  7. package/types/xr_ai/xr_action.d.ts +0 -1802
  8. package/types/xr_ai/xr_alife.d.ts +0 -1870
  9. package/types/xr_ai/xr_enemy_evaluation.d.ts +0 -134
  10. package/types/xr_ai/xr_goap.d.ts +0 -1116
  11. package/types/xr_ai/xr_graph.d.ts +0 -135
  12. package/types/xr_ai/xr_memory.d.ts +0 -382
  13. package/types/xr_lib/xr_animation.d.ts +0 -252
  14. package/types/xr_lib/xr_bitwise.d.ts +0 -44
  15. package/types/xr_lib/xr_color.d.ts +0 -142
  16. package/types/xr_lib/xr_debug.d.ts +0 -181
  17. package/types/xr_lib/xr_dialog.d.ts +0 -132
  18. package/types/xr_lib/xr_flags.d.ts +0 -592
  19. package/types/xr_lib/xr_fs.d.ts +0 -615
  20. package/types/xr_lib/xr_game.d.ts +0 -362
  21. package/types/xr_lib/xr_hit.d.ts +0 -125
  22. package/types/xr_lib/xr_ini.d.ts +0 -473
  23. package/types/xr_lib/xr_level.d.ts +0 -795
  24. package/types/xr_lib/xr_luabind.d.ts +0 -90
  25. package/types/xr_lib/xr_map.d.ts +0 -192
  26. package/types/xr_lib/xr_math.d.ts +0 -871
  27. package/types/xr_lib/xr_multiplayer.d.ts +0 -1079
  28. package/types/xr_lib/xr_profile.d.ts +0 -272
  29. package/types/xr_lib/xr_properties.d.ts +0 -610
  30. package/types/xr_lib/xr_relation.d.ts +0 -231
  31. package/types/xr_lib/xr_render.d.ts +0 -167
  32. package/types/xr_lib/xr_save.d.ts +0 -833
  33. package/types/xr_lib/xr_sound.d.ts +0 -515
  34. package/types/xr_lib/xr_stats.ts +0 -49
  35. package/types/xr_lib/xr_task.d.ts +0 -388
  36. package/types/xr_lib/xr_time.d.ts +0 -177
  37. package/types/xr_lib/xr_type.d.ts +0 -75
  38. package/types/xr_object/client/xr_anomaly.d.ts +0 -70
  39. package/types/xr_object/client/xr_artefact.d.ts +0 -153
  40. package/types/xr_object/client/xr_client_object.d.ts +0 -207
  41. package/types/xr_object/client/xr_creature.d.ts +0 -243
  42. package/types/xr_object/client/xr_item.d.ts +0 -370
  43. package/types/xr_object/client/xr_level.d.ts +0 -753
  44. package/types/xr_object/client/xr_physic.d.ts +0 -644
  45. package/types/xr_object/client/xr_zone.d.ts +0 -85
  46. package/types/xr_object/script/xr_script_interface.d.ts +0 -819
  47. package/types/xr_object/script/xr_script_object.d.ts +0 -5719
  48. package/types/xr_object/script/xr_script_trade.d.ts +0 -51
  49. package/types/xr_object/server/xr_server_object.d.ts +0 -1486
  50. package/types/xr_ui/xr_ui_asset.d.ts +0 -364
  51. package/types/xr_ui/xr_ui_core.d.ts +0 -424
  52. package/types/xr_ui/xr_ui_event.d.ts +0 -1449
  53. package/types/xr_ui/xr_ui_interface.d.ts +0 -2447
  54. package/types/xr_ui/xr_ui_menu.d.ts +0 -385
  55. package/types/xrf_plugin.d.ts +0 -109
@@ -1,833 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Network client identifier.
4
- *
5
- * @source C++ class ClientID
6
- * @customConstructor ClientID
7
- * @group xr_save
8
- *
9
- * @remarks
10
- * `0xffffffff` is used by the engine as broadcast client id in network code.
11
- */
12
- export class ClientID extends EngineBinding {
13
- /**
14
- * Create an empty client id.
15
- */
16
- public constructor();
17
-
18
- /**
19
- * Get raw client id value.
20
- *
21
- * @returns Client id value.
22
- */
23
- public value(): u32;
24
-
25
- /**
26
- * Set raw client id value.
27
- *
28
- * @param value - Client id value.
29
- */
30
- public set(value: u32): void;
31
- }
32
-
33
- /**
34
- * Read/write network packet used by server entities and events.
35
- *
36
- * Reading methods advance the read cursor. Writing methods append to the packet unless the method name says
37
- * otherwise.
38
- *
39
- * @source C++ class net_packet
40
- * @customConstructor net_packet
41
- * @group xr_save
42
- *
43
- * @remarks
44
- * Packet reads are positional. Use `r_tell`, `r_seek`, `r_elapsed`, and `r_eof` when reading mixed payloads.
45
- * Native packets are capped at 16 KB and assert on read/write overruns.
46
- */
47
- export class net_packet {
48
- /**
49
- * Create an empty packet.
50
- */
51
- public constructor();
52
-
53
- /**
54
- * Advance the read cursor.
55
- *
56
- * @remarks
57
- * Does not read skipped bytes. Native code verifies that the new cursor stays inside the packet.
58
- *
59
- * @param size - Number of bytes to skip.
60
- */
61
- public r_advance(size: u32): void;
62
-
63
- /**
64
- * Read a 16-bit compressed angle into a placeholder.
65
- *
66
- * @remarks
67
- * Angles use the same `0..2 * PI` range as {@link w_angle16}.
68
- *
69
- * @param value - Output placeholder.
70
- */
71
- public r_angle16(value: f32): void;
72
-
73
- /**
74
- * Read an 8-bit compressed angle into a placeholder.
75
- *
76
- * @remarks
77
- * Angles use the same `0..2 * PI` range as {@link w_angle8}.
78
- *
79
- * @param value - Output placeholder.
80
- */
81
- public r_angle8(value: f32): void;
82
-
83
- /**
84
- * Read packet message header.
85
- *
86
- * @remarks
87
- * Resets the read cursor to the packet start before reading the message type.
88
- *
89
- * @param type - Output placeholder for message type.
90
- * @returns Packet receive time.
91
- */
92
- public r_begin(type: u16): u32;
93
-
94
- /**
95
- * Read boolean value.
96
- *
97
- * @remarks
98
- * Booleans are serialized as one byte.
99
- *
100
- * @returns Boolean value.
101
- */
102
- public r_bool(): boolean;
103
-
104
- /**
105
- * Read client id.
106
- *
107
- * @returns Client id.
108
- */
109
- public r_clientID(): ClientID;
110
-
111
- /**
112
- * Read a compressed direction vector.
113
- *
114
- * @param vector - Vector to fill.
115
- */
116
- public r_dir(vector: vector): void;
117
-
118
- /**
119
- * Get unread byte count.
120
- *
121
- * @returns Remaining bytes.
122
- */
123
- public r_elapsed(): u32;
124
-
125
- /**
126
- * Check whether the read cursor reached the end.
127
- *
128
- * @returns Whether packet is fully read.
129
- */
130
- public r_eof(): boolean;
131
-
132
- /**
133
- * Read float value.
134
- *
135
- * @returns Float value.
136
- */
137
- public r_float(): f32;
138
-
139
- /**
140
- * Read float value through a Lua-style placeholder overload.
141
- *
142
- * @param value - Placeholder value.
143
- * @returns Float value.
144
- */
145
- public r_float(value: f32): f32;
146
-
147
- /**
148
- * Read a 16-bit quantized float.
149
- *
150
- * @remarks
151
- * Use the same `min` and `max` that were used when writing the value.
152
- *
153
- * @param min - Minimum decoded value.
154
- * @param max - Maximum decoded value.
155
- * @param value - Placeholder value.
156
- * @returns Decoded float.
157
- */
158
- public r_float_q16(min: f32, max: f32, value: f32): f32;
159
-
160
- /**
161
- * Read an 8-bit quantized float.
162
- *
163
- * @remarks
164
- * Use the same `min` and `max` that were used when writing the value.
165
- *
166
- * @param min - Minimum decoded value.
167
- * @param max - Maximum decoded value.
168
- * @param value - Placeholder value.
169
- * @returns Decoded float.
170
- */
171
- public r_float_q8(min: f32, max: f32, value: f32): f32;
172
-
173
- /**
174
- * Read matrix data.
175
- *
176
- * @param matrix - Matrix to fill.
177
- * @returns Filled matrix.
178
- */
179
- public r_matrix(matrix: matrix): matrix;
180
-
181
- /**
182
- * Read signed 16-bit integer.
183
- *
184
- * @returns Signed 16-bit integer.
185
- */
186
- public r_s16(): i16;
187
-
188
- /**
189
- * Read signed 16-bit integer through a placeholder overload.
190
- *
191
- * @param value - Placeholder value.
192
- * @returns Signed 16-bit integer.
193
- */
194
- public r_s16(value: u16): u16;
195
-
196
- /**
197
- * Read signed 32-bit integer.
198
- *
199
- * @returns Signed 32-bit integer.
200
- */
201
- public r_s32(): i32;
202
-
203
- /**
204
- * Read signed 32-bit integer through a placeholder overload.
205
- *
206
- * @param value - Placeholder value.
207
- * @returns Signed 32-bit integer.
208
- */
209
- public r_s32(value: i32): i32;
210
-
211
- /**
212
- * Read signed 64-bit integer.
213
- *
214
- * @returns Signed 64-bit integer.
215
- */
216
- public r_s64(): i64;
217
-
218
- /**
219
- * Read signed 64-bit integer through a placeholder overload.
220
- *
221
- * @param value - Placeholder value.
222
- * @returns Signed 64-bit integer.
223
- */
224
- public r_s64(value: i64): i64;
225
-
226
- /**
227
- * Read signed 8-bit integer.
228
- *
229
- * @returns Signed 8-bit integer.
230
- */
231
- public r_s8(): i8;
232
-
233
- /**
234
- * Read signed 8-bit integer through a placeholder overload.
235
- *
236
- * @param value - Placeholder value.
237
- * @returns Signed 8-bit integer.
238
- */
239
- public r_s8(value: i8): i8;
240
-
241
- /**
242
- * Read a signed compressed direction vector.
243
- *
244
- * @param vector - Vector to fill.
245
- */
246
- public r_sdir(vector: vector): void;
247
-
248
- /**
249
- * Move read cursor to an absolute byte offset.
250
- *
251
- * @remarks
252
- * The engine allows seeking to the packet end. Offsets beyond the written byte count fail native verification.
253
- *
254
- * @param offset - Byte offset.
255
- */
256
- public r_seek(offset: u32): void;
257
-
258
- /**
259
- * Read zero-terminated string.
260
- *
261
- * @remarks
262
- * Advances past the trailing zero byte.
263
- *
264
- * @returns String value.
265
- */
266
- public r_stringZ<T extends string = string>(): T;
267
-
268
- /**
269
- * Get current read cursor offset.
270
- *
271
- * @returns Byte offset.
272
- */
273
- public r_tell(): u32;
274
-
275
- /**
276
- * Read unsigned 16-bit integer.
277
- *
278
- * @returns Unsigned 16-bit integer.
279
- */
280
- public r_u16(): u16;
281
-
282
- /**
283
- * Read unsigned 16-bit integer through a placeholder overload.
284
- *
285
- * @param value - Placeholder value.
286
- * @returns Unsigned 16-bit integer.
287
- */
288
- public r_u16(value: u16): u16;
289
-
290
- /**
291
- * Read unsigned 32-bit integer.
292
- *
293
- * @returns Unsigned 32-bit integer.
294
- */
295
- public r_u32(): u32;
296
-
297
- /**
298
- * Read unsigned 32-bit integer through a placeholder overload.
299
- *
300
- * @param value - Placeholder value.
301
- * @returns Unsigned 32-bit integer.
302
- */
303
- public r_u32(value: u32): u32;
304
-
305
- /**
306
- * Read unsigned 64-bit integer.
307
- *
308
- * @returns Unsigned 64-bit integer.
309
- */
310
- public r_u64(): u64;
311
-
312
- /**
313
- * Read unsigned 64-bit integer through a placeholder overload.
314
- *
315
- * @param value - Placeholder value.
316
- * @returns Unsigned 64-bit integer.
317
- */
318
- public r_u64(value: u64): u64;
319
-
320
- /**
321
- * Read unsigned 8-bit integer.
322
- *
323
- * @returns Unsigned 8-bit integer.
324
- */
325
- public r_u8(): u8;
326
-
327
- /**
328
- * Read unsigned 8-bit integer through a placeholder overload.
329
- *
330
- * @param value - Placeholder value.
331
- * @returns Unsigned 8-bit integer.
332
- */
333
- public r_u8(value: u8): u8;
334
-
335
- /**
336
- * Read 3D vector.
337
- *
338
- * @param vector - Vector to fill.
339
- */
340
- public r_vec3(vector: vector): void;
341
-
342
- /**
343
- * Write a 16-bit compressed angle.
344
- *
345
- * @remarks
346
- * The engine normalizes the angle and stores it as a 16-bit quantized value over `0..2 * PI`.
347
- *
348
- * @param value - Angle in radians.
349
- */
350
- public w_angle16(value: f32): void;
351
-
352
- /**
353
- * Write an 8-bit compressed angle.
354
- *
355
- * @remarks
356
- * The engine normalizes the angle and stores it as an 8-bit quantized value over `0..2 * PI`.
357
- *
358
- * @param value - Angle in radians.
359
- */
360
- public w_angle8(value: f32): void;
361
-
362
- /**
363
- * Start packet with message type.
364
- *
365
- * @remarks
366
- * Clears existing packet contents before writing the message type.
367
- *
368
- * @param type - Message type.
369
- */
370
- public w_begin(type: u16): void;
371
-
372
- /**
373
- * Write boolean value.
374
- *
375
- * @remarks
376
- * Booleans are serialized as one byte.
377
- *
378
- * @param value - Boolean value.
379
- */
380
- public w_bool(value: boolean): void;
381
-
382
- /**
383
- * Close a 16-bit size-prefixed chunk.
384
- *
385
- * @remarks
386
- * The chunk payload must fit into `65535` bytes.
387
- *
388
- * @param marker - Chunk marker returned by `w_chunk_open16`.
389
- */
390
- public w_chunk_close16(marker: u32): void;
391
-
392
- /**
393
- * Close an 8-bit size-prefixed chunk.
394
- *
395
- * @remarks
396
- * The chunk payload must fit into `255` bytes.
397
- *
398
- * @param marker - Chunk marker returned by `w_chunk_open8`.
399
- */
400
- public w_chunk_close8(marker: u32): void;
401
-
402
- /**
403
- * Open a 16-bit size-prefixed chunk.
404
- *
405
- * @remarks
406
- * Writes a placeholder size at the current write cursor. Pass the returned marker to `w_chunk_close16`.
407
- *
408
- * @param marker - Output placeholder for chunk marker.
409
- */
410
- public w_chunk_open16(marker: u32): void;
411
-
412
- /**
413
- * Open an 8-bit size-prefixed chunk.
414
- *
415
- * @remarks
416
- * Writes a placeholder size at the current write cursor. Pass the returned marker to `w_chunk_close8`.
417
- *
418
- * @param marker - Output placeholder for chunk marker.
419
- */
420
- public w_chunk_open8(marker: u32): void;
421
-
422
- /**
423
- * Write client id.
424
- *
425
- * @param client_id - Client id.
426
- */
427
- public w_clientID(client_id: ClientID): void;
428
-
429
- /**
430
- * Write compressed direction vector.
431
- *
432
- * @param vector - Direction vector.
433
- */
434
- public w_dir(vector: vector): void;
435
-
436
- /**
437
- * Write float value.
438
- *
439
- * @param value - Float value.
440
- */
441
- public w_float(value: f32): void;
442
-
443
- /**
444
- * Write a 16-bit quantized float.
445
- *
446
- * @remarks
447
- * Native code verifies that `value` is inside `[min, max]`.
448
- *
449
- * @param value - Value to write.
450
- * @param min - Minimum encoded value.
451
- * @param max - Maximum encoded value.
452
- */
453
- public w_float_q16(value: f32, min: f32, max: f32): void;
454
-
455
- /**
456
- * Write an 8-bit quantized float.
457
- *
458
- * @remarks
459
- * Native code verifies that `value` is inside `[min, max]`.
460
- *
461
- * @param value - Value to write.
462
- * @param min - Minimum encoded value.
463
- * @param max - Maximum encoded value.
464
- */
465
- public w_float_q8(value: f32, min: f32, max: f32): void;
466
-
467
- /**
468
- * Write matrix data.
469
- *
470
- * @param matrix - Matrix to write.
471
- */
472
- public w_matrix(matrix: matrix): void;
473
-
474
- /**
475
- * Write signed 16-bit integer.
476
- *
477
- * @param value - Signed 16-bit integer.
478
- */
479
- public w_s16(value: i16): void;
480
-
481
- /**
482
- * Write signed 32-bit integer.
483
- *
484
- * @param value - Signed 32-bit integer.
485
- */
486
- public w_s32(value: i32): void;
487
-
488
- /**
489
- * Write signed 64-bit integer.
490
- *
491
- * @param value - Signed 64-bit integer.
492
- */
493
- public w_s64(value: i64): void;
494
-
495
- /**
496
- * Write signed compressed direction vector.
497
- *
498
- * @param vector - Direction vector.
499
- */
500
- public w_sdir(vector: vector): void;
501
-
502
- /**
503
- * Write zero-terminated string.
504
- *
505
- * @remarks
506
- * The binding writes the string bytes followed by `\0`.
507
- *
508
- * @param value - String value.
509
- */
510
- public w_stringZ(value: string | null): void;
511
-
512
- /**
513
- * Get current write cursor offset.
514
- *
515
- * @returns Byte offset.
516
- */
517
- public w_tell(): u32;
518
-
519
- /**
520
- * Write unsigned 16-bit integer.
521
- *
522
- * @param value - Unsigned 16-bit integer.
523
- */
524
- public w_u16(value: u16): void;
525
-
526
- /**
527
- * Write unsigned 32-bit integer.
528
- *
529
- * @param value - Unsigned 32-bit integer.
530
- */
531
- public w_u32(value: u32): void;
532
-
533
- /**
534
- * Write unsigned 64-bit integer.
535
- *
536
- * @param value - Unsigned 64-bit integer.
537
- */
538
- public w_u64(value: u64): void;
539
-
540
- /**
541
- * Write unsigned 8-bit integer.
542
- *
543
- * @param value - Unsigned 8-bit integer.
544
- */
545
- public w_u8(value: u8): void;
546
-
547
- /**
548
- * Write 3D vector.
549
- *
550
- * @param vector - Vector to write.
551
- */
552
- public w_vec3(vector: vector): void;
553
- }
554
-
555
- /**
556
- * Binary reader used for save data and chunk payloads.
557
- *
558
- * @source C++ class reader
559
- * @customConstructor reader
560
- * @group xr_save
561
- *
562
- * @remarks
563
- * Reader methods advance a cursor over existing binary data. They do not own or mutate the source buffer. Reader
564
- * values usually come from engine-owned chunks; scripts do not create them directly.
565
- */
566
- export class reader {
567
- /**
568
- * Advance the read cursor.
569
- *
570
- * @remarks
571
- * Native code verifies that the new cursor stays inside the reader buffer.
572
- *
573
- * @param size - Number of bytes to skip.
574
- */
575
- public r_advance(size: u64): void;
576
-
577
- /**
578
- * Get unread byte count.
579
- *
580
- * @returns Remaining bytes.
581
- */
582
- public r_elapsed(): i64;
583
-
584
- /**
585
- * Check whether the reader cursor reached the end.
586
- *
587
- * @returns Whether reader is fully consumed.
588
- */
589
- public r_eof(): boolean;
590
-
591
- /**
592
- * Read signed compressed direction vector.
593
- *
594
- * @param vector - Vector to fill.
595
- */
596
- public r_sdir(vector: vector): void;
597
-
598
- /**
599
- * Move read cursor to an absolute byte offset.
600
- *
601
- * @remarks
602
- * Offsets beyond the reader buffer fail native verification.
603
- *
604
- * @param offset - Byte offset.
605
- */
606
- public r_seek(offset: u64): void;
607
-
608
- /**
609
- * Get current read cursor offset.
610
- *
611
- * @returns Byte offset.
612
- */
613
- public r_tell(): u64;
614
-
615
- /**
616
- * Read compressed direction vector.
617
- *
618
- * @param vector - Vector to fill.
619
- */
620
- public r_dir(vector: vector): void;
621
-
622
- /**
623
- * Read 3D vector.
624
- *
625
- * @param vector - Vector to fill.
626
- */
627
- public r_vec3(vector: vector): void;
628
-
629
- /**
630
- * Read a 16-bit compressed angle.
631
- *
632
- * @returns Angle in radians.
633
- */
634
- public r_angle16(): f32;
635
-
636
- /**
637
- * Read an 8-bit compressed angle.
638
- *
639
- * @returns Angle in radians.
640
- */
641
- public r_angle8(): f32;
642
-
643
- /**
644
- * Read boolean value.
645
- *
646
- * @returns Boolean value.
647
- */
648
- public r_bool(): boolean;
649
-
650
- /**
651
- * Read zero-terminated string.
652
- *
653
- * @remarks
654
- * Advances past the trailing zero byte.
655
- *
656
- * @returns String value.
657
- */
658
- public r_stringZ<T extends string = string>(): T;
659
-
660
- /**
661
- * Read float value.
662
- *
663
- * @param value - Optional placeholder value.
664
- * @returns Float value.
665
- */
666
- public r_float<T extends f32>(value?: T): T;
667
-
668
- /**
669
- * Read a 16-bit quantized float.
670
- *
671
- * @param min - Minimum decoded value.
672
- * @param max - Maximum decoded value.
673
- * @returns Decoded float.
674
- */
675
- public r_float_q16<T extends f32>(min: T, max: T): T;
676
-
677
- /**
678
- * Read an 8-bit quantized float.
679
- *
680
- * @param min - Minimum decoded value.
681
- * @param max - Maximum decoded value.
682
- * @returns Decoded float.
683
- */
684
- public r_float_q8<T extends f32>(min: T, max: T): T;
685
-
686
- /**
687
- * Read signed 16-bit integer.
688
- *
689
- * @param value - Optional placeholder value.
690
- * @returns Signed 16-bit integer.
691
- */
692
- public r_s16<T extends i16 = i16>(value?: T): T;
693
-
694
- /**
695
- * Read signed 32-bit integer.
696
- *
697
- * @param value - Optional placeholder value.
698
- * @returns Signed 32-bit integer.
699
- */
700
- public r_s32<T extends i32 = i32>(value?: T): T;
701
-
702
- /**
703
- * Read signed 64-bit integer.
704
- *
705
- * @param value - Optional placeholder value.
706
- * @returns Signed 64-bit integer.
707
- */
708
- public r_s64<T extends i64 = i64>(value?: T): T;
709
-
710
- /**
711
- * Read signed 8-bit integer.
712
- *
713
- * @param value - Optional placeholder value.
714
- * @returns Signed 8-bit integer.
715
- */
716
- public r_s8<T extends i8 = i8>(value?: T): T;
717
-
718
- /**
719
- * Read unsigned 16-bit integer.
720
- *
721
- * @param value - Optional placeholder value.
722
- * @returns Unsigned 16-bit integer.
723
- */
724
- public r_u16<T extends u16 = u16>(value?: T): T;
725
-
726
- /**
727
- * Read unsigned 32-bit integer.
728
- *
729
- * @param value - Optional placeholder value.
730
- * @returns Unsigned 32-bit integer.
731
- */
732
- public r_u32<T extends u32 = u32>(value?: T): T;
733
-
734
- /**
735
- * Read unsigned 64-bit integer.
736
- *
737
- * @param value - Optional placeholder value.
738
- * @returns Unsigned 64-bit integer.
739
- */
740
- public r_u64<T extends u64 = u64>(value?: T): T;
741
-
742
- /**
743
- * Read unsigned 8-bit integer.
744
- *
745
- * @param value - Optional placeholder value.
746
- * @returns Unsigned 8-bit integer.
747
- */
748
- public r_u8<T extends u8 = u8>(value?: T): T;
749
- }
750
-
751
- /**
752
- * Any engine binary input accepted by save/network serializers.
753
- *
754
- * @group xr_save
755
- */
756
- export type TXR_net_processor = reader | net_packet;
757
-
758
- /**
759
- * Lightweight view over save-game metadata.
760
- *
761
- * @source C++ class CSavedGameWrapper
762
- * @customConstructor CSavedGameWrapper
763
- * @group xr_save
764
- *
765
- * @remarks
766
- * Looks for both current and legacy save extensions under `$game_saves$`. A missing file asserts; an existing file
767
- * with an incompatible header returns fallback metadata instead.
768
- */
769
- export class CSavedGameWrapper extends EngineBinding {
770
- /**
771
- * Open save-game metadata by save name.
772
- *
773
- * @throws If the save file does not exist.
774
- *
775
- * @param name - Save name without extension.
776
- */
777
- public constructor(name: string);
778
-
779
- /**
780
- * Get active level name stored in the save.
781
- *
782
- * @remarks
783
- * Returns an empty string when level metadata cannot be resolved. Returns the translated error string when the
784
- * game graph has no matching level id.
785
- *
786
- * @returns Level name, or an empty/error value when metadata cannot be resolved.
787
- */
788
- public level_name(): string;
789
-
790
- /**
791
- * Get active level id stored in the save.
792
- *
793
- * @remarks
794
- * Returns `255` when level metadata cannot be resolved.
795
- *
796
- * @returns Level id.
797
- */
798
- public level_id(): u8;
799
-
800
- /**
801
- * Get in-game time stored in the save.
802
- *
803
- * @remarks
804
- * Invalid save headers return the default ALife time instead of throwing.
805
- *
806
- * @returns Game time.
807
- */
808
- public game_time(): CTime;
809
-
810
- /**
811
- * Get actor health stored in the save.
812
- *
813
- * @remarks
814
- * Invalid save headers return `1`.
815
- *
816
- * @returns Actor health.
817
- */
818
- public actor_health(): f32;
819
- }
820
-
821
- /**
822
- * Check whether a save exists and has a compatible header.
823
- *
824
- * @group xr_save
825
- *
826
- * @remarks
827
- * Accepts save names without extension and checks both current and legacy save extensions.
828
- *
829
- * @param filename - Save name without extension.
830
- * @returns Whether the save can be loaded by this engine.
831
- */
832
- export function valid_saved_game(this: void, filename: string): boolean;
833
- }