@wayward/types 2.14.2-beta.dev.20241222.1 → 2.14.3-beta

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 (95) hide show
  1. package/definitions/game/IGlobal.d.ts +3 -0
  2. package/definitions/game/event/EventBuses.d.ts +18 -10
  3. package/definitions/game/event/EventManager.d.ts +7 -5
  4. package/definitions/game/game/Game.d.ts +2 -0
  5. package/definitions/game/game/IGame.d.ts +2 -1
  6. package/definitions/game/game/entity/Entity.d.ts +11 -9
  7. package/definitions/game/game/entity/EntityWithStats.d.ts +2 -1
  8. package/definitions/game/game/entity/IEntity.d.ts +2 -1
  9. package/definitions/game/game/entity/action/ActionsRegistration.d.ts +1 -1
  10. package/definitions/game/game/entity/action/actions/StokeFire.d.ts +1 -1
  11. package/definitions/game/game/entity/action/actions/moveItem/MoveItemFilterArgument.d.ts +3 -0
  12. package/definitions/game/game/entity/action/usable/IUsableAction.d.ts +18 -2
  13. package/definitions/game/game/entity/action/usable/UsableAction.d.ts +19 -2
  14. package/definitions/game/game/entity/action/usable/UsableActionRegistrar.d.ts +7 -1
  15. package/definitions/game/game/entity/ai/AI.d.ts +4 -0
  16. package/definitions/game/game/entity/ai/AiManager.d.ts +2 -2
  17. package/definitions/game/game/entity/creature/Creature.d.ts +3 -3
  18. package/definitions/game/game/entity/creature/CreatureManager.d.ts +1 -1
  19. package/definitions/game/game/entity/npc/NPC.d.ts +5 -6
  20. package/definitions/game/game/entity/player/Player.d.ts +2 -2
  21. package/definitions/game/game/inspection/IInspection.d.ts +1 -4
  22. package/definitions/game/game/inspection/InfoProvider.d.ts +2 -1
  23. package/definitions/game/game/inspection/InspectionsHandler.d.ts +2 -1
  24. package/definitions/game/game/inspection/inspections/ActionInspection.d.ts +1 -0
  25. package/definitions/game/game/inspection/inspections/action/IActionInspection.d.ts +26 -0
  26. package/definitions/game/game/island/Island.d.ts +3 -0
  27. package/definitions/game/game/item/Item.d.ts +0 -1
  28. package/definitions/game/game/item/ItemFinder.d.ts +1 -1
  29. package/definitions/game/game/meta/SaveLoad.d.ts +1 -1
  30. package/definitions/game/game/options/IGameOptions.d.ts +6 -1
  31. package/definitions/game/language/Dictionary.d.ts +128 -127
  32. package/definitions/game/language/DictionaryMap.d.ts +252 -249
  33. package/definitions/game/language/Translation.d.ts +2 -2
  34. package/definitions/game/language/english/ui/ActionSlotItemMethods.d.ts +1 -1
  35. package/definitions/game/language/english/ui/ActionSlotTypes.d.ts +13 -0
  36. package/definitions/game/language/segment/BindSegment.d.ts +2 -2
  37. package/definitions/game/language/segment/InterpolateArgumentSegment.d.ts +2 -2
  38. package/definitions/game/language/segment/NumberSegment.d.ts +4 -4
  39. package/definitions/game/language/segment/ReferenceSegment.d.ts +2 -2
  40. package/definitions/game/language/segment/ReformatSegment.d.ts +2 -2
  41. package/definitions/game/language/segment/Segments.d.ts +1 -1
  42. package/definitions/game/language/segment/TranslationSegment.d.ts +4 -4
  43. package/definitions/game/mod/IMod.d.ts +2 -1
  44. package/definitions/game/renderer/RenderersNotifiers.d.ts +1 -1
  45. package/definitions/game/renderer/notifier/Notifier.d.ts +4 -1
  46. package/definitions/game/renderer/world/WorldRenderer.d.ts +4 -0
  47. package/definitions/game/resource/IResourceLoader.d.ts +51 -48
  48. package/definitions/game/save/data/SaveData.d.ts +2 -0
  49. package/definitions/game/save/data/SaveDataGlobal.d.ts +2 -0
  50. package/definitions/game/save/serializer/PropertiesToSerialize.d.ts +6 -0
  51. package/definitions/game/save/upgrade/UpgradeVersion.d.ts +6 -1
  52. package/definitions/game/save/upgrade/versions/beta2.14.0/_beta.2.14.0-dev20240828.d.ts +1 -1
  53. package/definitions/game/save/upgrade/versions/beta2.14.0/{beta2.14.0-dev1.d.ts → beta2.14.0-dev00000001.d.ts} +1 -1
  54. package/definitions/game/save/upgrade/versions/beta2.14.0/{beta2.14.0-dev2.d.ts → beta2.14.0-dev00000002.d.ts} +1 -1
  55. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240827.d.ts +1 -1
  56. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240828.d.ts +1 -1
  57. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240829.d.ts +1 -1
  58. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240901.d.ts +1 -1
  59. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240905.d.ts +1 -1
  60. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20241024.d.ts +1 -1
  61. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20241129.d.ts +1 -1
  62. package/definitions/game/save/upgrade/versions/beta2.14.3/beta2.14.3-dev20241223.d.ts +12 -0
  63. package/definitions/game/steamworks/ISteamworks.d.ts +1 -0
  64. package/definitions/game/steamworks/Steamworks.d.ts +15 -0
  65. package/definitions/game/ui/component/Component.d.ts +2 -0
  66. package/definitions/game/ui/component/ContextMenu.d.ts +1 -1
  67. package/definitions/game/ui/component/IComponent.d.ts +2 -1
  68. package/definitions/game/ui/old/OldUi.d.ts +1 -1
  69. package/definitions/game/ui/screen/screens/game/component/ItemComponent.d.ts +3 -99
  70. package/definitions/game/ui/screen/screens/game/component/container/ContainerBucketItemList.d.ts +6 -7
  71. package/definitions/game/ui/screen/screens/game/component/item/IItemComponent.d.ts +65 -0
  72. package/definitions/game/ui/screen/screens/game/component/item/ItemComponentEventBus.d.ts +39 -0
  73. package/definitions/game/ui/screen/screens/game/component/item/ItemComponentHandler.d.ts +46 -0
  74. package/definitions/game/ui/screen/screens/game/component/item/ItemComponentTradeManager.d.ts +32 -0
  75. package/definitions/game/ui/screen/screens/game/dialog/EquipmentDialog.d.ts +2 -2
  76. package/definitions/game/ui/screen/screens/game/static/actions/ActionSlot.d.ts +8 -10
  77. package/definitions/game/ui/screen/screens/game/static/actions/ActionSlotConfigurationColumn.d.ts +2 -1
  78. package/definitions/game/ui/screen/screens/game/static/actions/IActionsDrawer.d.ts +3 -3
  79. package/definitions/game/utilities/Version.d.ts +16 -7
  80. package/definitions/game/utilities/dev/Debug.d.ts +4 -0
  81. package/definitions/game/utilities/memory/MemoryLeakDetector.d.ts +1 -1
  82. package/definitions/game/utilities/object/Merge.d.ts +2 -0
  83. package/definitions/game/utilities/string/Interpolator.d.ts +37 -6
  84. package/definitions/hosts/shared/globalTypes.d.ts +4 -0
  85. package/definitions/hosts/shared/globals.d.ts +2 -2
  86. package/definitions/utilities/Errors.d.ts +10 -0
  87. package/definitions/utilities/Functions.d.ts +1 -1
  88. package/definitions/utilities/Log.d.ts +9 -0
  89. package/definitions/utilities/collection/map/IterableWeakMap.d.ts +35 -0
  90. package/definitions/utilities/collection/map/LimitedMap.d.ts +45 -0
  91. package/definitions/utilities/dev/DebugShared.d.ts +23 -0
  92. package/definitions/utilities/event/EventEmitter.d.ts +27 -3
  93. package/definitions/utilities/event/EventManager.d.ts +11 -1
  94. package/definitions/utilities/prototype/Define.d.ts +2 -0
  95. package/package.json +1 -1
