@wayward/types 2.14.3-beta.dev.20241225.1 → 2.14.3-beta.dev.20241227.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 (27) hide show
  1. package/definitions/game/game/IGame.d.ts +2 -1
  2. package/definitions/game/game/entity/action/actions/moveItem/MoveItemFilterArgument.d.ts +3 -0
  3. package/definitions/game/game/entity/creature/CreatureManager.d.ts +1 -1
  4. package/definitions/game/game/inspection/IInspection.d.ts +1 -4
  5. package/definitions/game/game/inspection/inspections/ActionInspection.d.ts +1 -0
  6. package/definitions/game/game/inspection/inspections/action/IActionInspection.d.ts +26 -0
  7. package/definitions/game/game/item/Item.d.ts +0 -1
  8. package/definitions/game/game/meta/SaveLoad.d.ts +1 -1
  9. package/definitions/game/game/options/IGameOptions.d.ts +6 -1
  10. package/definitions/game/language/Dictionary.d.ts +128 -127
  11. package/definitions/game/language/DictionaryMap.d.ts +252 -249
  12. package/definitions/game/language/Translation.d.ts +2 -2
  13. package/definitions/game/language/english/ui/ActionSlotItemMethods.d.ts +1 -1
  14. package/definitions/game/language/english/ui/ActionSlotTypes.d.ts +13 -0
  15. package/definitions/game/resource/IResourceLoader.d.ts +51 -48
  16. package/definitions/game/ui/old/OldUi.d.ts +1 -1
  17. package/definitions/game/ui/screen/screens/game/component/container/ContainerBucketItemList.d.ts +6 -5
  18. package/definitions/game/ui/screen/screens/game/static/actions/ActionSlot.d.ts +5 -8
  19. package/definitions/game/ui/screen/screens/game/static/actions/IActionsDrawer.d.ts +3 -3
  20. package/definitions/game/utilities/dev/Debug.d.ts +4 -0
  21. package/definitions/game/utilities/memory/MemoryLeakDetector.d.ts +1 -1
  22. package/definitions/game/utilities/object/Merge.d.ts +2 -0
  23. package/definitions/utilities/Functions.d.ts +1 -1
  24. package/definitions/utilities/Log.d.ts +4 -0
  25. package/definitions/utilities/dev/DebugShared.d.ts +23 -0
  26. package/definitions/utilities/prototype/Define.d.ts +2 -0
  27. package/package.json +1 -1
@@ -10,52 +10,55 @@
10
10
  */
