xray16 1.3.4 → 1.5.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 (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +112 -106
  3. package/package.json +45 -42
  4. package/plugins/built_at_info.d.ts +1 -1
  5. package/plugins/from_cast_utils.d.ts +1 -1
  6. package/plugins/global_declarations_transform.d.ts +1 -1
  7. package/plugins/inject_file_meta.d.ts +1 -1
  8. package/plugins/inject_tracy_zones.d.ts +1 -1
  9. package/plugins/inject_tracy_zones.js +2 -2
  10. package/plugins/strip_lua_logger.d.ts +1 -1
  11. package/plugins/strip_lua_logger.js +1 -1
  12. package/plugins/transform_luabind_class/plugin.d.ts +1 -1
  13. package/plugins/transform_luabind_class/transformation/class_declaration.d.ts +3 -3
  14. package/plugins/transform_luabind_class/transformation/decorators.d.ts +5 -2
  15. package/plugins/transform_luabind_class/transformation/decorators.js +3 -0
  16. package/plugins/transform_luabind_class/transformation/members/accessors.d.ts +1 -1
  17. package/plugins/transform_luabind_class/transformation/members/constructor.d.ts +2 -2
  18. package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -2
  19. package/plugins/transform_luabind_class/transformation/members/fields.d.ts +5 -2
  20. package/plugins/transform_luabind_class/transformation/members/fields.js +5 -2
  21. package/plugins/transform_luabind_class/transformation/members/method.d.ts +6 -3
  22. package/plugins/transform_luabind_class/transformation/members/method.js +4 -1
  23. package/plugins/transform_luabind_class/transformation/new.d.ts +7 -3
  24. package/plugins/transform_luabind_class/transformation/new.js +5 -1
  25. package/plugins/transform_luabind_class/transformation/setup.d.ts +9 -3
  26. package/plugins/transform_luabind_class/transformation/setup.js +22 -6
  27. package/plugins/transform_luabind_class/transformation/super.d.ts +19 -3
  28. package/plugins/transform_luabind_class/transformation/super.js +17 -1
  29. package/plugins/transform_luabind_class/transformation/utils.d.ts +27 -4
  30. package/plugins/transform_luabind_class/transformation/utils.js +25 -2
  31. package/plugins/utils/ast.d.ts +1 -1
  32. package/plugins/utils/diagnostics.d.ts +9 -5
  33. package/plugins/utils/diagnostics.js +5 -1
  34. package/plugins/utils/tracy.d.ts +1 -1
  35. package/types/index.d.ts +55 -55
  36. package/types/xr_ai/xr_action.d.ts +1802 -510
  37. package/types/xr_ai/xr_alife.d.ts +1870 -566
  38. package/types/xr_ai/xr_enemy_evaluation.d.ts +134 -41
  39. package/types/xr_ai/xr_goap.d.ts +1116 -668
  40. package/types/xr_ai/xr_graph.d.ts +135 -47
  41. package/types/xr_ai/xr_memory.d.ts +382 -148
  42. package/types/xr_lib/xr_animation.d.ts +252 -81
  43. package/types/xr_lib/xr_bitwise.d.ts +44 -21
  44. package/types/xr_lib/xr_color.d.ts +142 -40
  45. package/types/xr_lib/xr_debug.d.ts +181 -77
  46. package/types/xr_lib/xr_dialog.d.ts +132 -40
  47. package/types/xr_lib/xr_flags.d.ts +592 -148
  48. package/types/xr_lib/xr_fs.d.ts +539 -148
  49. package/types/xr_lib/xr_game.d.ts +362 -158
  50. package/types/xr_lib/xr_hit.d.ts +125 -41
  51. package/types/xr_lib/xr_ini.d.ts +473 -188
  52. package/types/xr_lib/xr_level.d.ts +795 -225
  53. package/types/xr_lib/xr_luabind.d.ts +90 -59
  54. package/types/xr_lib/xr_map.d.ts +192 -61
  55. package/types/xr_lib/xr_math.d.ts +871 -233
  56. package/types/xr_lib/xr_multiplayer.d.ts +1079 -351
  57. package/types/xr_lib/xr_profile.d.ts +272 -160
  58. package/types/xr_lib/xr_properties.d.ts +610 -166
  59. package/types/xr_lib/xr_relation.d.ts +231 -84
  60. package/types/xr_lib/xr_render.d.ts +167 -69
  61. package/types/xr_lib/xr_save.d.ts +833 -223
  62. package/types/xr_lib/xr_sound.d.ts +515 -151
  63. package/types/xr_lib/xr_stats.ts +49 -20
  64. package/types/xr_lib/xr_task.d.ts +388 -111
  65. package/types/xr_lib/xr_time.d.ts +177 -61
  66. package/types/xr_lib/xr_type.d.ts +75 -75
  67. package/types/xr_object/client/xr_anomaly.d.ts +70 -50
  68. package/types/xr_object/client/xr_artefact.d.ts +153 -98
  69. package/types/xr_object/client/xr_client_object.d.ts +207 -76
  70. package/types/xr_object/client/xr_creature.d.ts +243 -164
  71. package/types/xr_object/client/xr_item.d.ts +370 -264
  72. package/types/xr_object/client/xr_level.d.ts +753 -285
  73. package/types/xr_object/client/xr_physic.d.ts +644 -214
  74. package/types/xr_object/client/xr_zone.d.ts +85 -47
  75. package/types/xr_object/script/xr_script_interface.d.ts +819 -584
  76. package/types/xr_object/script/xr_script_object.d.ts +5728 -1390
  77. package/types/xr_object/script/xr_script_trade.d.ts +51 -26
  78. package/types/xr_object/server/xr_server_object.d.ts +1486 -792
  79. package/types/xr_ui/xr_ui_asset.d.ts +364 -123
  80. package/types/xr_ui/xr_ui_core.d.ts +424 -97
  81. package/types/xr_ui/xr_ui_event.d.ts +1449 -381
  82. package/types/xr_ui/xr_ui_interface.d.ts +2447 -903
  83. package/types/xr_ui/xr_ui_menu.d.ts +385 -142
  84. package/types/xrf_plugin.d.ts +89 -51
@@ -1,160 +1,272 @@
1
- declare module "xray16" {
2
- export const PROFILER_TYPE_NONE: 0;
3
- export const PROFILER_TYPE_HOOK: 1;
4
- export const PROFILER_TYPE_SAMPLING: 2;
5
-
6
- export type TXR_ProfilerType = typeof PROFILER_TYPE_NONE | typeof PROFILER_TYPE_HOOK | typeof PROFILER_TYPE_SAMPLING;
7
-
8
- /**
9
- * @source C++ class profile_timer
10
- * @customConstructor profile_timer
11
- * @group xr_profile
12
- */
13
- export class profile_timer extends EngineBinding {
14
- public constructor();
15
- public constructor(timer: profile_timer);
16
-
17
- public stop(): void;
18
-
19
- public start(): void;
20
-
21
- public time(): f32;
22
-
23
- /**
24
- * Overridden string cast is implemented for profiling timer.
25
- *
26
- * @returns serialized profile time.
27
- */
28
- public toString(): string;
29
- }
30
-
31
- /**
32
- * @source namespace profiler
33
- * @group xr_profile
34
- */
35
- export interface IXR_profiler {
36
- /**
37
- * @returns whether lua scripts profiler is active
38
- */
39
- is_active(this: void): boolean;
40
-
41
- /**
42
- * @returns currently active profiler type
43
- */
44
- get_type(this: void): typeof PROFILER_TYPE_NONE | typeof PROFILER_TYPE_HOOK | typeof PROFILER_TYPE_SAMPLING;
45
-
46
- /**
47
- * Start lua scripts profiler in default mode.
48
- */
49
- start(this: void): void;
50
-
51
- /**
52
- * Start lua scripts profiler of provided type.
53
- *
54
- * @param profiler_type - type of profiler to start (note: see global exports of type constants)
55
- */
56
- start(this: void, profiler_type: TXR_ProfilerType): void;
57
-
58
- /**
59
- * Start profiler in hook mode.
60
- * Profiling performance based on lua call start/end events.
61
- */
62
- start_hook_mode(this: void): void;
63
-
64
- /**
65
- * Start profiler in sampling mode with default sampling interval.
66
- */
67
- start_sampling_mode(this: void): void;
68
-
69
- /**
70
- * Start profiler in sampling mode with provided sampling interval value.
71
- *
72
- * @param sampling_interval - interval to collect samples with luaJIT sampling profiler
73
- */
74
- start_sampling_mode(this: void, sampling_interval: u32): void;
75
-
76
- /**
77
- * Stop currently active profiler.
78
- */
79
- stop(this: void): void;
80
-
81
- /**
82
- * Reset measurements data of profiler.
83
- */
84
- reset(this: void): void;
85
-
86
- /**
87
- * Log report of profiler measurements in game console/log file.
88
- * Use default engine limit to print top N entries.
89
- */
90
- log_report(this: void): void;
91
-
92
- /**
93
- * Log report of profiler measurements in game console/log file.
94
- *
95
- * @param entries_limit - limit of top profiling entries to print
96
- */
97
- log_report(this: void, entries_limit: u32): void;
98
-
99
- /**
100
- * Save report of profiler measurements in corresponding log/perf file.
101
- */
102
- save_report(this: void): void;
103
- }
104
-
105
- /**
106
- * @group xr_profile
107
- */
108
- export const profiler: IXR_profiler;
109
-
110
- /**
111
- * @source namespace profiler
112
- * @group xr_profile
113
- */
114
- export interface IXR_tracy {
115
- /**
116
- * Begin tracy profiling zone.
117
- */
118
- ZoneBegin(this: void): void;
119
-
120
- /**
121
- * Begin tracy profiling zone with defined name.
122
- *
123
- * @param name - name to display in tracy logs for current zone
124
- */
125
- ZoneBeginN(this: void, name: string): void;
126
-
127
- ZoneBeginS(this: void): void;
128
-
129
- ZoneBeginNS(this: void): void;
130
-
131
- /**
132
- * End tracy profiling zone.
133
- */
134
- ZoneEnd(this: void): void;
135
-
136
- /**
137
- * Set zone text.
138
- *
139
- * @param text - text description of the zone
140
- */
141
- ZoneText(this: void, text: string): void;
142
-
143
- /**
144
- * Set zone name on per-call basis.
145
- *
146
- * @param name - name of zone
147
- */
148
- ZoneName(this: void, name: string): void;
149
-
150
- /**
151
- * Send message to tracy profiler.
152
- */
153
- Message(this: void): void;
154
- }
155
-
156
- /**
157
- * @group xr_profile
158
- */
159
- export const tracy: IXR_tracy;
160
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * No Lua profiler is active.
4
+ *
5
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
6
+ *
7
+ * @source C++ enum CScriptProfilerType::None
8
+ * @group xr_profiler
9
+ */
10
+ export const PROFILER_TYPE_NONE: 0;
11
+
12
+ /**
13
+ * Hook-based Lua profiler.
14
+ *
15
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
16
+ *
17
+ * @source C++ enum CScriptProfilerType::Hook
18
+ * @group xr_profiler
19
+ */
20
+ export const PROFILER_TYPE_HOOK: 1;
21
+
22
+ /**
23
+ * LuaJIT sampling profiler.
24
+ *
25
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
26
+ *
27
+ * @source C++ enum CScriptProfilerType::Sampling
28
+ * @group xr_profiler
29
+ */
30
+ export const PROFILER_TYPE_SAMPLING: 2;
31
+
32
+ /**
33
+ * Lua profiler mode accepted by `profiler.start`.
34
+ *
35
+ * @source C++ enum CScriptProfilerType
36
+ * @group xr_profiler
37
+ */
38
+ export type TXR_ProfilerType = typeof PROFILER_TYPE_NONE | typeof PROFILER_TYPE_HOOK | typeof PROFILER_TYPE_SAMPLING;
39
+
40
+ /**
41
+ * Lightweight script profile timer.
42
+ *
43
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
44
+ *
45
+ * @source C++ class profile_timer
46
+ * @customConstructor profile_timer
47
+ * @group xr_profiler
48
+ *
49
+ * @remarks
50
+ * The timer accumulates elapsed microseconds between matching `start()` and `stop()` calls. Nested starts are counted
51
+ * and only the outermost stop adds elapsed time.
52
+ */
53
+ export class profile_timer extends EngineBinding {
54
+ /**
55
+ * Create a stopped profile timer.
56
+ */
57
+ public constructor();
58
+
59
+ /**
60
+ * Copy an existing timer.
61
+ *
62
+ * @param timer - Timer to copy.
63
+ */
64
+ public constructor(timer: profile_timer);
65
+
66
+ /**
67
+ * Stop measuring elapsed time.
68
+ *
69
+ * @remarks
70
+ * Calling `stop()` on a timer that was not started is ignored.
71
+ */
72
+ public stop(): void;
73
+
74
+ /**
75
+ * Start or restart measuring elapsed time.
76
+ *
77
+ * @remarks
78
+ * Calling `start()` while the timer is already running increases the recursion mark instead of restarting the
79
+ * underlying clock.
80
+ */
81
+ public start(): void;
82
+
83
+ /**
84
+ * @returns Elapsed time in microseconds.
85
+ */
86
+ public time(): f32;
87
+
88
+ /**
89
+ * Overridden string cast is implemented for profiling timer.
90
+ *
91
+ * @returns Serialized profile time.
92
+ */
93
+ public toString(): string;
94
+ }
95
+
96
+ /**
97
+ * Lua script profiler namespace.
98
+ *
99
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
100
+ *
101
+ * @source namespace profiler
102
+ * @group xr_profiler
103
+ *
104
+ * @remarks
105
+ * Requires an engine script profiler instance. Starting an already active profiler is ignored by the engine.
106
+ */
107
+ export interface IXR_profiler {
108
+ /**
109
+ * @returns Whether lua scripts profiler is active.
110
+ */
111
+ is_active(this: void): boolean;
112
+
113
+ /**
114
+ * @returns Currently active profiler type.
115
+ */
116
+ get_type(this: void): typeof PROFILER_TYPE_NONE | typeof PROFILER_TYPE_HOOK | typeof PROFILER_TYPE_SAMPLING;
117
+
118
+ /**
119
+ * Start lua scripts profiler in default mode.
120
+ *
121
+ * @remarks
122
+ * The default mode is hook profiling.
123
+ */
124
+ start(this: void): void;
125
+
126
+ /**
127
+ * Start lua scripts profiler of provided type.
128
+ *
129
+ * @remarks
130
+ * Passing `PROFILER_TYPE_NONE` does not start profiling and only logs a message.
131
+ *
132
+ * @param profiler_type - Type of profiler to start (note: see global exports of type constants).
133
+ */
134
+ start(this: void, profiler_type: TXR_ProfilerType): void;
135
+
136
+ /**
137
+ * Start profiler in hook mode.
138
+ * Profiling performance based on lua call start/end events.
139
+ *
140
+ * @remarks
141
+ * Hook mode attaches a Lua hook. If another hook is already installed, start may fail and only log the failure.
142
+ */
143
+ start_hook_mode(this: void): void;
144
+
145
+ /**
146
+ * Start profiler in sampling mode with default sampling interval.
147
+ *
148
+ * @remarks
149
+ * Sampling mode uses LuaJIT profiling. It cannot start when LuaJIT profiling is unavailable, for example with
150
+ * `-nojit`.
151
+ */
152
+ start_sampling_mode(this: void): void;
153
+
154
+ /**
155
+ * Start profiler in sampling mode with provided sampling interval value.
156
+ *
157
+ * @remarks
158
+ * The engine clamps the interval to its supported range.
159
+ *
160
+ * @param sampling_interval - Interval to collect samples with luaJIT sampling profiler.
161
+ */
162
+ start_sampling_mode(this: void, sampling_interval: u32): void;
163
+
164
+ /**
165
+ * Stop currently active profiler.
166
+ *
167
+ * @remarks
168
+ * Stopping clears collected profiling data. Calling it while inactive only logs a message.
169
+ */
170
+ stop(this: void): void;
171
+
172
+ /**
173
+ * Reset measurements data of profiler.
174
+ *
175
+ * @remarks
176
+ * Reset keeps the current profiling mode active and clears collected samples.
177
+ */
178
+ reset(this: void): void;
179
+
180
+ /**
181
+ * Log report of profiler measurements in game console/log file.
182
+ * Use default engine limit to print top N entries.
183
+ */
184
+ log_report(this: void): void;
185
+
186
+ /**
187
+ * Log report of profiler measurements in game console/log file.
188
+ *
189
+ * @param entries_limit - Limit of top profiling entries to print.
190
+ */
191
+ log_report(this: void, entries_limit: u32): void;
192
+
193
+ /**
194
+ * Save report of profiler measurements in corresponding log/perf file.
195
+ *
196
+ * @remarks
197
+ * Hook reports are saved under `$logs$` as `*_hook_profile.log`. Sampling reports are saved as
198
+ * `*_sampling_profile.perf`.
199
+ */
200
+ save_report(this: void): void;
201
+ }
202
+
203
+ /**
204
+ * Lua script profiler namespace.
205
+ *
206
+ * @since OpenXRay 2025-03-19, ac4ba75d, PR #1771
207
+ *
208
+ * @source namespace profiler
209
+ * @group xr_profiler
210
+ */
211
+ export const profiler: IXR_profiler;
212
+
213
+ /**
214
+ * @source namespace profiler
215
+ * @group xr_profiler
216
+ */
217
+ export interface IXR_tracy {
218
+ /**
219
+ * Begin tracy profiling zone.
220
+ */
221
+ ZoneBegin(this: void): void;
222
+
223
+ /**
224
+ * Begin tracy profiling zone with defined name.
225
+ *
226
+ * @param name - Name to display in tracy logs for current zone.
227
+ */
228
+ ZoneBeginN(this: void, name: string): void;
229
+
230
+ /**
231
+ * Begin a Tracy profiling zone with source location data.
232
+ */
233
+ ZoneBeginS(this: void): void;
234
+
235
+ /**
236
+ * Begin a named Tracy profiling zone with source location data.
237
+ */
238
+ ZoneBeginNS(this: void): void;
239
+
240
+ /**
241
+ * End tracy profiling zone.
242
+ */
243
+ ZoneEnd(this: void): void;
244
+
245
+ /**
246
+ * Set zone text.
247
+ *
248
+ * @param text - Text description of the zone.
249
+ */
250
+ ZoneText(this: void, text: string): void;
251
+
252
+ /**
253
+ * Set zone name on per-call basis.
254
+ *
255
+ * @param name - Name of zone.
256
+ */
257
+ ZoneName(this: void, name: string): void;
258
+
259
+ /**
260
+ * Send message to tracy profiler.
261
+ */
262
+ Message(this: void): void;
263
+ }
264
+
265
+ /**
266
+ * Tracy profiling namespace.
267
+ *
268
+ * @source namespace tracy
269
+ * @group xr_profiler
270
+ */
271
+ export const tracy: IXR_tracy;
272
+ }