@@ -22,6 +22,7 @@ import ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemCo
22
22
  import type { IDraggableComponentSubscriber, ISortableComponent, WithSortableEvents } from "@wayward/game/ui/util/Sortable";
23
23
  import Sortable from "@wayward/game/ui/util/Sortable";
24
24
  import { type IEventEmitter } from "@wayward/utilities/event/EventEmitter";
25
+ import type { IMoveItemFilterArgument } from "@wayward/game/game/entity/action/actions/moveItem/MoveItemFilterArgument";
25
26
  export declare enum ContainerBucketItemListClasses {
26
27
  Main = "container-bucket-item-list",
27
28
  Anchored = "container-bucket-item-list-anchored",
@@ -29,7 +30,7 @@ export declare enum ContainerBucketItemListClasses {
29
30
  ActualTransferDestination = "container-bucket-item-list-actual-transfer-destination",
30
31
  HasStackExpanded = "container-bucket-item-list-has-stack-expanded"
31
32
  }
32
- export interface IContainerBucketItemListTransferDetails {
33
+ export interface IContainerBucketItemListTransferDetails extends Omit<IMoveItemFilterArgument, "type"> {
33
34
  fromList?: ContainerBucketItemList;
34
35
  toList?: ContainerBucketItemList;
35
36
  fromContainer?: IContainer;
@@ -37,15 +38,11 @@ export interface IContainerBucketItemListTransferDetails {
37
38
  item?: Item;
38
39
  itemType: ItemType;
39
40
  moveAll: boolean;
40
- moveLimit?: number;
41
41
  stackList?: ContainerBucketItemList;
42
42
  quality?: Quality;
43
- text?: string;
44
- excludeProtected?: true;
45
43
  index?: number;
46
44
  silent?: true;
47
45
  hidden?: true;
48
- excludeEquipped?: boolean;
49
46
  }
50
47
  export interface IContainerBucketItemListEvents extends WithSortableEvents<Component> {
51
48
  addItem(item: Item): any;
@@ -81,9 +78,10 @@ export default class ContainerBucketItemList extends Component implements ISorta
81
78
  private containerRef?;
82
79
  get container(): IContainer | undefined;
83
80
  isStacked(type?: ItemType): boolean;
81
+ /**
82
+ * Returns whether this item's type is stacked in this container, *and* this item is not protected.
83
+ */
84
84
  isStacked(item?: Item): boolean;
85
- isFirstVisiblyStacked(item?: Item, excluding?: Item): boolean;
86
- getStackedItemsThatAreVisible(type?: ItemType, excluding?: Item): Item[];
87
85
  getStackedItems(type?: ItemType, excluding?: Item): Item[];
88
86
  getStackIndex(type?: ItemType): number | undefined;
89
87
  constructor(container?: IContainer);
@@ -148,6 +146,7 @@ export default class ContainerBucketItemList extends Component implements ISorta
148
146
  private getItemIdsInElements;
149
147
  private getItemElementId;
150
148
  private getItemComponentElements;
149
+ private getItemComponentById;
151
150
  private regenerate;
152
151
  private transfer;
153
152
  private getSorter;
@@ -0,0 +1,65 @@
1
+ /*!
2
+ * Copyright 2011-2024 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ export declare enum ItemDetailIconLocation {
12
+ TopLeft = 0,
13
+ BottomRight = 1
14
+ }
15
+ export declare enum ItemClasses {
16
+ Main = "item-component",
17
+ _InHeading = "item-component--in-heading",
18
+ Active = "active",// currently used for crafting & trading
19
+ Icon = "item-component-icon",
20
+ ItemIconIsReal = "item-component-icon-item-is-real",
21
+ ActionIcon = "item-component-icon-action",
22
+ ActionIconAnyItem = "item-component-icon-action-any-item",
23
+ ActionIconMissingItem = "item-component-icon-action-missing-item",
24
+ ActionIconHasItem = "item-component-icon-action-has-item",
25
+ ActionIconNone = "item-component-icon-action-none",
26
+ TargetIcon = "item-component-icon-target",
27
+ TargetIcon_Creature = "item-component-icon-target--creature",
28
+ TargetIcon_Doodad = "item-component-icon-target--doodad",
29
+ TargetIcon_Vehicle = "item-component-icon-target--vehicle",
30
+ TargetIcon_Plant = "item-component-icon-target--plant",
31
+ TargetIcon_NPC = "item-component-icon-target--npc",
32
+ TargetIcon_TileEvent = "item-component-icon-target--tile-event",
33
+ SlottedIcon = "item-component-icon-slotted",
34
+ Equipped = "item-component-equipped",
35
+ EquipIcon = "item-component-icon-equip",
36
+ EquipIconHasItem = "item-component-icon-equip-has-item",
37
+ MagicalIcon = "item-component-icon-magical",
38
+ ProtectedIcon = "item-component-icon-protected",
39
+ Trading = "item-component-trading",
40
+ TradingIcon = "item-component-icon-trading",
41
+ TradingIconFromMerchant = "item-component-icon-trading-from-merchant",
42
+ TradingIconToMerchant = "item-component-icon-trading-to-merchant",
43
+ Slot = "item-component-slot",
44
+ Dragging = "item-component-dragging",
45
+ DragPreview = "item-component-drag-preview",
46
+ DragPreview_Small = "item-component-drag-preview--small",
47
+ StatBar = "item-component-stat-bar",
48
+ StatBars = "item-component-stat-bars-wrapper",
49
+ DecayBar = "item-component-stat-bar-decay",
50
+ CooldownBar = "item-component-stat-bar-cooldown",
51
+ DurabilityBar = "item-component-stat-bar-durability",
52
+ NearlyDestroyed = "item-component-nearly-destroyed",
53
+ NearlyDecayed = "item-component-nearly-decayed",
54
+ Transient = "item-component-transient",
55
+ Highlight = "item-component-highlight",
56
+ Stack = "item-component-stack",
57
+ StackQuantity = "item-component-stack-quantity",
58
+ StackQuantityX = "item-component-stack-quantity-x",
59
+ StackQuantityDigit = "item-component-stack-quantity-digit",
60
+ Stacked = "item-component-stacked",
61
+ StackedVisible = "item-component-stacked-visible"
62
+ }
63
+ export declare namespace ItemClasses {
64
+ const IconLocation: (enumValue: ItemDetailIconLocation) => "item-component-icon-location-topleft" | "item-component-icon-location-bottomright";
65
+ }
@@ -0,0 +1,39 @@
1
+ /*!
2
+ * Copyright 2011-2024 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ import type { GlobalMouseInfo } from "@wayward/game/ui/input/InputManager";
12
+ import { type ItemRefreshType } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
13
+ import type ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
14
+ import type ActionBar from "@wayward/game/ui/screen/screens/game/static/ActionBar";
15
+ import type { ActionSlot } from "@wayward/game/ui/screen/screens/game/static/actions/ActionSlot";
16
+ import EventEmitter from "@wayward/utilities/event/EventEmitter";
17
+ interface IItemComponentEventBusEvents {
18
+ update(type: ItemRefreshType): any;
19
+ changeHovered(): any;
20
+ }
21
+ declare namespace _ {
22
+ class ItemComponentEventBus extends EventEmitter.Host<IItemComponentEventBusEvents> {
23
+ private readonly items;
24
+ private readonly itemsForTickEndEvents;
25
+ registerItem(component: ItemComponent): void;
26
+ registerForTickEndEvents(component: ItemComponent): void;
27
+ deregisterForTickEndEvents(component: ItemComponent): void;
28
+ protected onUpdate(type: ItemRefreshType): void;
29
+ protected onSlotUpdate(actionBar: ActionBar, slot: ActionSlot): void;
30
+ protected onTickEnd(): void;
31
+ protected onLoadedOnIsland(): void;
32
+ protected onActionBarItemSlottedMapUpdate(): void;
33
+ private hovered;
34
+ protected onUpdateTarget(mouse: GlobalMouseInfo): void;
35
+ }
36
+ }
37
+ type ItemComponentEventBus = _.ItemComponentEventBus;
38
+ declare function ItemComponentEventBus(): ItemComponentEventBus;
39
+ export default ItemComponentEventBus;
@@ -0,0 +1,46 @@
1
+ /*!
2
+ * Copyright 2011-2024 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ import type UsableAction from "@wayward/game/game/entity/action/usable/UsableAction";
12
+ import type { EquipType } from "@wayward/game/game/entity/IHuman";
13
+ import type { Quality } from "@wayward/game/game/IObject";
14
+ import type { ItemTypeExtra, IContainer } from "@wayward/game/game/item/IItem";
15
+ import { ItemType } from "@wayward/game/game/item/IItem";
16
+ import type Item from "@wayward/game/game/item/Item";
17
+ import type Bindable from "@wayward/game/ui/input/Bindable";
18
+ import type { ActionSlot } from "@wayward/game/ui/screen/screens/game/static/actions/ActionSlot";
19
+ import type Sortable from "@wayward/game/ui/util/Sortable";
20
+ export interface IItemComponentHandlerDescription {
21
+ noDrag?: true;
22
+ equipSlot?: EquipType;
23
+ hasHighlight?: SupplierOr<boolean>;
24
+ getItem?(): Item | undefined;
25
+ getItemType?(): ItemType | ItemTypeExtra | undefined;
26
+ getItemQuality?(): ArrayOr<Quality> | undefined;
27
+ getAction?(): UsableAction | undefined;
28
+ getActionSlot?(): ActionSlot | undefined;
29
+ getBindables?(bindables: Bindable[]): Bindable[];
30
+ getSortable?(): Sortable;
31
+ getStackQuantity?(): number;
32
+ getContainer?(): IContainer | undefined;
33
+ getStackItems?(): readonly Item[];
34
+ getStackDisplayItem?(): Item | undefined;
35
+ getDisplayItem?(): Item | undefined;
36
+ getDurability?(): number;
37
+ getCooldown?(): number;
38
+ isDamaged?(): boolean;
39
+ isDecayed?(): boolean;
40
+ }
41
+ export interface ItemComponentHandler extends IItemComponentHandlerDescription {
42
+ }
43
+ export declare class ItemComponentHandler {
44
+ readonly isItemComponentHandler = true;
45
+ constructor(description?: IItemComponentHandlerDescription);
46
+ }
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright 2011-2024 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ import type Human from "@wayward/game/game/entity/Human";
12
+ import type MerchantNPC from "@wayward/game/game/entity/npc/npcs/Merchant";
13
+ import type Item from "@wayward/game/game/item/Item";
14
+ import { ItemTradeType } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
15
+ import WeakishSet from "@wayward/utilities/collection/set/WeakishSet";
16
+ declare namespace _ {
17
+ class ItemComponentTradeManager {
18
+ private readonly tradingByItem;
19
+ private readonly tradingToMerchant;
20
+ private readonly tradingFromMerchant;
21
+ getTrading(merchant: MerchantNPC, type: ItemTradeType): WeakishSet<Item> | undefined;
22
+ getTradeType(item: Item): ItemTradeType | undefined;
23
+ isTrading(item: Item, merchant: MerchantNPC): boolean;
24
+ toggleTrading(items: Item[], merchant: MerchantNPC, trading: ItemTradeType): ItemTradeType;
25
+ private sendMerchantChatMessage;
26
+ clearTrading(merchant?: MerchantNPC): void;
27
+ onTrade(merchant: MerchantNPC, human: Human): void;
28
+ }
29
+ }
30
+ type ItemComponentTradeManager = _.ItemComponentTradeManager;
31
+ declare function ItemComponentTradeManager(): ItemComponentTradeManager;
32
+ export default ItemComponentTradeManager;
@@ -14,8 +14,8 @@ import Component from "@wayward/game/ui/component/Component";
14
14
  import type { IBindHandlerApi } from "@wayward/game/ui/input/Bind";
15
15
  import Bindable from "@wayward/game/ui/input/Bindable";
16
16
  import Dialog from "@wayward/game/ui/screen/screens/game/component/Dialog";
17
- import type { IItemDropApi, IItemPickUpApi, ItemSlot } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
18
- import ItemComponent, { ItemRefreshType } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
17
+ import { ItemRefreshType, type IItemDropApi, type IItemPickUpApi, type ItemSlot } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
18
+ import ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
19
19
  import EquipmentSlotTooltipHandler from "@wayward/game/ui/screen/screens/game/dialog/equipment/EquipmentSlotTooltip";
20
20
  import { MenuBarButtonType } from "@wayward/game/ui/screen/screens/game/static/menubar/IMenuBarButton";
21
21
  export declare enum EquipmentClasses {
@@ -25,10 +25,12 @@ import Component from "@wayward/game/ui/component/Component";
25
25
  import type { IRefreshable } from "@wayward/game/ui/component/Refreshable";
26
26
  import Text from "@wayward/game/ui/component/Text";
27
27
  import type { IBindHandlerApi } from "@wayward/game/ui/input/Bind";
28
- import type { IItemSlotEvents, ItemSlot } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
29
- import ItemComponent, { ItemComponentHandler } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
28
+ import { type IItemSlotEvents, type ItemSlot } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
29
+ import ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
30
+ import { ItemComponentHandler } from "@wayward/game/ui/screen/screens/game/component/item/ItemComponentHandler";
30
31
  import type ActionBar from "@wayward/game/ui/screen/screens/game/static/ActionBar";
31
32
  import { ActionSlotUpdateReason, IActionBarSlotData } from "@wayward/game/ui/screen/screens/game/static/actions/IActionBar";
33
+ import { ActionSlotInternalType } from "@wayward/game/ui/screen/screens/game/static/actions/IActionsDrawer";
32
34
  import type TooltipLocationHandler from "@wayward/game/ui/tooltip/TooltipLocationHandler";
33
35
  import type { Events, IEventEmitter } from "@wayward/utilities/event/EventEmitter";
34
36
  export declare enum ActionSlotClasses {
@@ -49,10 +51,6 @@ export declare enum ActionSlotClasses {
49
51
  History_Cleared = "game-action-slot-history--cleared",
50
52
  ItemComponent = "game-action-slot-item-component"
51
53
  }
52
- export declare enum ActionSlotType {
53
- Normal = 0,
54
- History = 1
55
- }
56
54
  export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
57
55
  update(data: IActionBarSlotData | undefined, oldData: IActionBarSlotData | undefined, reason: ActionSlotUpdateReason): any;
58
56
  unequipItem(): any;
@@ -61,9 +59,9 @@ export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
61
59
  export declare class ActionSlot extends Button implements IRefreshable, ItemSlot {
62
60
  readonly number: number;
63
61
  slotData: IActionBarSlotData;
64
- readonly type: ActionSlotType;
62
+ readonly type: ActionSlotInternalType;
65
63
  static getHovered(): ActionSlot | undefined;
66
- static tryCreate(number: number, slotData: IActionBarSlotData, type?: ActionSlotType): ActionSlot;
64
+ static tryCreate(number: number, slotData: IActionBarSlotData, type?: ActionSlotInternalType): ActionSlot;
67
65
  event: IEventEmitter<this, IActionSlotEvents>;
68
66
  private get actionBar();
69
67
  readonly label: Text;
@@ -75,7 +73,7 @@ export declare class ActionSlot extends Button implements IRefreshable, ItemSlot
75
73
  private lastItem?;
76
74
  private lastQuality?;
77
75
  usability: ReturnableUsableActionUsability;
78
- protected constructor(number: number, slotData: IActionBarSlotData, type?: ActionSlotType);
76
+ protected constructor(number: number, slotData: IActionBarSlotData, type?: ActionSlotInternalType);
79
77
  isTransientSlot(): boolean;
80
78
  getItemComponent(): ItemComponent | undefined;
81
79
  private skipNextClick;
@@ -119,7 +117,7 @@ export declare class ActionSlot extends Button implements IRefreshable, ItemSlot
119
117
  getActionId(): ActionId | undefined;
120
118
  getInternalActionType(): ActionType | undefined;
121
119
  private usingCache?;
122
- getUsing(fresh?: true): IUsableActionPossibleUsing | undefined;
120
+ getUsing(fresh?: true, forceWithHoveredTile?: true): IUsableActionPossibleUsing | undefined;
123
121
  private getBindingText;
124
122
  }
125
123
  declare class ActionSlotSlottedContainer extends ItemComponent {
@@ -22,8 +22,9 @@ import HorizontalLine from "@wayward/game/ui/component/HorizontalLine";
22
22
  import RangeChoiceList from "@wayward/game/ui/component/RangeChoiceList";
23
23
  import Text, { Heading, Paragraph } from "@wayward/game/ui/component/Text";
24
24
  import ItemDropdown from "@wayward/game/ui/component/dropdown/ItemDropdown";
25
- import type { IItemComponentHandlerDescription, IItemDropApi, IItemSlotEvents, ItemSlot } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
25
+ import type { IItemDropApi, ItemSlot, IItemSlotEvents } from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
26
26
  import ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemComponent";
27
+ import type { IItemComponentHandlerDescription } from "@wayward/game/ui/screen/screens/game/component/item/ItemComponentHandler";
27
28
  import type { Events, IEventEmitter } from "@wayward/utilities/event/EventEmitter";
28
29
  export declare enum ActionSlotConfigurationColumnClasses {
29
30
  Main = "game-action-configuration-drawer-configuration-column",
@@ -11,7 +11,7 @@
11
11
  export declare enum ActionSort {
12
12
  Default = 0
13
13
  }
14
- export declare enum ActionSlotItemMethod {
15
- ExactItem = 0,
16
- AnyItem = 1
14
+ export declare enum ActionSlotInternalType {
15
+ Normal = 0,
16
+ History = 1
17
17
  }
@@ -9,6 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
12
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
12
13
  export interface IVersionInfo {
13
14
  str: Version.String;
14
15
  strSemver: Version.StringSemVer;
@@ -22,6 +23,12 @@ export interface IVersionInfo {
22
23
  * A number representing the patch (if beta) or minor (if release), used when the stage is not known
23
24
  */
24
25
  update?: number;
26
+ buildId?: IBuildId;
27
+ }
28
+ export declare namespace IVersionInfo {
29
+ interface WithBuildId extends IVersionInfo {
30
+ buildId: IBuildId;
31
+ }
25
32
  }
26
33
  declare namespace Version {
27
34
  export type Stage = "beta" | "release";
@@ -29,8 +36,10 @@ declare namespace Version {
29
36
  export type StringSemVer = `${bigint}.${bigint}.${bigint}-${Stage}` | `${bigint}.${bigint}.${bigint}`;
30
37
  export type Month = "jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" | "aug" | "sep" | "oct" | "nov" | "dec";
31
38
  export type DateString = `${Month} ${bigint} ${bigint} ${bigint | "00"}:${bigint | "00"}`;
39
+ export type StringBuildId = `${String}-dev${bigint}.${bigint}` | `${String}-dev${bigint}`;
32
40
  export const versionInfoRegExp: RegExp;
33
41
  export const versionInfoRegExpSemver: RegExp;
42
+ export const versionInfoWithBuildIdRegExp: RegExp;
34
43
  /**
35
44
  * Returns whether the given version is compatible with the game's version. This is used to check, for example,
36
45
  * if a mod is compatible with the game's version.
@@ -46,20 +55,20 @@ declare namespace Version {
46
55
  * - Compatible versions in "beta" stage require identical stage, major, minor, and a patch less than or equal to the current patch.
47
56
  * - Compatible versions in "release" stage require identical stage and major, and a minor and patch less than or equal to the current minor and patch.
48
57
  */
49
- export function is(versionA: IVersionInfo | Version.String | Version.StringSemVer, versionB: IVersionInfo | Version.String | Version.StringSemVer): boolean;
58
+ export function is(versionA?: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId, versionB?: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): boolean;
50
59
  /**
51
60
  * Returns whether the given `version` is `atLeast` another version. This can be used, for example,
52
61
  * to see if a save or mod was created/edited after a specific thing was implemented.
53
62
  */
54
- export function isAtLeast(version: IVersionInfo | Version.String | Version.StringSemVer, atLeast: IVersionInfo | Version.String | Version.StringSemVer): boolean;
63
+ export function isAtLeast(version: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId, atLeast: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): boolean;
55
64
  /**
56
65
  * Returns if `checkVersion` is older than `isBefore`
57
66
  */
58
67
  export function isBefore(checkVersion: IVersionInfo | Version.String | Version.StringSemVer, isBefore: IVersionInfo | Version.String | Version.StringSemVer): boolean;
59
68
  export function createRawVersionInfo(stage: Version.Stage, major: number, minor: number, patch?: number, date?: Date): IVersionInfo;
60
- export function convertStringToRawInfo(version: Version.String | Version.StringSemVer): IVersionInfo;
69
+ export function convertStringToRawInfo(version: Version.String | Version.StringSemVer | Version.StringBuildId): IVersionInfo;
61
70
  export function create(stage: Version.Stage, major: number, minor: number, patch?: number, date?: Date): Info;
62
- export function getVersionInfo(version: IVersionInfo | Version.String | Version.StringSemVer): Info;
71
+ export function getVersionInfo(version: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): Info;
63
72
  export function isSameVersion(version: IVersionInfo, compareVersion: IVersionInfo): boolean;
64
73
  export function getVersionDisplayTranslation(version?: Version.String | Version.StringSemVer | IVersionInfo, development?: boolean): TranslationImpl;
65
74
  export function getUpdateDisplayTranslation(version?: Version.String | Version.StringSemVer | IVersionInfo): TranslationImpl | undefined;
@@ -85,16 +94,16 @@ declare namespace Version {
85
94
  * Returns whether this version is greater than or equal to the given version. This can be used, for example,
86
95
  * to see if a save or mod was created/edited after a specific thing was implemented.
87
96
  */
88
- isAtLeast(version: IVersionInfo | Version.String | Version.StringSemVer): boolean;
97
+ isAtLeast(version: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): boolean;
89
98
  /**
90
99
  * Returns whether this version is greater than or equal to the given version. This can be used, for example,
91
100
  * to see if a save or mod was created/edited after a specific thing was implemented.
92
101
  */
93
- is(version: IVersionInfo | Version.String | Version.StringSemVer): boolean;
102
+ is(version: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): boolean;
94
103
  /**
95
104
  * Returns whether this version is older than the given version.
96
105
  */
97
- isBefore(version: IVersionInfo | Version.String | Version.StringSemVer): boolean;
106
+ isBefore(version: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): boolean;
98
107
  /**
99
108
  * Returns whether this version is older than the given build time.
100
109
  *
@@ -8,8 +8,12 @@
8
8
  * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
+ import DebugShared from "@wayward/utilities/dev/DebugShared";
11
12
  declare namespace Debug {
12
13
  function typeIfRelevant(type: string, name: string): string | undefined;
13
14
  function where(thing: unknown): string | undefined;
15
+ type JIT = DebugShared.JIT;
16
+ const JIT: typeof DebugShared.JIT;
17
+ const isJIT: typeof DebugShared.isJIT;
14
18
  }
15
19
  export default Debug;
@@ -26,7 +26,7 @@ declare class MemoryLeakDetector {
26
26
  onScreenShow(_: any, screen: Screen): Promise<any>;
27
27
  private onReset;
28
28
  private runCheck;
29
- garbageCollect(): Promise<void>;
29
+ garbageCollect(source: string): Promise<void>;
30
30
  private checkObjects;
31
31
  }
32
32
  export declare const memoryLeakDetector: MemoryLeakDetector;
@@ -34,6 +34,8 @@ declare namespace Merge {
34
34
  */
35
35
  function MULTIPLY_NON_ZERO(amt: number): Mergeable<number> & number;
36
36
  function DIVIDE(amt: number): Mergeable<number> & number;
37
+ function MIN(amt: number): Mergeable<number> & number;
38
+ function MAX(amt: number): Mergeable<number> & number;
37
39
  function CONCAT(str: string): Mergeable<string> & string;
38
40
  /**
39
41
  * Note: "PUSH" is used by default for merging array values.
@@ -23,12 +23,13 @@ export interface IInterpolationOptions {
23
23
  formatDates?: boolean;
24
24
  }
25
25
  export type Ends = [start: string, end?: string, endAtStringEnd?: true];
26
- export interface ISegment {
26
+ export interface ISegment<T = unknown> {
27
27
  ends?: Ends[];
28
28
  trimTrailingWhitespace?: true;
29
- match?: RegExp;
30
- handle(match: RegExpMatchArray, segment: string, api: ISegmentApi, ...args: any[]): string | IStringSection | Iterable<IStringSection>;
29
+ match?: RegExp | ((segment: string) => T | undefined);
30
+ handle(match: T, segment: string, api: ISegmentApi, ...args: any[]): string | IStringSection | Iterable<IStringSection>;
31
31
  }
32
+ export type IRegexSegment = ISegment<RegExpExecArray>;
32
33
  export interface IStringSection {
33
34
  content: string | IStringSection[];
34
35
  classes?: Set<string>;
@@ -92,12 +93,42 @@ export default Interpolator;
92
93
  * - `"{test}" => args[0]["test"]`
93
94
  * - `"{3.test.4.wow}" => args[3]["test"][4]["wow"]`
94
95
  */
95
- export declare const argumentSegment: ISegment;
96
+ export declare const argumentSegment: IRegexSegment;
96
97
  export type InterpolationConditionalSegmentOperator = InterpolationConditionalSegmentOperatorEquivalence | InterpolationConditionalSegmentOperatorNumeric;
97
98
  export type InterpolationConditionalSegmentOperatorEquivalence = "=" | "!=";
98
99
  export type InterpolationConditionalSegmentOperatorNumeric = "<" | ">" | "<=" | ">=";
99
- export declare const conditionalSegment: ISegment;
100
- export declare const falsyCoalescingSegment: ISegment;
100
+ export type ConditionalSegmentCheck = string | {
101
+ variable: string;
102
+ operator: InterpolationConditionalSegmentOperator;
103
+ value: string;
104
+ variable2?: never;
105
+ } | {
106
+ variable: string;
107
+ operator: InterpolationConditionalSegmentOperator;
108
+ variable2: string;
109
+ value?: never;
110
+ };
111
+ export interface IConditionalSegmentExpression {
112
+ checks: ConditionalSegmentCheck[];
113
+ operator: "&" | "|";
114
+ length: number;
115
+ }
116
+ /**
117
+ * Uses an argument to determine whether to show one of two segments. If the argument is truthy, returns
118
+ * any content in the segment after the `?` and before the `:`. If the argument is falsey, returns any
119
+ * content in the segment after the `:`. The colon is optional; if not provided, falsey = empty string.
120
+ *
121
+ * - `"{0?hi}"`
122
+ * - When given `[true]`, `=> "hi"`
123
+ * - When given `[false]`, `=> ""`
124
+ * - When given `[]`, `=> ""`
125
+ * - `"{test?hi:bye}"
126
+ * - When given `[{test: true}]`, `=> "hi"`
127
+ * - When given `[{test: false}]`, `=> "bye"`
128
+ * - When given `[]`, `=> "bye"`
129
+ */
130
+ export declare const conditionalSegment: ISegment<IConditionalSegmentExpression>;
131
+ export declare const falsyCoalescingSegment: IRegexSegment;
101
132
  export declare const classSegment: ISegment;
102
133
  export declare const basicInterpolator: Interpolator;
103
134
  export declare function interpolateSectioned(str: string, ...args: any[]): IStringSection[];
@@ -42,6 +42,10 @@ export interface IWaywardTitleBar {
42
42
  isMaximized: boolean;
43
43
  electron: IElectron;
44
44
  }
45
+ export interface IBuildId {
46
+ date: number;
47
+ number: number;
48
+ }
45
49
  declare global {
46
50
  interface Window {
47
51
  require: any;
@@ -9,8 +9,8 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type { IWaywardTitle } from "@wayward/hosts/shared/globalTypes";
12
- export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 14, gameVersionPatch = 2, gameVersionName = "Runekeeper", gameVersionColor = 11015763;
13
- export declare const gameVersion = "beta2.14.2";
12
+ export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 14, gameVersionPatch = 3, gameVersionName = "Runekeeper", gameVersionColor = 11015763;
13
+ export declare const gameVersion = "beta2.14.3";
14
14
  export declare const gameVersionTitleMajor = "Wayward: Runekeeper";
15
15
  export declare const gameVersionTitleMinor: string;
16
16
  export declare const gameVersionTitle: string;
@@ -14,6 +14,16 @@ declare namespace Errors {
14
14
  function getStack(error: unknown): string | undefined;
15
15
  function getName(error: unknown): string | undefined;
16
16
  function getMessage(error: unknown): string | undefined;
17
+ /**
18
+ * Returns the callsite stack string starting from the caller of this function.
19
+ * @param skip The number of additional callsite strings to skip
20
+ * @param truncate The maximum number of callsite strings to include
21
+ */
22
+ function stack(skip?: number, truncate?: number): string;
23
+ /**
24
+ * Returns the Error callsite string for the caller of the current function.
25
+ */
26
+ function caller(skip?: number): string;
17
27
  }
18
28
  export default Errors;
19
29
  export declare function ensureExhaustive(value: never): never;
@@ -9,7 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  declare namespace Functions {
12
- const noOp: () => void;
12
+ const noOp: (...args: any[]) => void;
13
13
  const noOpString: () => string;
14
14
  const noOpZero: () => number;
15
15
  const noOpNull: () => null;
@@ -24,6 +24,7 @@ export interface ILog {
24
24
  trace(...args: any[]): void;
25
25
  warn(...args: any[]): void;
26
26
  setSources(...sources: string[]): void;
27
+ ifEnabled(logger: (log: this) => any): void;
27
28
  }
28
29
  export interface ILogLine {
29
30
  type: LogLineType;
@@ -35,6 +36,7 @@ declare abstract class BaseLog implements ILog {
35
36
  info: (...args: any[]) => void;
36
37
  trace: (...args: any[]) => void;
37
38
  warn: (...args: any[]) => void;
39
+ ifEnabled: (logger: (log: this) => any) => void;
38
40
  protected sources: string[];
39
41
  constructor(...sources: Array<BaseLog | string>);
40
42
  setSources(...sources: Array<BaseLog | string>): void;
@@ -118,11 +120,18 @@ declare namespace Log {
118
120
  * @param sources A list of sources to log to.
119
121
  */
120
122
  function debug(...sources: string[]): (...args: any[]) => void;
123
+ function ifEnabled(...sources: string[]): (logger: (log: ILog) => any) => void;
124
+ function ifEnabled<LOG extends ILog>(log: LOG, ...sources: string[]): (logger: (log: LOG) => any) => void;
121
125
  /**
122
126
  * Returns a method that can be used to `Log.trace` with the given sources.
123
127
  * @param sources A list of sources to log to.
124
128
  */
125
129
  function trace(...sources: string[]): (...args: any[]) => void;
130
+ /**
131
+ * Warn about something once per session based on unique warning ids.
132
+ * This is like how node.js does warnings in console.
133
+ */
134
+ function warnOncePerSession(warningId: string | string[], ...message: any[]): void;
126
135
  }
127
136
  declare class NullLog extends BaseLog {
128
137
  setup(): void;
@@ -0,0 +1,35 @@
1
+ /*!
2
+ * Copyright 2011-2024 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ /**
12
+ * Strong keys are stored in a Map.
13
+ * Weak keys are stored in a WeakMap.
14
+ * Based on https://github.com/tc39/proposal-weakrefs?tab=readme-ov-file#iterable-weakmaps
15
+ */
16
+ export declare class IterableWeakMap<K, V> implements Iterable<[K, V]> {
17
+ #private;
18
+ constructor(iterable?: Iterable<[K, V]>);
19
+ /**
20
+ * This is more of an estimate since we might be waiting for some garbage collection to happen
21
+ */
22
+ get size(): number;
23
+ /**
24
+ * This will cause keys that are cleaned up via garbage collection to be logged
25
+ */
26
+ enableLogging(): IterableWeakMap<K, V>;
27
+ get(key: K): V | undefined;
28
+ set(key: K, value: V): this;
29
+ delete(key: K): boolean;
30
+ [Symbol.iterator](): Generator<[K, V]>;
31
+ entries(): IterableIterator<[K, V]>;
32
+ keys(): IterableIterator<K>;
33
+ values(): IterableIterator<V>;
34
+ private isWeakKey;
35
+ }