11
11
  export declare enum PathType {
12
12
  Action = 0,
13
- AttackAnimation = 1,
14
- ChallengeIcon = 2,
15
- ChangelogChangeType = 3,
16
- ContainerTabAction = 4,
17
- Corpse = 5,
18
- Creature = 6,
19
- Damage = 7,
20
- Deity = 8,
21
- Doodad = 9,
22
- Equip = 10,
23
- EquipSlot = 11,
24
- GameOptionsIcon = 12,
25
- Hairstyle = 13,
26
- HelpArticleIcon = 14,
27
- InfoIcon = 15,
28
- InputIcon = 16,
29
- Island = 17,
30
- IslandModifier = 18,
31
- Item = 19,
32
- Map = 20,
33
- MapTile = 21,
34
- MarkerIcon = 22,
35
- MenuBarButtonIcon = 23,
36
- MilestoneIcon = 24,
37
- Music = 25,
38
- Notifier = 26,
39
- Overlay = 27,
40
- Pin = 28,
41
- Quality = 29,
42
- RecipeLevel = 30,
43
- SkillIcon = 31,
44
- Sleep = 32,
45
- SoundEffect = 33,
46
- StatIcon = 34,
47
- StatusEffectGroup = 35,
48
- StatusIcon = 36,
49
- StatusIconFrame = 37,
50
- StatusIconNotifier = 38,
51
- StatusOverlay = 39,
52
- StatusThreatLevel = 40,
53
- Terrain = 41,
54
- TerrainDecoration = 42,
55
- TerrainDug = 43,
56
- TerrainMound = 44,
57
- TerrainTilled = 45,
58
- TileEvent = 46,
59
- Vehicle = 47,
60
- Website = 48
13
+ ActionInfoIcon = 1,
14
+ ActionSlotItemMethod = 2,
15
+ ActionSlotType = 3,
16
+ AttackAnimation = 4,
17
+ ChallengeIcon = 5,
18
+ ChangelogChangeType = 6,
19
+ ContainerTabAction = 7,
20
+ Corpse = 8,
21
+ Creature = 9,
22
+ Damage = 10,
23
+ Deity = 11,
24
+ Doodad = 12,
25
+ Equip = 13,
26
+ EquipSlot = 14,
27
+ GameOptionsIcon = 15,
28
+ Hairstyle = 16,
29
+ HelpArticleIcon = 17,
30
+ InfoIcon = 18,
31
+ InputIcon = 19,
32
+ Island = 20,
33
+ IslandModifier = 21,
34
+ Item = 22,
35
+ Map = 23,
36
+ MapTile = 24,
37
+ MarkerIcon = 25,
38
+ MenuBarButtonIcon = 26,
39
+ MilestoneIcon = 27,
40
+ Music = 28,
41
+ Notifier = 29,
42
+ Overlay = 30,
43
+ Pin = 31,
44
+ Quality = 32,
45
+ RecipeLevel = 33,
46
+ SkillIcon = 34,
47
+ Sleep = 35,
48
+ SoundEffect = 36,
49
+ StatIcon = 37,
50
+ StatusEffectGroup = 38,
51
+ StatusIcon = 39,
52
+ StatusIconFrame = 40,
53
+ StatusIconNotifier = 41,
54
+ StatusOverlay = 42,
55
+ StatusThreatLevel = 43,
56
+ Terrain = 44,
57
+ TerrainDecoration = 45,
58
+ TerrainDug = 46,
59
+ TerrainMound = 47,
60
+ TerrainTilled = 48,
61
+ TileEvent = 49,
62
+ Vehicle = 50,
63
+ Website = 51
61
64
  }
@@ -34,7 +34,7 @@ export default class OldUi {
34
34
  getSerializationProperties(_: string): string[];
35
35
  setVersionExtra(msg: string): void;
36
36
  openDialogs(): void;
37
- logErrorEvent(event: ErrorEvent | (Partial<ErrorEvent> & Error), skipLog?: true): void;
37
+ logErrorEvent(eventOrError: unknown, skipLog?: true): void;
38
38
  private loggingRejection;
39
39
  private logPromiseRejectionEvent;
40
40
  }
@@ -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,6 +78,9 @@ 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
85
  getStackedItems(type?: ItemType, excluding?: Item): Item[];
86
86
  getStackIndex(type?: ItemType): number | undefined;
@@ -146,6 +146,7 @@ export default class ContainerBucketItemList extends Component implements ISorta
146
146
  private getItemIdsInElements;
147
147
  private getItemElementId;
148
148
  private getItemComponentElements;
149
+ private getItemComponentById;
149
150
  private regenerate;
150
151
  private transfer;
151
152
  private getSorter;
@@ -30,6 +30,7 @@ import ItemComponent from "@wayward/game/ui/screen/screens/game/component/ItemCo
30
30
  import { ItemComponentHandler } from "@wayward/game/ui/screen/screens/game/component/item/ItemComponentHandler";
31
31
  import type ActionBar from "@wayward/game/ui/screen/screens/game/static/ActionBar";
32
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";
33
34
  import type TooltipLocationHandler from "@wayward/game/ui/tooltip/TooltipLocationHandler";
34
35
  import type { Events, IEventEmitter } from "@wayward/utilities/event/EventEmitter";
