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,98 +1,153 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class CArtefact : CGameObject
4
- * @customConstructor CArtefact
5
- * @group xr_artefact
6
- */
7
- export class CArtefact extends CGameObject {
8
- public constructor();
9
-
10
- public FollowByPath(a: string, b: i32, c: vector): void;
11
- public GetAfRank(): u8;
12
- public SwitchVisibility(to: boolean): void;
13
- }
14
-
15
- /**
16
- * @source C++ class CZudaArtefact : CArtefact
17
- * @customConstructor CZudaArtefact
18
- * @group xr_artefact
19
- */
20
- export class CZudaArtefact extends CArtefact {}
21
-
22
- /**
23
- * @source C++ class CThornArtefact : CArtefact
24
- * @customConstructor CThornArtefact
25
- * @group xr_artefact
26
- */
27
- export class CThornArtefact extends CArtefact {}
28
-
29
- /**
30
- * @source C++ class CBastArtefact : CArtefact
31
- * @customConstructor CBastArtefact
32
- * @group xr_artefact
33
- */
34
- export class CBastArtefact extends CArtefact {}
35
-
36
- /**
37
- * @source C++ class CBlackDrops : CArtefact
38
- * @customConstructor CBlackDrops
39
- * @group xr_artefact
40
- */
41
- export class CBlackDrops extends CArtefact {}
42
-
43
- /**
44
- * @source C++ class CBlackGraviArtefact : CArtefact
45
- * @customConstructor CBlackGraviArtefact
46
- * @group xr_artefact
47
- */
48
- export class CBlackGraviArtefact extends CArtefact {}
49
-
50
- /**
51
- * @source C++ class CDummyArtefact : CArtefact
52
- * @customConstructor CDummyArtefact
53
- * @group xr_artefact
54
- */
55
- export class CDummyArtefact extends CArtefact {}
56
-
57
- /**
58
- * @source C++ class CElectricBall : CArtefact
59
- * @customConstructor CElectricBall
60
- * @group xr_artefact
61
- */
62
- export class CElectricBall extends CArtefact {}
63
-
64
- /**
65
- * @source C++ class CFadedBall : CArtefact
66
- * @customConstructor CFadedBall
67
- * @group xr_artefact
68
- */
69
- export class CFadedBall extends CArtefact {}
70
-
71
- /**
72
- * @source C++ class CGalantineArtefact : CArtefact
73
- * @customConstructor CGalantineArtefact
74
- * @group xr_artefact
75
- */
76
- export class CGalantineArtefact extends CArtefact {}
77
-
78
- /**
79
- * @source C++ class CGraviArtefact : CArtefact
80
- * @customConstructor CGraviArtefact
81
- * @group xr_artefact
82
- */
83
- export class CGraviArtefact extends CArtefact {}
84
-
85
- /**
86
- * @source C++ class CMercuryBall : CArtefact
87
- * @customConstructor CMercuryBall
88
- * @group xr_artefact
89
- */
90
- export class CMercuryBall extends CArtefact {}
91
-
92
- /**
93
- * @source C++ class CRustyHairArtefact : CArtefact
94
- * @customConstructor CRustyHairArtefact
95
- * @group xr_artefact
96
- */
97
- export class CRustyHairArtefact extends CArtefact {}
98
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Client-side artefact object.
4
+ *
5
+ * @source C++ class CArtefact : CGameObject
6
+ * @customConstructor CArtefact
7
+ * @group xr_artefact
8
+ *
9
+ * @remarks
10
+ * Scripts usually reach this wrapper through `game_object.cast_Artefact()` after checking `is_artefact()`.
11
+ */
12
+ export class CArtefact extends CGameObject {
13
+ /**
14
+ * Create an artefact object wrapper.
15
+ */
16
+ public constructor();
17
+
18
+ /**
19
+ * Move the artefact along a patrol path.
20
+ *
21
+ * @remarks
22
+ * Requires a patrol path with the given name. The point index must refer to an existing path point.
23
+ *
24
+ * @param path_name - Patrol path name.
25
+ * @param point_index - Starting path point index.
26
+ * @param position - Initial position.
27
+ */
28
+ public FollowByPath(path_name: string, point_index: i32, position: vector): void;
29
+
30
+ /**
31
+ * @returns Artefact rank used by detectors and inventory UI.
32
+ */
33
+ public GetAfRank(): u8;
34
+
35
+ /**
36
+ * Show or hide the artefact.
37
+ *
38
+ * @remarks
39
+ * This changes the artefact's client visibility; it does not spawn or destroy the object.
40
+ *
41
+ * @param is_visible - New visibility state.
42
+ */
43
+ public SwitchVisibility(is_visible: boolean): void;
44
+ }
45
+
46
+ /**
47
+ * Client object binding for `CZudaArtefact` artefacts.
48
+ *
49
+ * @source C++ class CZudaArtefact : CArtefact
50
+ * @customConstructor CZudaArtefact
51
+ * @group xr_artefact
52
+ */
53
+ export class CZudaArtefact extends CArtefact {}
54
+
55
+ /**
56
+ * Client object binding for `CThornArtefact` artefacts.
57
+ *
58
+ * @source C++ class CThornArtefact : CArtefact
59
+ * @customConstructor CThornArtefact
60
+ * @group xr_artefact
61
+ */
62
+ export class CThornArtefact extends CArtefact {}
63
+
64
+ /**
65
+ * Client object binding for `CBastArtefact` artefacts.
66
+ *
67
+ * @source C++ class CBastArtefact : CArtefact
68
+ * @customConstructor CBastArtefact
69
+ * @group xr_artefact
70
+ */
71
+ export class CBastArtefact extends CArtefact {}
72
+
73
+ /**
74
+ * Client object binding for `CBlackDrops` artefacts.
75
+ *
76
+ * @source C++ class CBlackDrops : CArtefact
77
+ * @customConstructor CBlackDrops
78
+ * @group xr_artefact
79
+ */
80
+ export class CBlackDrops extends CArtefact {}
81
+
82
+ /**
83
+ * Client object binding for `CBlackGraviArtefact` artefacts.
84
+ *
85
+ * @source C++ class CBlackGraviArtefact : CArtefact
86
+ * @customConstructor CBlackGraviArtefact
87
+ * @group xr_artefact
88
+ */
89
+ export class CBlackGraviArtefact extends CArtefact {}
90
+
91
+ /**
92
+ * Client object binding for `CDummyArtefact` artefacts.
93
+ *
94
+ * @source C++ class CDummyArtefact : CArtefact
95
+ * @customConstructor CDummyArtefact
96
+ * @group xr_artefact
97
+ */
98
+ export class CDummyArtefact extends CArtefact {}
99
+
100
+ /**
101
+ * Client object binding for `CElectricBall` artefacts.
102
+ *
103
+ * @source C++ class CElectricBall : CArtefact
104
+ * @customConstructor CElectricBall
105
+ * @group xr_artefact
106
+ */
107
+ export class CElectricBall extends CArtefact {}
108
+
109
+ /**
110
+ * Client object binding for `CFadedBall` artefacts.
111
+ *
112
+ * @source C++ class CFadedBall : CArtefact
113
+ * @customConstructor CFadedBall
114
+ * @group xr_artefact
115
+ */
116
+ export class CFadedBall extends CArtefact {}
117
+
118
+ /**
119
+ * Client object binding for `CGalantineArtefact` artefacts.
120
+ *
121
+ * @source C++ class CGalantineArtefact : CArtefact
122
+ * @customConstructor CGalantineArtefact
123
+ * @group xr_artefact
124
+ */
125
+ export class CGalantineArtefact extends CArtefact {}
126
+
127
+ /**
128
+ * Client object binding for `CGraviArtefact` artefacts.
129
+ *
130
+ * @source C++ class CGraviArtefact : CArtefact
131
+ * @customConstructor CGraviArtefact
132
+ * @group xr_artefact
133
+ */
134
+ export class CGraviArtefact extends CArtefact {}
135
+
136
+ /**
137
+ * Client object binding for `CMercuryBall` artefacts.
138
+ *
139
+ * @source C++ class CMercuryBall : CArtefact
140
+ * @customConstructor CMercuryBall
141
+ * @group xr_artefact
142
+ */
143
+ export class CMercuryBall extends CArtefact {}
144
+
145
+ /**
146
+ * Client object binding for `CRustyHairArtefact` artefacts.
147
+ *
148
+ * @source C++ class CRustyHairArtefact : CArtefact
149
+ * @customConstructor CRustyHairArtefact
150
+ * @group xr_artefact
151
+ */
152
+ export class CRustyHairArtefact extends CArtefact {}
153
+ }
@@ -1,76 +1,207 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class DLL_Pure
4
- * @customConstructor DLL_Pure
5
- * @group xr_core
6
- */
7
- export class DLL_Pure extends EngineBinding {
8
- protected constructor();
9
- }
10
-
11
- /**
12
- * @source C++ class IRender_Visual
13
- * @group xr_client_object
14
- */
15
- export interface IXR_IRender_Visual {
16
- dcast_PKinematicsAnimated(): IKinematicsAnimated;
17
- }
18
-
19
- /**
20
- * @source C++ class CGameObject : DLL_Pure, ISheduled, ICollidable, IRenderable
21
- * @customConstructor CGameObject
22
- * @group xr_client_object
23
- */
24
- export class CGameObject extends DLL_Pure {
25
- public Visual(): IXR_IRender_Visual;
26
-
27
- public getEnabled(): boolean;
28
-
29
- public _construct(): DLL_Pure;
30
-
31
- public net_Import(net_packet: net_packet): void;
32
-
33
- public getVisible(): boolean;
34
-
35
- public net_Export(net_packet: net_packet): void;
36
-
37
- public net_Spawn(cse_abstract: cse_abstract): boolean;
38
-
39
- public use(object: CGameObject): boolean;
40
- }
41
-
42
- /**
43
- * Class to link client side object with script object entity.
44
- *
45
- * @source C++ class object_binder
46
- * @customConstructor object_binder
47
- * @group xr_client_object
48
- */
49
- export class object_binder<T = game_object> extends EngineBinding {
50
- public readonly object: T;
51
-
52
- public constructor(object: T);
53
-
54
- public save(packet: net_packet): void;
55
-
56
- public load(reader: reader): void;
57
-
58
- public update(delta: u32): void;
59
-
60
- public reload(section: string): void;
61
-
62
- public reinit(): void;
63
-
64
- public net_export(net_packet: net_packet): void;
65
-
66
- public net_save_relevant(): boolean;
67
-
68
- public net_destroy(): void;
69
-
70
- public net_Relcase(object: T): void;
71
-
72
- public net_spawn(object: cse_alife_object): boolean;
73
-
74
- public net_import(net_packet: net_packet): void;
75
- }
76
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Base engine object exposed for compatibility with script binders.
4
+ *
5
+ * @source C++ class DLL_Pure
6
+ * @customConstructor DLL_Pure
7
+ * @group xr_core
8
+ *
9
+ * @remarks
10
+ * Base for engine-owned client objects. Scripts normally receive derived objects from xray callbacks or casts.
11
+ */
12
+ export class DLL_Pure extends EngineBinding {
13
+ /**
14
+ * Engine-created base object.
15
+ */
16
+ protected constructor();
17
+ }
18
+
19
+ /**
20
+ * Render visual handle for client objects.
21
+ *
22
+ * @source C++ class IRender_Visual
23
+ * @group xr_client_object
24
+ *
25
+ * @remarks
26
+ * Visual handles are owned by the object. Treat returned cast interfaces as borrowed engine references.
27
+ */
28
+ export interface IXR_IRender_Visual {
29
+ /**
30
+ * Cast the visual to animated kinematics when supported.
31
+ *
32
+ * @remarks
33
+ * Runtime can return `null` when the visual is not animated even though older declarations expose a non-null type.
34
+ *
35
+ * @returns Animated kinematics interface.
36
+ */
37
+ dcast_PKinematicsAnimated(): IKinematicsAnimated;
38
+ }
39
+
40
+ /**
41
+ * Base client-side game object.
42
+ *
43
+ * @source C++ class CGameObject : DLL_Pure, ISheduled, ICollidable, IRenderable
44
+ * @customConstructor CGameObject
45
+ * @group xr_client_object
46
+ *
47
+ * @remarks
48
+ * Client-side object state is engine-owned. Use this wrapper for low-level engine callbacks; gameplay scripts usually
49
+ * work with `game_object` instead.
50
+ */
51
+ export class CGameObject extends DLL_Pure {
52
+ /**
53
+ * @returns Render visual assigned to the object.
54
+ */
55
+ public Visual(): IXR_IRender_Visual;
56
+
57
+ /**
58
+ * @returns Whether the object is enabled in the client object loop.
59
+ */
60
+ public getEnabled(): boolean;
61
+
62
+ /**
63
+ * Construct engine-side object state.
64
+ *
65
+ * @remarks
66
+ * Lifecycle hook used by the engine. Calling it from gameplay scripts can reinitialize native state unexpectedly.
67
+ *
68
+ * @returns Constructed base object.
69
+ */
70
+ public _construct(): DLL_Pure;
71
+
72
+ /**
73
+ * Import network state from a packet.
74
+ *
75
+ * @param net_packet - Source network packet.
76
+ */
77
+ public net_Import(net_packet: net_packet): void;
78
+
79
+ /**
80
+ * @returns Whether the object is visible.
81
+ */
82
+ public getVisible(): boolean;
83
+
84
+ /**
85
+ * Export network state to a packet.
86
+ *
87
+ * @param net_packet - Destination network packet.
88
+ */
89
+ public net_Export(net_packet: net_packet): void;
90
+
91
+ /**
92
+ * Spawn the client object from its server object.
93
+ *
94
+ * @remarks
95
+ * Lifecycle hook used during network spawn. Return `false` to reject spawn in custom subclasses.
96
+ *
97
+ * @param cse_abstract - Server object used for spawn data.
98
+ * @returns Whether spawn succeeded.
99
+ */
100
+ public net_Spawn(cse_abstract: cse_abstract): boolean;
101
+
102
+ /**
103
+ * Use another object through the engine interaction path.
104
+ *
105
+ * @param object - Object being used.
106
+ * @returns Whether the use action was handled.
107
+ */
108
+ public use(object: CGameObject): boolean;
109
+ }
110
+
111
+ /**
112
+ * Class to link client side object with script object entity.
113
+ *
114
+ * @source C++ class object_binder
115
+ * @customConstructor object_binder
116
+ * @group xr_client_object
117
+ *
118
+ * @remarks
119
+ * Script binders are callbacks attached to a `game_object`. The engine calls lifecycle methods; scripts usually
120
+ * override them in subclasses instead of invoking them directly.
121
+ */
122
+ export class object_binder<T = game_object> extends EngineBinding {
123
+ /**
124
+ * Script game object controlled by this binder.
125
+ */
126
+ public readonly object: T;
127
+
128
+ /**
129
+ * @param object - Script game object controlled by this binder.
130
+ */
131
+ public constructor(object: T);
132
+
133
+ /**
134
+ * Save binder state.
135
+ *
136
+ * @param packet - Destination save packet.
137
+ */
138
+ public save(packet: net_packet): void;
139
+
140
+ /**
141
+ * Load binder state.
142
+ *
143
+ * @param reader - Source save reader.
144
+ */
145
+ public load(reader: reader): void;
146
+
147
+ /**
148
+ * Update binder logic.
149
+ *
150
+ * @param delta - Time since last update in milliseconds.
151
+ */
152
+ public update(delta: u32): void;
153
+
154
+ /**
155
+ * Reload binder configuration.
156
+ *
157
+ * @param section - Object config section.
158
+ */
159
+ public reload(section: string): void;
160
+
161
+ /**
162
+ * Reinitialize binder runtime state.
163
+ */
164
+ public reinit(): void;
165
+
166
+ /**
167
+ * Export binder network state.
168
+ *
169
+ * @param net_packet - Destination network packet.
170
+ */
171
+ public net_export(net_packet: net_packet): void;
172
+
173
+ /**
174
+ * Decide whether binder state should be saved over the network.
175
+ *
176
+ * @returns Whether the state is relevant for network save.
177
+ */
178
+ public net_save_relevant(): boolean;
179
+
180
+ /**
181
+ * Handle client object destruction.
182
+ */
183
+ public net_destroy(): void;
184
+
185
+ /**
186
+ * Release references to a game object.
187
+ *
188
+ * @param object - Object being released.
189
+ */
190
+ public net_Relcase(object: T): void;
191
+
192
+ /**
193
+ * Handle network spawn.
194
+ *
195
+ * @param object - Server object used for spawn data.
196
+ * @returns Whether spawn succeeded.
197
+ */
198
+ public net_spawn(object: cse_alife_object): boolean;
199
+
200
+ /**
201
+ * Import binder network state.
202
+ *
203
+ * @param net_packet - Source network packet.
204
+ */
205
+ public net_import(net_packet: net_packet): void;
206
+ }
207
+ }