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,385 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Main-menu options manager binding.
4
- *
5
- * @source C++ class COptionsManager
6
- * @customConstructor COptionsManager
7
- * @group xr_ui_menu
8
- *
9
- * @remarks
10
- * Operates on option item groups registered by the options UI.
11
- */
12
- export class COptionsManager {
13
- /**
14
- * Create an options manager script proxy.
15
- */
16
- public constructor();
17
-
18
- /**
19
- * Send a UI options message to every option item in a group.
20
- *
21
- * @param group - Options group name.
22
- * @param message - Message name.
23
- */
24
- public SendMessage2Group(group: string, message: string): void;
25
-
26
- /**
27
- * Restore options in a group from their backup values.
28
- *
29
- * @param group - Options group name.
30
- */
31
- public UndoGroup(group: string): void;
32
-
33
- /**
34
- * Save current option values as the backup for a group.
35
- *
36
- * @param group - Options group name.
37
- */
38
- public SaveBackupValues(group: string): void;
39
-
40
- /**
41
- * Persist current option values for a group.
42
- *
43
- * @param group - Options group name.
44
- */
45
- public SaveValues(group: string): void;
46
-
47
- /**
48
- * Apply current engine option values to controls in a group.
49
- *
50
- * @param group - Options group name.
51
- */
52
- public SetCurrentValues(group: string): void;
53
-
54
- /**
55
- * Check whether accepted options require a system restart.
56
- *
57
- * @returns Whether a system restart is needed.
58
- */
59
- public NeedSystemRestart(): boolean;
60
-
61
- /**
62
- * Check whether accepted options require a video restart.
63
- *
64
- * @returns Whether a video restart is needed.
65
- */
66
- public NeedVidRestart(): boolean;
67
-
68
- /**
69
- * Run post-accept handling after options are saved.
70
- */
71
- public OptionsPostAccept(): void;
72
- }
73
-
74
- /**
75
- * Main menu binding.
76
- *
77
- * @source C++ class CMainMenu
78
- * @customConstructor CMainMenu
79
- * @group xr_ui_menu
80
- *
81
- * @remarks
82
- * Engine-owned singleton returned by `main_menu.get_main_menu()`.
83
- */
84
- export class CMainMenu {
85
- /**
86
- * Get the CD key stored by the game.
87
- *
88
- * @returns CD key string.
89
- */
90
- public GetCDKey(): string;
91
-
92
- /**
93
- * Get the multiplayer account manager.
94
- *
95
- * @returns Account manager.
96
- */
97
- public GetAccountMngr(): account_manager;
98
-
99
- /**
100
- * Read metadata for a recorded demo file.
101
- *
102
- * @param fileName - Demo file name.
103
- * @returns Demo info, or `null` when it cannot be read.
104
- */
105
- public GetDemoInfo(fileName: string): demo_info | null;
106
-
107
- /**
108
- * Get patch download progress.
109
- *
110
- * @returns Patch progress object.
111
- */
112
- public GetPatchProgress(): Patch_Dawnload_Progress;
113
-
114
- /**
115
- * Get the multiplayer profile store.
116
- *
117
- * @returns Profile store.
118
- */
119
- public GetProfileStore(): profile_store;
120
-
121
- /**
122
- * Get GameSpy protocol version string.
123
- *
124
- * @returns GameSpy version.
125
- */
126
- public GetGSVer(): string;
127
-
128
- /**
129
- * Get the multiplayer login manager.
130
- *
131
- * @returns Login manager.
132
- */
133
- public GetLoginMngr(): login_manager;
134
-
135
- /**
136
- * Get the current player name.
137
- *
138
- * @returns Player name.
139
- */
140
- public GetPlayerName(): string;
141
-
142
- /**
143
- * Cancel the active multiplayer map download.
144
- */
145
- public CancelDownload(): void;
146
-
147
- /**
148
- * Validate the stored CD key.
149
- *
150
- * @returns Whether the CD key is valid.
151
- */
152
- public ValidateCDKey(): boolean;
153
- }
154
-
155
- /**
156
- * In-game UI root binding.
157
- *
158
- * @source C++ class CUIGameCustom
159
- * @customConstructor CUIGameCustom
160
- * @group xr_ui_menu
161
- *
162
- * @remarks
163
- * Current in-game HUD UI. Global helpers dereference the current game UI, so call them only while a level UI exists.
164
- */
165
- export class CUIGameCustom {
166
- /**
167
- * Add a custom HUD static by XML id.
168
- *
169
- * @remarks
170
- * If `singleInstance` is true and an active static with this id already exists, that wrapper is returned.
171
- *
172
- * @param id - Static descriptor id.
173
- * @param singleInstance - Whether an existing static with the same id should be reused.
174
- * @returns Drawable wrapper for the static.
175
- */
176
- public AddCustomStatic(id: string, singleInstance: boolean): StaticDrawableWrapper;
177
-
178
- /**
179
- * Add a custom HUD static by XML id and lifetime.
180
- *
181
- * @remarks
182
- * The static is initialized from `ui_custom_msgs.xml`. Positive lifetime values remove it automatically after
183
- * that many seconds unless the XML entry overrides `ttl`.
184
- *
185
- * @param id - Static descriptor id.
186
- * @param singleInstance - Whether an existing static with the same id should be reused.
187
- * @param lifetime - Time before the static is removed.
188
- * @returns Drawable wrapper for the static.
189
- */
190
- public AddCustomStatic(id: string, singleInstance: boolean, lifetime: f32): StaticDrawableWrapper;
191
-
192
- /**
193
- * Add a dialog window to the HUD render list.
194
- *
195
- * @remarks
196
- * Adds the window to the HUD dialog holder. It shows the window but does not take ownership of it.
197
- *
198
- * @param window - Dialog window.
199
- */
200
- public AddDialogToRender(window: CUIWindow): void;
201
-
202
- /**
203
- * Get the inventory item currently under the actor menu cursor.
204
- *
205
- * @since OpenXRay 2015-07-07, 6e703b4c
206
- *
207
- * @remarks
208
- * Requires the actor menu to have a current inventory cell.
209
- *
210
- * @returns Game object for the item, or `null` when the cell has no item.
211
- */
212
- public CurrentItemAtCell(): game_object | null;
213
-
214
- /**
215
- * Get an active custom HUD static by id.
216
- *
217
- * @param id - Static descriptor id.
218
- * @returns Drawable wrapper, or `null` when missing.
219
- */
220
- public GetCustomStatic(id: string): StaticDrawableWrapper | null;
221
-
222
- /**
223
- * Hide the actor inventory menu.
224
- *
225
- * @remarks
226
- * No-op when the actor menu is already hidden.
227
- */
228
- public HideActorMenu(): void;
229
-
230
- /**
231
- * Show the actor inventory menu.
232
- *
233
- * @remarks
234
- * Toggles the actor menu. If it is already shown, the call hides it instead.
235
- *
236
- * @returns `true` after handling the toggle.
237
- */
238
- public ShowActorMenu(): boolean;
239
-
240
- /**
241
- * Hide the PDA menu.
242
- *
243
- * @remarks
244
- * No-op when the PDA menu is already hidden.
245
- */
246
- public HidePdaMenu(): void;
247
-
248
- /**
249
- * Remove a custom HUD static.
250
- *
251
- * @remarks
252
- * Destroys the matching HUD-owned wrapper when it exists.
253
- *
254
- * @param id - Static descriptor id.
255
- */
256
- public RemoveCustomStatic(id: string): void;
257
-
258
- /**
259
- * Remove a dialog window from the HUD render list.
260
- *
261
- * @remarks
262
- * Hides and disables the window in the HUD dialog holder. It does not destroy the window.
263
- *
264
- * @param window - Dialog window.
265
- */
266
- public RemoveDialogToRender(window: CUIWindow): void;
267
-
268
- /**
269
- * Refresh actor menu state.
270
- *
271
- * @since OpenXRay 2015-07-07, 6e703b4c
272
- *
273
- * @remarks
274
- * Updates the actor menu only when it is currently shown.
275
- */
276
- public UpdateActorMenu(): void;
277
-
278
- /**
279
- * Enable or disable fake HUD indicators.
280
- *
281
- * @param enabled - New fake-indicator state.
282
- */
283
- public enable_fake_indicators(enabled: boolean): void;
284
-
285
- /**
286
- * Hide HUD messages.
287
- */
288
- public hide_messages(): void;
289
-
290
- /**
291
- * Show HUD messages.
292
- */
293
- public show_messages(): void;
294
-
295
- /**
296
- * Update fake indicator visibility.
297
- *
298
- * @param indicator - Indicator id.
299
- * @param enabled - New indicator state.
300
- */
301
- public update_fake_indicators(indicator: number, enabled: boolean): void;
302
-
303
- /**
304
- * Update fake indicator value.
305
- *
306
- * @param indicator - Indicator id.
307
- * @param value - New indicator value.
308
- */
309
- public update_fake_indicators(indicator: number, value: f32): void;
310
- }
311
-
312
- /**
313
- * Main menu namespace exposed to scripts.
314
- *
315
- * @source namespace main_menu
316
- * @group xr_ui_menu
317
- */
318
- export interface IXR_main_menu {
319
- /**
320
- * @returns Main game menu c++ controller singleton.
321
- */
322
- get_main_menu(this: void): CMainMenu;
323
- }
324
-
325
- /**
326
- * Actor/PDA menu namespace exposed to scripts.
327
- *
328
- * @source namespace ActorMenu
329
- * @group xr_ui_menu
330
- *
331
- * @remarks
332
- * These helpers dereference `CurrentGameUI()` directly. Use them only in-game after the HUD UI has been created.
333
- */
334
- export interface IXR_ActorMenu {
335
- /**
336
- * Get the current PDA menu window.
337
- *
338
- * @throws When called without an active current game UI.
339
- *
340
- * @returns PDA menu window.
341
- */
342
- get_pda_menu(this: void): CUIPdaWnd;
343
-
344
- /**
345
- * Get the current actor menu window.
346
- *
347
- * @throws When called without an active current game UI.
348
- *
349
- * @returns Actor menu window.
350
- */
351
- get_actor_menu(this: void): CUIActorMenu;
352
-
353
- /**
354
- * Get current actor menu mode.
355
- *
356
- * @throws When called without an active current game UI.
357
- *
358
- * @returns Numeric `EMenuMode` value.
359
- */
360
- get_menu_mode(this: void): number;
361
- // Get_maingame(this: void): unknown; // CUIMainIngameWnd - not registered, throws exception
362
- }
363
-
364
- /**
365
- * @group xr_ui_menu
366
- */
367
- export const ActorMenu: IXR_ActorMenu;
368
-
369
- /**
370
- * @group xr_ui_menu
371
- */
372
- export const main_menu: IXR_main_menu;
373
-
374
- /**
375
- * Get the current game HUD UI.
376
- *
377
- * @group xr_ui_menu
378
- *
379
- * @remarks
380
- * The binding returns `CurrentGameUI()`. Call it only while a level HUD exists.
381
- *
382
- * @returns Current HUD UI controller.
383
- */
384
- export function get_hud(this: void): CUIGameCustom;
385
- }
@@ -1,109 +0,0 @@
1
- declare global {
2
- /**
3
- * Current source file name injected at transpile time.
4
- *
5
- * @group xrf_plugin
6
- */
7
- const $filename: string;
8
-
9
- /**
10
- * Current source directory name injected at transpile time.
11
- *
12
- * @group xrf_plugin
13
- */
14
- const $dirname: string;
15
-
16
- /**
17
- * Check whether a value is nil-compatible in Lua and Jest runtimes.
18
- *
19
- * @group xrf_plugin
20
- *
21
- * @param value - Value to check.
22
- * @returns Whether value is `null` or `undefined`.
23
- */
24
- function $isNil(value: unknown): value is null | undefined;
25
-
26
- /**
27
- * Check whether a value is not nil-compatible in Lua and Jest runtimes.
28
- *
29
- * @group xrf_plugin
30
- *
31
- * @param value - Value to check.
32
- * @returns Whether value is neither `null` nor `undefined`.
33
- */
34
- function $isNotNil<T>(value: T): value is NonNullable<T>;
35
-
36
- /**
37
- * Treat a TypeScript array as a Lua array.
38
- *
39
- * The transformer removes this call and emits its argument.
40
- *
41
- * @group xrf_plugin
42
- *
43
- * @param array - TypeScript array.
44
- * @returns Same value typed as a Lua array.
45
- */
46
- function $fromArray<T>(array: Array<T>): LuaTable<number, T>;
47
-
48
- /**
49
- * Treat a Lua array as a TypeScript array.
50
- *
51
- * The transformer removes this call and emits its argument.
52
- *
53
- * @group xrf_plugin
54
- *
55
- * @param array - Lua array.
56
- * @returns Same value typed as a TypeScript array.
57
- */
58
- function $fromLuaArray<T>(array: LuaTable<number, T>): Array<T>;
59
-
60
- /**
61
- * Treat a TypeScript object as a Lua table.
62
- *
63
- * The transformer removes this call and emits its argument.
64
- *
65
- * @group xrf_plugin
66
- *
67
- * @param object - TypeScript object.
68
- * @returns Same value typed as a Lua table.
69
- */
70
- function $fromObject<K extends string | number, T>(object: Record<K, T>): LuaTable<K, T>;
71
-
72
- /**
73
- * Treat a TypeScript object as a Lua table.
74
- *
75
- * The transformer removes this call and emits its argument.
76
- *
77
- * @group xrf_plugin
78
- *
79
- * @param object - TypeScript object.
80
- * @returns Same value typed as a Lua table.
81
- */
82
- function $fromObject<D>(object: D): LuaTable<keyof D, D[keyof D]>;
83
-
84
- /**
85
- * Treat a Lua table as a TypeScript object.
86
- *
87
- * The transformer removes this call and emits its argument.
88
- *
89
- * @group xrf_plugin
90
- *
91
- * @param object - Lua table.
92
- * @returns Same value typed as a TypeScript object.
93
- */
94
- function $fromLuaTable<K extends string | number, T>(object: LuaTable<K, T>): Record<K, T>;
95
-
96
- /**
97
- * Treat a Lua table as a TypeScript object.
98
- *
99
- * The transformer removes this call and emits its argument.
100
- *
101
- * @group xrf_plugin
102
- *
103
- * @param object - Lua table.
104
- * @returns Same value typed as a TypeScript object.
105
- */
106
- function $fromLuaTable<D>(object: LuaTable<keyof D, D[keyof D]>): D;
107
- }
108
-
109
- export {};