xray16 1.5.3 → 1.6.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.
- package/README.md +6 -0
- package/package.json +1 -1
- package/plugins/optimize_return_ternary.d.ts +6 -0
- package/plugins/optimize_return_ternary.js +65 -0
- package/types/internal.d.ts +6 -0
- package/types/xr_ai/xr_action.d.ts +2 -1
- package/types/xr_ai/xr_alife.d.ts +6 -4
- package/types/xr_ai/xr_goap.d.ts +8 -6
- package/types/xr_ai/xr_memory.d.ts +4 -2
- package/types/xr_lib/xr_debug.d.ts +4 -2
- package/types/xr_lib/xr_fs.d.ts +9 -7
- package/types/xr_lib/xr_game.d.ts +4 -4
- package/types/xr_lib/xr_hit.d.ts +3 -1
- package/types/xr_lib/xr_ini.d.ts +4 -2
- package/types/xr_lib/xr_level.d.ts +5 -3
- package/types/xr_lib/xr_map.d.ts +3 -1
- package/types/xr_lib/xr_multiplayer.d.ts +5 -3
- package/types/xr_lib/xr_properties.d.ts +3 -1
- package/types/xr_lib/xr_save.d.ts +3 -1
- package/types/xr_lib/xr_sound.d.ts +9 -7
- package/types/xr_lib/xr_stats.ts +3 -1
- package/types/xr_lib/xr_task.d.ts +3 -1
- package/types/xr_lib/xr_type.d.ts +0 -5
- package/types/xr_object/client/xr_level.d.ts +3 -1
- package/types/xr_object/script/xr_script_interface.d.ts +518 -195
- package/types/xr_object/script/xr_script_object.d.ts +46 -63
- package/types/xr_object/server/xr_server_object.d.ts +5 -3
- package/types/xr_ui/xr_ui_core.d.ts +33 -31
- package/types/xr_ui/xr_ui_interface.d.ts +18 -16
- package/types/xr_ui/xr_ui_menu.d.ts +20 -4
- package/types/xrf_plugin.d.ts +3 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Nillable, Nullable } from "../internal";
|
|
2
|
+
|
|
1
3
|
declare module "xray16" {
|
|
2
4
|
/**
|
|
3
5
|
* Base UI window used by script-created controls.
|
|
@@ -682,7 +684,7 @@ declare module "xray16" {
|
|
|
682
684
|
* @param id - Window id.
|
|
683
685
|
* @returns Control instance, or `null` when not found or not matching.
|
|
684
686
|
*/
|
|
685
|
-
public GetListWnd(id: string): CUIListWnd
|
|
687
|
+
public GetListWnd(id: string): Nullable<CUIListWnd>;
|
|
686
688
|
|
|
687
689
|
/**
|
|
688
690
|
* Find a dialog window by id.
|
|
@@ -690,7 +692,7 @@ declare module "xray16" {
|
|
|
690
692
|
* @param id - Window id.
|
|
691
693
|
* @returns Control instance, or `null` when not found or not matching.
|
|
692
694
|
*/
|
|
693
|
-
public GetDialogWnd(id: string): CUIDialogWnd
|
|
695
|
+
public GetDialogWnd(id: string): Nullable<CUIDialogWnd>;
|
|
694
696
|
|
|
695
697
|
/**
|
|
696
698
|
* Find an edit box by id.
|
|
@@ -698,7 +700,7 @@ declare module "xray16" {
|
|
|
698
700
|
* @param id - Window id.
|
|
699
701
|
* @returns Control instance, or `null` when not found or not matching.
|
|
700
702
|
*/
|
|
701
|
-
public GetEditBox(id: string): CUIEditBox
|
|
703
|
+
public GetEditBox(id: string): Nullable<CUIEditBox>;
|
|
702
704
|
|
|
703
705
|
/**
|
|
704
706
|
* Find a list box by id.
|
|
@@ -706,7 +708,7 @@ declare module "xray16" {
|
|
|
706
708
|
* @param id - Window id.
|
|
707
709
|
* @returns Control instance, or `null` when not found or not matching.
|
|
708
710
|
*/
|
|
709
|
-
public GetListBox(id: string): CUIListBox
|
|
711
|
+
public GetListBox(id: string): Nullable<CUIListBox>;
|
|
710
712
|
|
|
711
713
|
/**
|
|
712
714
|
* Find a frame line by id.
|
|
@@ -714,7 +716,7 @@ declare module "xray16" {
|
|
|
714
716
|
* @param id - Window id.
|
|
715
717
|
* @returns Control instance, or `null` when not found or not matching.
|
|
716
718
|
*/
|
|
717
|
-
public GetFrameLineWnd(id: string): CUIFrameLineWnd
|
|
719
|
+
public GetFrameLineWnd(id: string): Nullable<CUIFrameLineWnd>;
|
|
718
720
|
|
|
719
721
|
/**
|
|
720
722
|
* Find a tab control by id.
|
|
@@ -722,7 +724,7 @@ declare module "xray16" {
|
|
|
722
724
|
* @param id - Window id.
|
|
723
725
|
* @returns Control instance, or `null` when not found or not matching.
|
|
724
726
|
*/
|
|
725
|
-
public GetTabControl(id: string): CUITabControl
|
|
727
|
+
public GetTabControl(id: string): Nullable<CUITabControl>;
|
|
726
728
|
|
|
727
729
|
/**
|
|
728
730
|
* Find a progress bar by id.
|
|
@@ -730,7 +732,7 @@ declare module "xray16" {
|
|
|
730
732
|
* @param id - Window id.
|
|
731
733
|
* @returns Control instance, or `null` when not found or not matching.
|
|
732
734
|
*/
|
|
733
|
-
public GetProgressBar(id: string): CUIProgressBar
|
|
735
|
+
public GetProgressBar(id: string): Nullable<CUIProgressBar>;
|
|
734
736
|
|
|
735
737
|
/**
|
|
736
738
|
* Find a frame window by id.
|
|
@@ -738,7 +740,7 @@ declare module "xray16" {
|
|
|
738
740
|
* @param id - Window id.
|
|
739
741
|
* @returns Control instance, or `null` when not found or not matching.
|
|
740
742
|
*/
|
|
741
|
-
public GetFrameWindow(id: string): CUIFrameWindow
|
|
743
|
+
public GetFrameWindow(id: string): Nullable<CUIFrameWindow>;
|
|
742
744
|
|
|
743
745
|
/**
|
|
744
746
|
* Find a static control by id.
|
|
@@ -746,7 +748,7 @@ declare module "xray16" {
|
|
|
746
748
|
* @param id - Window id.
|
|
747
749
|
* @returns Control instance, or `null` when not found or not matching.
|
|
748
750
|
*/
|
|
749
|
-
public GetStatic(id: string): CUIStatic
|
|
751
|
+
public GetStatic(id: string): Nullable<CUIStatic>;
|
|
750
752
|
}
|
|
751
753
|
|
|
752
754
|
/**
|
|
@@ -902,7 +904,7 @@ declare module "xray16" {
|
|
|
902
904
|
/**
|
|
903
905
|
* @returns Selected item, or `null` when nothing is selected.
|
|
904
906
|
*/
|
|
905
|
-
public GetSelectedItem(): T
|
|
907
|
+
public GetSelectedItem(): Nullable<T>;
|
|
906
908
|
|
|
907
909
|
/**
|
|
908
910
|
* @returns List item height.
|
|
@@ -1972,7 +1974,7 @@ declare module "xray16" {
|
|
|
1972
1974
|
/**
|
|
1973
1975
|
* @returns Current top input receiver, or `null` when no dialog owns input.
|
|
1974
1976
|
*/
|
|
1975
|
-
public TopInputReceiver(): CUIDialogWnd
|
|
1977
|
+
public TopInputReceiver(): Nullable<CUIDialogWnd>;
|
|
1976
1978
|
|
|
1977
1979
|
/**
|
|
1978
1980
|
* Set the main input receiver.
|
|
@@ -1983,12 +1985,12 @@ declare module "xray16" {
|
|
|
1983
1985
|
* @param window - Dialog window, or `null` to pop the current receiver.
|
|
1984
1986
|
* @param find_remove - Whether to remove the previous receiver if found.
|
|
1985
1987
|
*/
|
|
1986
|
-
public SetMainInputReceiver(window: CUIDialogWnd
|
|
1988
|
+
public SetMainInputReceiver(window: Nillable<CUIDialogWnd>, find_remove: boolean): void;
|
|
1987
1989
|
|
|
1988
1990
|
/**
|
|
1989
1991
|
* @returns Current main input receiver, or `null` when no dialog owns input.
|
|
1990
1992
|
*/
|
|
1991
|
-
public MainInputReceiver(): CUIDialogWnd
|
|
1993
|
+
public MainInputReceiver(): Nullable<CUIDialogWnd>;
|
|
1992
1994
|
|
|
1993
1995
|
/**
|
|
1994
1996
|
* Start or stop an in-game menu.
|
|
@@ -2300,12 +2302,12 @@ declare module "xray16" {
|
|
|
2300
2302
|
*
|
|
2301
2303
|
* @param dialog - Dialog window, or `null` to clear.
|
|
2302
2304
|
*/
|
|
2303
|
-
public SetActiveDialog(dialog: CUIWindow
|
|
2305
|
+
public SetActiveDialog(dialog: Nillable<CUIWindow>): void;
|
|
2304
2306
|
|
|
2305
2307
|
/**
|
|
2306
2308
|
* @returns Active PDA dialog window, or `null`.
|
|
2307
2309
|
*/
|
|
2308
|
-
public GetActiveDialog(): CUIWindow
|
|
2310
|
+
public GetActiveDialog(): Nullable<CUIWindow>;
|
|
2309
2311
|
}
|
|
2310
2312
|
|
|
2311
2313
|
/**
|
|
@@ -2327,7 +2329,7 @@ declare module "xray16" {
|
|
|
2327
2329
|
/**
|
|
2328
2330
|
* @returns Item currently being dragged, or `null`.
|
|
2329
2331
|
*/
|
|
2330
|
-
public get_drag_item(): game_object
|
|
2332
|
+
public get_drag_item(): Nullable<game_object>;
|
|
2331
2333
|
|
|
2332
2334
|
/**
|
|
2333
2335
|
* Highlight inventory cells containing a section in a slot list.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Nullable } from "../internal";
|
|
2
|
+
|
|
1
3
|
declare module "xray16" {
|
|
2
4
|
/**
|
|
3
5
|
* Main-menu options manager binding.
|
|
@@ -102,7 +104,7 @@ declare module "xray16" {
|
|
|
102
104
|
* @param fileName - Demo file name.
|
|
103
105
|
* @returns Demo info, or `null` when it cannot be read.
|
|
104
106
|
*/
|
|
105
|
-
public GetDemoInfo(fileName: string): demo_info
|
|
107
|
+
public GetDemoInfo(fileName: string): Nullable<demo_info>;
|
|
106
108
|
|
|
107
109
|
/**
|
|
108
110
|
* Get patch download progress.
|
|
@@ -209,7 +211,7 @@ declare module "xray16" {
|
|
|
209
211
|
*
|
|
210
212
|
* @returns Game object for the item, or `null` when the cell has no item.
|
|
211
213
|
*/
|
|
212
|
-
public CurrentItemAtCell(): game_object
|
|
214
|
+
public CurrentItemAtCell(): Nullable<game_object>;
|
|
213
215
|
|
|
214
216
|
/**
|
|
215
217
|
* Get an active custom HUD static by id.
|
|
@@ -217,7 +219,7 @@ declare module "xray16" {
|
|
|
217
219
|
* @param id - Static descriptor id.
|
|
218
220
|
* @returns Drawable wrapper, or `null` when missing.
|
|
219
221
|
*/
|
|
220
|
-
public GetCustomStatic(id: string): StaticDrawableWrapper
|
|
222
|
+
public GetCustomStatic(id: string): Nullable<StaticDrawableWrapper>;
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
225
|
* Hide the actor inventory menu.
|
|
@@ -358,7 +360,21 @@ declare module "xray16" {
|
|
|
358
360
|
* @returns Numeric `EMenuMode` value.
|
|
359
361
|
*/
|
|
360
362
|
get_menu_mode(this: void): number;
|
|
361
|
-
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Get the current main in-game HUD window.
|
|
366
|
+
*
|
|
367
|
+
* @source `src/xrGame/ui/UIActorMenu_script.cpp`, `ActorMenu.get_maingame`.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* The concrete `CUIMainIngameWnd` class is not declared as a Lua binding, so the returned pointer is typed as
|
|
371
|
+
* `unknown`.
|
|
372
|
+
*
|
|
373
|
+
* @throws When called without an active current game UI.
|
|
374
|
+
*
|
|
375
|
+
* @returns Main in-game HUD window pointer.
|
|
376
|
+
*/
|
|
377
|
+
get_maingame(this: void): unknown;
|
|
362
378
|
}
|
|
363
379
|
|
|
364
380
|
/**
|
package/types/xrf_plugin.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Nillable, Nullable } from "./internal";
|
|
2
|
+
|
|
1
3
|
declare global {
|
|
2
4
|
/**
|
|
3
5
|
* Current source file name injected at transpile time.
|
|
@@ -21,7 +23,7 @@ declare global {
|
|
|
21
23
|
* @param value - Value to check.
|
|
22
24
|
* @returns Whether value is `null` or `undefined`.
|
|
23
25
|
*/
|
|
24
|
-
function $isNil
|
|
26
|
+
function $isNil(value: unknown): value is Nillable<never>;
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Check whether a value is not nil-compatible in Lua and Jest runtimes.
|