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,473 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * LTX/INI file reader and writer.
4
- *
5
- * Use it to read config sections and fields from game data, or to create small script-owned config files.
6
- * Engine configs support section inheritance and `#include` statements.
7
- *
8
- * @source C++ class ini_file
9
- * @customConstructor ini_file
10
- * @group xr_ini
11
- *
12
- * @remarks
13
- * Most typed read methods use the engine's strict config readers. Check `section_exist` and `line_exist` first when
14
- * missing data is valid for your script.
15
- */
16
- export class ini_file {
17
- /**
18
- * Create an empty ini file.
19
- */
20
- public constructor();
21
-
22
- /**
23
- * Open an ini file from the game config path.
24
- *
25
- * @remarks
26
- * This constructor resolves `path` below `$game_config$`.
27
- *
28
- * @param path - File name or path relative to `$game_config$`.
29
- */
30
- public constructor(path: string);
31
-
32
- /**
33
- * Open an ini file from a filesystem alias and relative path.
34
- *
35
- * @param initial - Filesystem alias, for example `$game_config$`.
36
- * @param path - File name or path relative to the alias.
37
- */
38
- public constructor(initial: string, path: string);
39
-
40
- /**
41
- * @remarks
42
- * Missing sections are an engine assertion path. The recoverable branch returns `0`.
43
- *
44
- * @param section - Target section to check lines count.
45
- * @returns Count of lines for provided section.
46
- */
47
- public line_count(section: string): u32;
48
-
49
- /**
50
- * @returns Number of sections in this file.
51
- */
52
- public section_count(): u32;
53
-
54
- /**
55
- * Remove ini file section field.
56
- *
57
- * @param section - Target section to modify.
58
- * @param field - Target section field to remove.
59
- */
60
- public remove_line(section: string, field: string): void;
61
-
62
- /**
63
- * Read a boolean value.
64
- *
65
- * @param section - Section name.
66
- * @param field - Field name.
67
- * @returns Parsed boolean value.
68
- */
69
- public r_bool(section: string, field: string): boolean;
70
-
71
- /**
72
- * Check whether a section exists.
73
- *
74
- * @param section - Section name.
75
- * @returns Whether the section exists.
76
- */
77
- public section_exist(section: string | null): boolean;
78
-
79
- /**
80
- * Read a floating-point value.
81
- *
82
- * @throws If the section or field does not exist.
83
- *
84
- * @param section - Section name.
85
- * @param field - Field name.
86
- * @returns Parsed number.
87
- */
88
- public r_float(section: string, field: string): f32;
89
-
90
- /**
91
- * Read a class identifier value.
92
- *
93
- * @param section - Section name.
94
- * @param field - Field name.
95
- * @returns Parsed class identifier.
96
- */
97
- public r_clsid(section: string, field: string): i32;
98
-
99
- /**
100
- * Read a signed 32-bit integer.
101
- *
102
- * @throws If the section or field does not exist.
103
- *
104
- * @param section - Section name.
105
- * @param field - Field name.
106
- * @returns Parsed integer.
107
- */
108
- public r_s32(section: string, field: string): i32;
109
-
110
- /**
111
- * Read text line from ini config file.
112
- *
113
- * @remarks
114
- * Returns `false` for an out-of-range line index. A missing section is a hard engine error.
115
- *
116
- * @throws If the section does not exist.
117
- *
118
- * @param section - Section name.
119
- * @param line_number - Zero-based line index inside the section.
120
- * @param key - Placeholder for Lua out parameter.
121
- * @param value - Placeholder for Lua out parameter.
122
- * @returns Success flag, key, and value.
123
- */
124
- public r_line<T extends string = string, P extends string = string>(
125
- section: string,
126
- line_number: i32,
127
- key: string,
128
- value: string
129
- ): LuaMultiReturn<[boolean, T, P]>;
130
-
131
- /**
132
- * Read a token value using a token list.
133
- *
134
- * @param section - Section name.
135
- * @param field - Field name.
136
- * @param list - Token list used for lookup.
137
- * @returns Token id.
138
- */
139
- public r_token(section: string, field: string, list: token_list): i32;
140
-
141
- /**
142
- * Read a 3D vector.
143
- *
144
- * @throws If the section or field does not exist.
145
- *
146
- * @param section - Section name.
147
- * @param field - Field name.
148
- * @returns Parsed vector.
149
- */
150
- public r_vector(section: string, field: string): vector;
151
-
152
- /**
153
- * Read an unsigned 32-bit integer.
154
- *
155
- * @throws If the section or field does not exist.
156
- *
157
- * @param section - Section name.
158
- * @param field - Field name.
159
- * @returns Parsed integer.
160
- */
161
- public r_u32(section: string, field: string): u32;
162
-
163
- /**
164
- * Read a quoted string value.
165
- *
166
- * @remarks
167
- * Uses the same engine reader as `r_string_wb`; quoted values may keep spaces.
168
- *
169
- * @param section - Section name.
170
- * @param field - Field name.
171
- * @returns Parsed string.
172
- */
173
- public r_string_wq(section: string, field: string): string;
174
-
175
- /**
176
- * @remarks
177
- * Reads a string with blanks preserved by the engine parser.
178
- *
179
- * @param section - Ini file section.
180
- * @param field - Ini section field.
181
- * @returns If quoted, parsed string data inside quotes including spaces, else is same data as with r_string.
182
- */
183
- public r_string_wb(section: string, field: string): string;
184
-
185
- /**
186
- * @throws If the section or field does not exist.
187
- *
188
- * @param section - Ini file section.
189
- * @param field - Ini section field.
190
- * @returns Raw string from ltx file without spaces in it.
191
- */
192
- public r_string(section: string, field: string): string;
193
-
194
- /**
195
- * Check if line exists in the file by section and field.
196
- *
197
- * @param section - Target section to check.
198
- * @param field - Section field to check.
199
- * @returns Whether line exists.
200
- */
201
- public line_exist(section: string | null, field: string): boolean;
202
-
203
- /**
204
- * Write a 2D vector value.
205
- *
206
- * @since OpenXRay 2014-12-30, 565b39e5
207
- *
208
- * @param section - Section name.
209
- * @param field - Field name.
210
- * @param vector - Value to write.
211
- * @param comment - Optional line comment.
212
- */
213
- public w_fvector2(section: string, field: string, vector: vector2, comment?: string): void;
214
-
215
- /**
216
- * Write a 3D vector value.
217
- *
218
- * @since OpenXRay 2014-12-30, 565b39e5
219
- *
220
- * @param section - Section name.
221
- * @param field - Field name.
222
- * @param vector - Value to write.
223
- * @param comment - Optional line comment.
224
- */
225
- public w_fvector3(section: string, field: string, vector: vector, comment?: string): void;
226
-
227
- /**
228
- * Write a 4D vector value.
229
- *
230
- * @since OpenXRay 2014-12-30, 565b39e5
231
- *
232
- * @param section - Section name.
233
- * @param field - Field name.
234
- * @param vector - Value to write.
235
- * @param comment - Optional line comment.
236
- */
237
- public w_fvector4(section: string, field: string, vector: never, comment?: string): void; // Struct _vector4<float>
238
-
239
- /**
240
- * Write a floating-point color value.
241
- *
242
- * @param section - Section name.
243
- * @param field - Field name.
244
- * @param color - Value to write.
245
- * @param comment - Optional line comment.
246
- */
247
- public w_fcolor(section: string, field: string, color: fcolor, comment?: string): void;
248
-
249
- /**
250
- * Write a packed color value.
251
- *
252
- * @param section - Section name.
253
- * @param field - Field name.
254
- * @param color - Value to write.
255
- * @param comment - Optional line comment.
256
- */
257
- public w_color(section: string, field: string, color: u32, comment?: string): void;
258
-
259
- /**
260
- * Write a boolean value.
261
- *
262
- * @param section - Section name.
263
- * @param field - Field name.
264
- * @param value - Value to write.
265
- * @param comment - Optional line comment.
266
- */
267
- public w_bool(section: string, field: string, value: boolean, comment?: string): void;
268
-
269
- /**
270
- * Write a signed 8-bit integer.
271
- *
272
- * @param section - Section name.
273
- * @param field - Field name.
274
- * @param value - Value to write.
275
- * @param comment - Optional line comment.
276
- */
277
- public w_s8(section: string, field: string, value: u8, comment?: string): void;
278
-
279
- /**
280
- * Write an unsigned 8-bit integer.
281
- *
282
- * @param section - Section name.
283
- * @param field - Field name.
284
- * @param value - Value to write.
285
- * @param comment - Optional line comment.
286
- */
287
- public w_u8(section: string, field: string, value: u8, comment?: string): void;
288
-
289
- /**
290
- * Write a signed 16-bit integer.
291
- *
292
- * @param section - Section name.
293
- * @param field - Field name.
294
- * @param value - Value to write.
295
- * @param comment - Optional line comment.
296
- */
297
- public w_s16(section: string, field: string, value: i16, comment?: string): void;
298
-
299
- /**
300
- * Write an unsigned 16-bit integer.
301
- *
302
- * @param section - Section name.
303
- * @param field - Field name.
304
- * @param value - Value to write.
305
- * @param comment - Optional line comment.
306
- */
307
- public w_u16(section: string, field: string, value: u16, comment?: string): void;
308
-
309
- /**
310
- * Write a signed 32-bit integer.
311
- *
312
- * @param section - Section name.
313
- * @param field - Field name.
314
- * @param value - Value to write.
315
- * @param comment - Optional line comment.
316
- */
317
- public w_s32(section: string, field: string, value: i32, comment?: string): void;
318
-
319
- /**
320
- * Write an unsigned 32-bit integer.
321
- *
322
- * @param section - Section name.
323
- * @param field - Field name.
324
- * @param value - Value to write.
325
- * @param comment - Optional line comment.
326
- */
327
- public w_u32(section: string, field: string, value: u32, comment?: string): void;
328
-
329
- /**
330
- * Write a signed 64-bit integer.
331
- *
332
- * @param section - Section name.
333
- * @param field - Field name.
334
- * @param value - Value to write.
335
- * @param comment - Optional line comment.
336
- */
337
- public w_s64(section: string, field: string, value: i64, comment?: string): void;
338
-
339
- /**
340
- * Write an unsigned 64-bit integer.
341
- *
342
- * @param section - Section name.
343
- * @param field - Field name.
344
- * @param value - Value to write.
345
- * @param comment - Optional line comment.
346
- */
347
- public w_u64(section: string, field: string, value: u64, comment?: string): void;
348
-
349
- /**
350
- * Write a floating-point number.
351
- *
352
- * @param section - Section name.
353
- * @param field - Field name.
354
- * @param value - Value to write.
355
- * @param comment - Optional line comment.
356
- */
357
- public w_float(section: string, field: string, value: f32, comment?: string): void;
358
-
359
- /**
360
- * Write a string value.
361
- *
362
- * @param section - Section name.
363
- * @param field - Field name.
364
- * @param value - Value to write.
365
- * @param comment - Optional line comment.
366
- */
367
- public w_string(section: string, field: string, value: string, comment?: string): void;
368
-
369
- /**
370
- * Get file name and path of ini file.
371
- *
372
- * @example `f:\applications\steam\steamapps\common\stalker call of pripyat\gamedata\configs\misc\task_manager.ltx`
373
- *
374
- * @returns Full path to ini file.
375
- */
376
- public fname(): string;
377
-
378
- /**
379
- * Switch the file into readonly or writable mode.
380
- *
381
- * @param is_readonly - Whether writes should be disabled.
382
- */
383
- public set_readonly(is_readonly: boolean): void;
384
-
385
- /**
386
- * Enable or disable section override name handling.
387
- *
388
- * @since OpenXRay 2014-12-30, 565b39e5
389
- *
390
- * @param override - Whether override names should be used.
391
- */
392
- public set_override_names(override: boolean): void;
393
-
394
- /**
395
- * Save this ini file to a path.
396
- *
397
- * @throws If `path` is missing.
398
- *
399
- * @param path - Destination path.
400
- * @returns Whether saving succeeded.
401
- */
402
- public save_as(path: string): boolean;
403
-
404
- /**
405
- * Adjust saving on file closing/destructor calls.
406
- *
407
- * @remarks
408
- * Intended for script-created or script-owned ini files. Be careful using it on engine-owned singletons returned
409
- * by `game_ini` or `system_ini`.
410
- *
411
- * @param should_save - Whether ini file should be saved when destructor is called.
412
- */
413
- public save_at_end(should_save: boolean): void;
414
-
415
- /**
416
- * Iterate over ini file sections.
417
- * Calls provided callback for each ini section in file.
418
- *
419
- * @param cb - Callback to call on each ini file section, where name is section name.
420
- */
421
- public section_for_each(cb: (this: void, name: string) => void): void;
422
- }
423
-
424
- /**
425
- * Create ini file instance based on provided string content.
426
- *
427
- * @group xr_ini
428
- *
429
- * @remarks
430
- * Parses the string through an in-memory reader using `$game_config$` as the base include path.
431
- *
432
- * @param content - String value to be read as ini file.
433
- * @returns New ini file instance based on provided content.
434
- */
435
- export function create_ini_file(this: void, content: string): ini_file;
436
-
437
- /**
438
- * Get the loaded game ini.
439
- *
440
- * @group xr_ini
441
- *
442
- * @remarks
443
- * Returns the engine-owned `pGameIni` singleton.
444
- *
445
- * @returns Current game ini file.
446
- */
447
- export function game_ini(this: void): ini_file;
448
-
449
- /**
450
- * Get the loaded system ini.
451
- *
452
- * @group xr_ini
453
- *
454
- * @remarks
455
- * Returns the engine-owned `pSettings` singleton.
456
- *
457
- * @returns Current system ini file.
458
- */
459
- export function system_ini(this: void): ini_file;
460
-
461
- /**
462
- * Reload and return the system ini.
463
- *
464
- * @group xr_ini
465
- *
466
- * @remarks
467
- * Destroys the current `pSettings` instance and reloads `system.ltx` from `$game_config$`. Avoid keeping old
468
- * `system_ini()` references across this call.
469
- *
470
- * @returns Reloaded system ini file.
471
- */
472
- export function reload_system_ini(this: void): ini_file;
473
- }