35
36
  export declare enum ActionSlotClasses {
@@ -50,10 +51,6 @@ export declare enum ActionSlotClasses {
50
51
  History_Cleared = "game-action-slot-history--cleared",
51
52
  ItemComponent = "game-action-slot-item-component"
52
53
  }
53
- export declare enum ActionSlotType {
54
- Normal = 0,
55
- History = 1
56
- }
57
54
  export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
58
55
  update(data: IActionBarSlotData | undefined, oldData: IActionBarSlotData | undefined, reason: ActionSlotUpdateReason): any;
59
56
  unequipItem(): any;
@@ -62,9 +59,9 @@ export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
62
59
  export declare class ActionSlot extends Button implements IRefreshable, ItemSlot {
63
60
  readonly number: number;
64
61
  slotData: IActionBarSlotData;
65
- readonly type: ActionSlotType;
62
+ readonly type: ActionSlotInternalType;
66
63
  static getHovered(): ActionSlot | undefined;
67
- static tryCreate(number: number, slotData: IActionBarSlotData, type?: ActionSlotType): ActionSlot;
64
+ static tryCreate(number: number, slotData: IActionBarSlotData, type?: ActionSlotInternalType): ActionSlot;
68
65
  event: IEventEmitter<this, IActionSlotEvents>;
69
66
  private get actionBar();
70
67
  readonly label: Text;
@@ -76,7 +73,7 @@ export declare class ActionSlot extends Button implements IRefreshable, ItemSlot
76
73
  private lastItem?;
77
74
  private lastQuality?;
78
75
  usability: ReturnableUsableActionUsability;
79
- protected constructor(number: number, slotData: IActionBarSlotData, type?: ActionSlotType);
76
+ protected constructor(number: number, slotData: IActionBarSlotData, type?: ActionSlotInternalType);
80
77
  isTransientSlot(): boolean;
81
78
  getItemComponent(): ItemComponent | undefined;
82
79
  private skipNextClick;
@@ -120,7 +117,7 @@ export declare class ActionSlot extends Button implements IRefreshable, ItemSlot
120
117
  getActionId(): ActionId | undefined;
121
118
  getInternalActionType(): ActionType | undefined;
122
119
  private usingCache?;
123
- getUsing(fresh?: true): IUsableActionPossibleUsing | undefined;
120
+ getUsing(fresh?: true, forceWithHoveredTile?: true): IUsableActionPossibleUsing | undefined;
124
121
  private getBindingText;
125
122
  }
126
123
  declare class ActionSlotSlottedContainer extends ItemComponent {
@@ -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
  }
@@ -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.
@@ -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,6 +120,8 @@ 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.
@@ -0,0 +1,23 @@
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
+ declare namespace DebugShared {
12
+ const SYMBOL_JIT: unique symbol;
13
+ export interface JIT<A extends any[] = []> {
14
+ (): any;
15
+ (...args: A): any;
16
+ [SYMBOL_JIT]: true;
17
+ }
18
+ export function isJIT(value: unknown): value is JIT;
19
+ export function JIT<A extends any[]>(debug: JIT, fn: (debug: any, ...args: A) => any): JIT<A>;
20
+ export function JIT<A extends any[]>(fn: (...args: A) => any): JIT<A>;
21
+ export {};
22
+ }
23
+ export default DebugShared;
@@ -11,6 +11,8 @@
11
11
  type Implementation<P, K extends keyof P> = (this: P, ...args: P[K] extends (...args: infer A) => any ? A : []) => P[K] extends (...args: any[]) => infer R ? R : never;
12
12
  declare function Define<P, K extends string & keyof P>(proto: P, key: K, implementation: Implementation<P, K>): void;
13
13
  declare namespace Define {
14
+ export function set<P, K extends string & keyof P>(proto: P, key: K, value: P[K]): P[K];
15
+ export function set<V>(proto: any, key: PropertyKey, value: V): V;
14
16
  export function all<P, K extends string & keyof P>(protos: P[], key: K, implementation: Implementation<P, K>): void;
15
17
  interface IMagicImplementation<O, K extends string & keyof O> {
16
18
  get(this: O): O[K];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.14.3-beta.dev.20241225.1",
4
+ "version": "2.14.3-beta.dev.20241227.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",