@wayward/types 2.15.5-beta.dev.20260424.1 → 2.15.5-beta.dev.20260427.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 (26) hide show
  1. package/definitions/game/game/doodad/Doodad.d.ts +1 -0
  2. package/definitions/game/game/entity/Entity.d.ts +0 -1
  3. package/definitions/game/game/entity/creature/Creature.d.ts +1 -0
  4. package/definitions/game/game/entity/creature/corpse/Corpse.d.ts +2 -1
  5. package/definitions/game/game/entity/npc/NPC.d.ts +2 -1
  6. package/definitions/game/game/entity/player/Player.d.ts +2 -1
  7. package/definitions/game/game/inspection/infoProviders/MagicalDamageReduction.d.ts +1 -1
  8. package/definitions/game/game/inspection/infoProviders/MagicalDamageRegeneration.d.ts +1 -1
  9. package/definitions/game/game/inspection/infoProviders/MagicalDecayReduction.d.ts +1 -1
  10. package/definitions/game/game/inspection/infoProviders/item/MagicalSourceTooltip.d.ts +2 -2
  11. package/definitions/game/game/island/Island.d.ts +4 -7
  12. package/definitions/game/game/item/Item.d.ts +1 -0
  13. package/definitions/game/game/mechanics/Decay.d.ts +18 -0
  14. package/definitions/game/game/reference/ReferenceManager.d.ts +16 -0
  15. package/definitions/game/game/tile/TileEvent.d.ts +2 -1
  16. package/definitions/game/resource/IResourceLoader.d.ts +30 -29
  17. package/definitions/game/ui/old/OldUi.d.ts +0 -2
  18. package/definitions/game/ui/screen/screens/GameScreen.d.ts +1 -0
  19. package/definitions/game/ui/screen/screens/game/ReferenceIconRenderer.d.ts +1 -0
  20. package/definitions/{utilities/game/DeveloperMode.d.ts → test/suite/unitTests/utilities/Errors.spec.d.ts} +3 -1
  21. package/definitions/test/suite/unitTests/utilities/log/ErrorReporting.spec.d.ts +13 -0
  22. package/definitions/utilities/Errors.d.ts +9 -0
  23. package/definitions/utilities/event/EventEmitter.d.ts +2 -0
  24. package/definitions/utilities/event/EventManager.d.ts +1 -0
  25. package/definitions/utilities/log/ErrorReporting.d.ts +61 -17
  26. package/package.json +1 -1
@@ -97,6 +97,7 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
97
97
  protected static registrarId: number;
98
98
  get entityType(): EntityType.Doodad;
99
99
  get tileUpdateType(): TileUpdateType;
100
+ get reference(): Reference<ReferenceType.Doodad> | undefined;
100
101
  event: IEventEmitter<this, IDoodadEvents>;
101
102
  maxDur: number;
102
103
  minDur: number;
@@ -112,7 +112,6 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
112
112
  */
113
113
  get isWithinHumanBounds(): boolean;
114
114
  setHumansWithinBound(humansWithinBound: IHumanBound[]): void;
115
- getHumansWithinBound(): Human[];
116
115
  /**
117
116
  * Returns humans within this entities fov & that they can see
118
117
  */
@@ -47,6 +47,7 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
47
47
  static is(value: any): value is Creature;
48
48
  get entityType(): EntityType.Creature;
49
49
  get tileUpdateType(): TileUpdateType;
50
+ get reference(): Reference<ReferenceType.Creature> | undefined;
50
51
  event: IEventEmitter<this, ICreatureEvents>;
51
52
  anim: number;
52
53
  direction: Vector2;
@@ -24,7 +24,7 @@ import type Player from "@wayward/game/game/entity/player/Player";
24
24
  import type { IUncastableContainer } from "@wayward/game/game/item/IItem";
25
25
  import { ItemType } from "@wayward/game/game/item/IItem";
26
26
  import type Item from "@wayward/game/game/item/Item";
27
- import type { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
27
+ import type { Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
28
28
  import type Tile from "@wayward/game/game/tile/Tile";
29
29
  import type TileEvent from "@wayward/game/game/tile/TileEvent";
30
30
  import type Translation from "@wayward/game/language/Translation";
@@ -46,6 +46,7 @@ export default class Corpse extends Entity<ICorpseDescription, CreatureType, Ref
46
46
  static is(value: any): value is Corpse;
47
47
  get entityType(): EntityType.Corpse;
48
48
  get tileUpdateType(): TileUpdateType;
49
+ get reference(): Reference<ReferenceType.Corpse> | undefined;
49
50
  event: IEventEmitter<this, ICorpseEvents>;
50
51
  aberrant?: boolean | undefined;
51
52
  decay?: number | undefined;
@@ -31,7 +31,7 @@ import { QuestManagerNoOp } from "@wayward/game/game/entity/player/quest/QuestMa
31
31
  import { StatusApplicability } from "@wayward/game/game/entity/status/IStatus";
32
32
  import type { IContainer, ItemType } from "@wayward/game/game/item/IItem";
33
33
  import type Item from "@wayward/game/game/item/Item";
34
- import type { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
34
+ import type { Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
35
35
  import type Tile from "@wayward/game/game/tile/Tile";
36
36
  import type { Article } from "@wayward/game/language/ITranslation";
37
37
  import Translation from "@wayward/game/language/Translation";
@@ -57,6 +57,7 @@ export default abstract class NPC extends Human<INPCDescription, NPCType, Refere
57
57
  readonly isPlayerLike: boolean;
58
58
  get entityType(): EntityType.NPC;
59
59
  get tileUpdateType(): TileUpdateType;
60
+ get reference(): Reference<ReferenceType.NPC> | undefined;
60
61
  event: IEventEmitter<this, INPCEvents>;
61
62
  private weightCapacity;
62
63
  ai: AiManager<this>;
@@ -28,7 +28,7 @@ import type Item from "@wayward/game/game/item/Item";
28
28
  import ItemRecipeRequirementChecker from "@wayward/game/game/item/ItemRecipeRequirementChecker";
29
29
  import { Prompt } from "@wayward/game/game/meta/prompt/IPrompt";
30
30
  import { Milestone } from "@wayward/game/game/milestones/IMilestone";
31
- import type { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
31
+ import type { Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
32
32
  import type Tile from "@wayward/game/game/tile/Tile";
33
33
  import type InterruptChoice from "@wayward/game/language/dictionary/InterruptChoice";
34
34
  import type TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
@@ -41,6 +41,7 @@ import { type IEventEmitter } from "@wayward/utilities/event/EventEmitter";
41
41
  export default class Player extends Human<undefined, number, ReferenceType.Player, PlayerTag> implements IPreSerializeCallback, IUnserializedCallback {
42
42
  get entityType(): EntityType.Player;
43
43
  get tileUpdateType(): TileUpdateType;
44
+ get reference(): Reference<ReferenceType.Player> | undefined;
44
45
  event: IEventEmitter<this, IPlayerEvents>;
45
46
  absentLastUsedTime: number;
46
47
  containerSortInfo: Record<string | number, IContainerSortInfo | undefined>;
@@ -8,6 +8,6 @@
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 type { IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
11
+ import { type IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
12
12
  import type TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
13
13
  export default function (magicalThingy: IHasMagic): TranslationImpl | undefined;
@@ -8,6 +8,6 @@
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 type { IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
11
+ import { type IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
12
12
  import type TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
13
13
  export default function (magicalThingy: IHasMagic): TranslationImpl | undefined;
@@ -8,6 +8,6 @@
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 type { IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
11
+ import { type IHasMagic } from "@wayward/game/game/magic/IMagicalProperty";
12
12
  import type TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
13
13
  export default function (magicalThingy: IHasMagic): TranslationImpl | undefined;
@@ -8,8 +8,8 @@
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 type { MagicalNormalPropertyTypes, MagicalPropertyIdentity } from "@wayward/game/game/magic/IMagicalProperty";
12
- import type { MagicalSubPropertyTypes } from "@wayward/game/game/magic/IMagicalProperty";
11
+ import { MagicalPropertyIdentity } from "@wayward/game/game/magic/IMagicalProperty";
12
+ import type { MagicalSubPropertyTypes, MagicalNormalPropertyTypes } from "@wayward/game/game/magic/IMagicalProperty";
13
13
  import type { MagicalPropertyTypeSubTypeMap } from "@wayward/game/game/magic/MagicalPropertyType";
14
14
  import Translation from "@wayward/game/language/Translation";
15
15
  declare function MagicalSourceTooltip(type: MagicalNormalPropertyTypes, curse?: true): Translation;
@@ -33,7 +33,7 @@ import ItemManager from "@wayward/game/game/item/ItemManager";
33
33
  import type DrawnMap from "@wayward/game/game/mapping/DrawnMap";
34
34
  import type { IGameOptions, IGameOptionsPartial } from "@wayward/game/game/options/IGameOptions";
35
35
  import type { IslandModifiersCollection } from "@wayward/game/game/options/modifiers/island/IslandModifiers";
36
- import type { IReferenceable } from "@wayward/game/game/reference/IReferenceManager";
36
+ import type { IReferenceable, Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
37
37
  import TemperatureManager from "@wayward/game/game/temperature/TemperatureManager";
38
38
  import type { ITerrainDescription, ITileContainer, ITileData } from "@wayward/game/game/tile/ITerrain";
39
39
  import { TerrainType } from "@wayward/game/game/tile/ITerrain";
@@ -115,11 +115,11 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
115
115
  /**
116
116
  * Set of players on this island
117
117
  */
118
- readonly players: Set<Human<unknown, number, import("@wayward/game/game/reference/IReferenceManager").ReferenceType.NPC | import("@wayward/game/game/reference/IReferenceManager").ReferenceType.Player, unknown>>;
118
+ readonly players: Set<Human<unknown, number, ReferenceType.NPC | ReferenceType.Player, unknown>>;
119
119
  /**
120
120
  * Entity move types in fov on this island
121
121
  */
122
- readonly moveTypesInFov: Map<"-1-0" | "-1-1" | "-1-2" | "-1-4" | "-1-8" | "-1-16" | "-1-32" | "-1-64" | "-1-128" | "-1-256" | "-1-512" | "-1-1024" | "-1-2048" | "-1-4096" | "-1-8192" | "-1-15" | "0-0" | "0-1" | "0-2" | "0-4" | "0-8" | "0-16" | "0-32" | "0-64" | "0-128" | "0-256" | "0-512" | "0-1024" | "0-2048" | "0-4096" | "0-8192" | "0-15" | "1-0" | "1-1" | "1-2" | "1-4" | "1-8" | "1-16" | "1-32" | "1-64" | "1-128" | "1-256" | "1-512" | "1-1024" | "1-2048" | "1-4096" | "1-8192" | "1-15", Set<Human<unknown, number, import("@wayward/game/game/reference/IReferenceManager").ReferenceType.NPC | import("@wayward/game/game/reference/IReferenceManager").ReferenceType.Player, unknown>>>;
122
+ readonly moveTypesInFov: Map<"-1-0" | "-1-1" | "-1-2" | "-1-4" | "-1-8" | "-1-16" | "-1-32" | "-1-64" | "-1-128" | "-1-256" | "-1-512" | "-1-1024" | "-1-2048" | "-1-4096" | "-1-8192" | "-1-15" | "0-0" | "0-1" | "0-2" | "0-4" | "0-8" | "0-16" | "0-32" | "0-64" | "0-128" | "0-256" | "0-512" | "0-1024" | "0-2048" | "0-4096" | "0-8192" | "0-15" | "1-0" | "1-1" | "1-2" | "1-4" | "1-8" | "1-16" | "1-32" | "1-64" | "1-128" | "1-256" | "1-512" | "1-1024" | "1-2048" | "1-4096" | "1-8192" | "1-15", Set<Human<unknown, number, ReferenceType.NPC | ReferenceType.Player, unknown>>>;
123
123
  /**
124
124
  * Helps instruct when to tick when in simulated turn mode
125
125
  */
@@ -139,6 +139,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
139
139
  get isFastForwarding(): boolean;
140
140
  constructor(game?: Game, position?: IVector2, seed?: number, mapSize?: number);
141
141
  toString(): string;
142
+ get reference(): Reference<ReferenceType.Island> | undefined;
142
143
  createStaticRandom(seed?: number, advance?: number): Random<PCGSeededGenerator>;
143
144
  private registerMemoryLeakDetector;
144
145
  preSerializeObject(serializer: ISerializer): void;
@@ -355,8 +356,4 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
355
356
  */
356
357
  getMaximumTravelTime(): number;
357
358
  canMelt(terrainType: TerrainType, tile: Tile): boolean;
358
- /**
359
- * Gets the decay bonus based on the item or doodad's quality.
360
- */
361
- getDecayQualityBonus(quality?: Quality): number;
362
359
  }
@@ -109,6 +109,7 @@ export interface IItemEvents extends IEntityMovableEvents, IQualityEvents, ItemM
109
109
  export default class Item extends EntityMovable<IItemDescription, ItemType, ReferenceType.Item, ItemTag> implements Partial<IContainer>, IContainable, IUnserializedCallback, IObject<ItemType>, IObjectOptions, IContainable, Partial<IContainer>, IHasInsulation, IHasMagic, IHasQuality {
110
110
  get entityType(): EntityType.Item;
111
111
  get tileUpdateType(): TileUpdateType;
112
+ get reference(): Reference<ReferenceType.Item> | undefined;
112
113
  event: IEventEmitter<this, IItemEvents>;
113
114
  private maxDur;
114
115
  private minDur;
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright 2011-2025 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 { Quality } from "@wayward/game/game/IObject";
12
+ declare namespace Decay {
13
+ /**
14
+ * Gets the decay bonus based on the item or doodad's quality.
15
+ */
16
+ function getDecayQualityBonus(quality?: Quality): number;
17
+ }
18
+ export default Decay;
@@ -15,6 +15,7 @@ import type { EquipType } from "@wayward/game/game/entity/IHuman";
15
15
  import { ActionType } from "@wayward/game/game/entity/action/IAction";
16
16
  import Creature from "@wayward/game/game/entity/creature/Creature";
17
17
  import type CreatureManager from "@wayward/game/game/entity/creature/CreatureManager";
18
+ import Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
18
19
  import type CorpseManager from "@wayward/game/game/entity/creature/corpse/CorpseManager";
19
20
  import NPC from "@wayward/game/game/entity/npc/NPC";
20
21
  import type NPCManager from "@wayward/game/game/entity/npc/NPCManager";
@@ -26,6 +27,7 @@ import Item from "@wayward/game/game/item/Item";
26
27
  import type ItemManager from "@wayward/game/game/item/ItemManager";
27
28
  import type { EnumReferenceTypes, IReferenceTypeMap, Reference, Referenceable, ReferenceableReferenceTypes } from "@wayward/game/game/reference/IReferenceManager";
28
29
  import { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
30
+ import TileEvent from "@wayward/game/game/tile/TileEvent";
29
31
  import type TileEventManager from "@wayward/game/game/tile/TileEventManager";
30
32
  import ReferenceTooltipHandler from "@wayward/game/ui/screen/screens/game/ReferenceTooltipHandler";
31
33
  import type Tooltip from "@wayward/game/ui/tooltip/Tooltip";
@@ -34,6 +36,7 @@ export default class ReferenceManager {
34
36
  static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
35
37
  isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
36
38
  static get(thing: Referenceable): Reference | undefined;
39
+ static getFake(thing: Referenceable): Reference;
37
40
  static getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
38
41
  private referenceCursor;
39
42
  private readonly referencesCache;
@@ -42,10 +45,23 @@ export default class ReferenceManager {
42
45
  clearCacheEntry(referenceId: string | number | undefined): void;
43
46
  reset(): void;
44
47
  getList(type: ReferenceType, gameIsland?: Island): DoodadManager | CorpseManager | CreatureManager | ItemManager | NPCManager | TileEventManager | Island[] | Player[] | Array<string | ActionType> | EquipType[] | readonly string[];
48
+ getFake(thing: Item): Reference<ReferenceType.Item>;
49
+ getFake(thing: Doodad): Reference<ReferenceType.Doodad>;
50
+ getFake(thing: Creature): Reference<ReferenceType.Creature>;
51
+ getFake(thing: NPC): Reference<ReferenceType.NPC>;
52
+ getFake(thing: TileEvent): Reference<ReferenceType.TileEvent>;
53
+ getFake(thing: Corpse): Reference<ReferenceType.Corpse>;
54
+ getFake(thing: Player): Reference<ReferenceType.Player>;
55
+ getFake(thing: Island): Reference<ReferenceType.Island>;
56
+ getFake(thing: Referenceable): Reference<ReferenceableReferenceTypes>;
45
57
  get(thing: Item): Reference<ReferenceType.Item> | undefined;
46
58
  get(thing: Doodad): Reference<ReferenceType.Doodad> | undefined;
47
59
  get(thing: Creature): Reference<ReferenceType.Creature> | undefined;
48
60
  get(thing: NPC): Reference<ReferenceType.NPC> | undefined;
61
+ get(thing: TileEvent): Reference<ReferenceType.TileEvent> | undefined;
62
+ get(thing: Corpse): Reference<ReferenceType.Corpse> | undefined;
63
+ get(thing: Player): Reference<ReferenceType.Player> | undefined;
64
+ get(thing: Island): Reference<ReferenceType.Island> | undefined;
49
65
  get(thing: Referenceable): Reference<ReferenceableReferenceTypes> | undefined;
50
66
  getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
51
67
  resolve<REFTYPE extends ReferenceType>(reference?: Reference<REFTYPE>, gameIsland?: Island): IReferenceTypeMap[REFTYPE] | undefined;
@@ -23,7 +23,7 @@ import type NPC from "@wayward/game/game/entity/npc/NPC";
23
23
  import type Player from "@wayward/game/game/entity/player/Player";
24
24
  import type { IUncastableContainer } from "@wayward/game/game/item/IItem";
25
25
  import type Item from "@wayward/game/game/item/Item";
26
- import type { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
26
+ import type { Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
27
27
  import type { ITileEventDescription, TileEventTag } from "@wayward/game/game/tile/ITileEvent";
28
28
  import { TileEventType } from "@wayward/game/game/tile/ITileEvent";
29
29
  import type Tile from "@wayward/game/game/tile/Tile";
@@ -44,6 +44,7 @@ export default class TileEvent extends EntityMovable<ITileEventDescription, Tile
44
44
  static is(value: any): value is TileEvent;
45
45
  get entityType(): EntityType.TileEvent;
46
46
  get tileUpdateType(): TileUpdateType;
47
+ get reference(): Reference<ReferenceType.TileEvent> | undefined;
47
48
  event: IEventEmitter<this, ITileEventEvents>;
48
49
  anim: number;
49
50
  fromX: number;
@@ -34,33 +34,34 @@ export declare enum PathType {
34
34
  Island = 22,
35
35
  IslandModifier = 23,
36
36
  Item = 24,
37
- Map = 25,
38
- MapTile = 26,
39
- MarkerIcon = 27,
40
- MenuBarButtonIcon = 28,
41
- MilestoneIcon = 29,
42
- Music = 30,
43
- Notifier = 31,
44
- Overlay = 32,
45
- Pin = 33,
46
- Quality = 34,
47
- RecipeLevel = 35,
48
- SkillIcon = 36,
49
- Sleep = 37,
50
- SoundEffect = 38,
51
- StatIcon = 39,
52
- StatusEffectGroup = 40,
53
- StatusIcon = 41,
54
- StatusIconFrame = 42,
55
- StatusIconNotifier = 43,
56
- StatusOverlay = 44,
57
- StatusThreatLevel = 45,
58
- Terrain = 46,
59
- TerrainDecoration = 47,
60
- TerrainDug = 48,
61
- TerrainMound = 49,
62
- TerrainTilled = 50,
63
- TileEvent = 51,
64
- Vehicle = 52,
65
- Website = 53
37
+ Magic = 25,
38
+ Map = 26,
39
+ MapTile = 27,
40
+ MarkerIcon = 28,
41
+ MenuBarButtonIcon = 29,
42
+ MilestoneIcon = 30,
43
+ Music = 31,
44
+ Notifier = 32,
45
+ Overlay = 33,
46
+ Pin = 34,
47
+ Quality = 35,
48
+ RecipeLevel = 36,
49
+ SkillIcon = 37,
50
+ Sleep = 38,
51
+ SoundEffect = 39,
52
+ StatIcon = 40,
53
+ StatusEffectGroup = 41,
54
+ StatusIcon = 42,
55
+ StatusIconFrame = 43,
56
+ StatusIconNotifier = 44,
57
+ StatusOverlay = 45,
58
+ StatusThreatLevel = 46,
59
+ Terrain = 47,
60
+ TerrainDecoration = 48,
61
+ TerrainDug = 49,
62
+ TerrainMound = 50,
63
+ TerrainTilled = 51,
64
+ TileEvent = 52,
65
+ Vehicle = 53,
66
+ Website = 54
66
67
  }
@@ -34,8 +34,6 @@ export default class OldUi {
34
34
  setVersionExtra(msg: string): void;
35
35
  openDialogs(): void;
36
36
  logErrorEvent(eventOrError: unknown, skipLog?: true): void;
37
- private loggingRejection;
38
- private logPromiseRejectionEvent;
39
37
  refreshUiTranslations(): void;
40
38
  private refreshUiTranslation;
41
39
  }
@@ -167,6 +167,7 @@ export default class GameScreen extends Screen {
167
167
  protected onCancel(): boolean;
168
168
  protected create(): void;
169
169
  protected onHide(): void;
170
+ private onErrorReported;
170
171
  protected onResize(): void;
171
172
  protected onCloseAllDialogs(): boolean;
172
173
  /**
@@ -18,6 +18,7 @@ export declare const referenceIconDefinitions: PartialRecord<ReferenceType, IRef
18
18
  export declare function registerReferenceIcon<TYPE extends ReferenceType>(type: TYPE, definition: IReferenceIconDefinition<TYPE>): void;
19
19
  export declare enum ReferenceIconClasses {
20
20
  Main = "reference-icon",
21
+ Magic = "reference-icon-magic",
21
22
  Stat = "reference-icon-stat",
22
23
  Status = "reference-icon-status",
23
24
  Damage = "reference-icon-damage"
@@ -8,4 +8,6 @@
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
- export declare function throwErrorInDeveloperMode(message: string): void | never;
11
+ import type { TestConfig } from "@wayward/test";
12
+ import type { IPaths } from "@wayward/test/interfaces";
13
+ export default function (paths: IPaths, config: TestConfig): void;
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2011-2025 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 { TestConfig } from "@wayward/test";
12
+ import type { IPaths } from "@wayward/test/interfaces";
13
+ export default function (paths: IPaths, config: TestConfig): void;
@@ -8,6 +8,7 @@
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
+ export type CallsiteMatcher = string | ((callsite: string) => any);
11
12
  declare namespace Errors {
12
13
  function get(error: unknown): Error | undefined;
13
14
  function toString(error: unknown): string | undefined;
@@ -20,10 +21,18 @@ declare namespace Errors {
20
21
  * @param truncate The maximum number of callsite strings to include
21
22
  */
22
23
  function stack(skip?: number, truncate?: number, stack?: string): string;
24
+ /**
25
+ * Returns the callsite stack string after the provided callsite matcher.
26
+ */
27
+ function stackAfter(skipPast: ArrayOr<CallsiteMatcher>, truncate?: number, stack?: string): string;
23
28
  /**
24
29
  * Returns the Error callsite string for the caller of the current function.
25
30
  */
26
31
  function caller(skip?: number): string;
32
+ /**
33
+ * Returns the Error callsite string after the provided callsite matcher.
34
+ */
35
+ function callerAfter(skipPast: ArrayOr<CallsiteMatcher>): string;
27
36
  /**
28
37
  * Returns the filename of the caller of the current function.
29
38
  */
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import { IterableWeakMap } from "@wayward/utilities/collection/map/IterableWeakMap";
12
12
  import { PriorityMap } from "@wayward/utilities/collection/map/PriorityMap";
13
+ import type ErrorReporting from "@wayward/utilities/log/ErrorReporting";
13
14
  export declare enum Priority {
14
15
  Lowest = -2000,
15
16
  Low = -1000,
@@ -104,6 +105,7 @@ export interface IUntilSubscriber<H, E> {
104
105
  }
105
106
  declare class EventEmitter<H, E> {
106
107
  private readonly host;
108
+ static initializeErrorReporting(value: typeof ErrorReporting): void;
107
109
  private readonly hostClass;
108
110
  /**
109
111
  * We're not always initializing these since they're not always needed.
@@ -51,6 +51,7 @@ export declare class EventManager<EventBus extends number, EventBuses extends Re
51
51
  subscribe<E extends EmitterOrBus<EventBus>, K extends Event<EventBus, EventBuses, E>>(emitter: E, events: ArrayOr<K>, handler: Handler<EventBus, EventBuses, E, K>, priority?: number, once?: boolean): void;
52
52
  subscribeNext<E extends EmitterOrBus<EventBus>, K extends Event<EventBus, EventBuses, E>>(emitter: E, events: ArrayOr<K>, handler: Handler<EventBus, EventBuses, E, K>, priority?: number): void;
53
53
  getBusName(eventBus: EventBus): string;
54
+ private reportUnsubscribeFailure;
54
55
  unsubscribe<E extends EmitterOrBus<EventBus>, K extends Event<EventBus, EventBuses, E>>(emitter: E, events: ArrayOr<K>, handler: Handler<EventBus, EventBuses, E, K>, priority?: number): boolean | undefined;
55
56
  waitFor<E extends EmitterOrBus<EventBus>, K extends Event<EventBus, EventBuses, E>>(emitter: E, event: K, priority?: number): Promise<Parameters<Handler<EventBus, EventBuses, E, K>>>;
56
57
  until<E2>(emitter: IEventEmitterHost<E2>, ...events: Array<keyof E2>): IEventManagerUntil<EventBus, EventBuses>;
@@ -8,24 +8,68 @@
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 Log from "@wayward/utilities/Log";
11
+ import type { CallsiteMatcher } from "@wayward/utilities/Errors";
12
+ import Log, { type ILog } from "@wayward/utilities/Log";
12
13
  import Version from "@wayward/utilities/Version";
13
14
  declare namespace ErrorReporting {
14
- function shouldSendErrorReport(versionInfo?: Version.Info | undefined): boolean;
15
- /**
16
- * Warns about an occurrence of something, due to a specific caller, once per session.
17
- * @param skip Number of callsites to skip. Automatically skips this function and its caller.
18
- * If this is called from a function that is registered in `Errors.ts` as a skipped callsite, you might have to pass `-1`.
19
- * @param id The ID of this warning. Can be `Log.simplify` strings.
20
- */
21
- function warnForCaller(id: ArrayOr<string | Log.SimplifyString>, ...message: any[]): void;
22
- function warnForCaller(skip: number, id: ArrayOr<string | Log.SimplifyString>, ...message: any[]): void;
23
- /**
24
- * Warn about something once per session based on unique warning ids.
25
- * This is like how node.js does warnings in console.
26
- */
27
- function warnOncePerSession(warningId: ArrayOr<string | Log.SimplifyString>, ...message: any[]): void;
28
- function warnOncePerSession(skip: number, warningId: ArrayOr<string | Log.SimplifyString>, ...message: any[]): void;
29
- function sendError(id: string, error: Error): Promise<void>;
15
+ export interface ICallerOptions {
16
+ skip?: number;
17
+ skipPast?: ArrayOr<CallsiteMatcher>;
18
+ }
19
+ export interface ICaptureOptions extends ICallerOptions {
20
+ error?: unknown;
21
+ message?: string;
22
+ stack?: string;
23
+ }
24
+ export interface IReport {
25
+ source: string[];
26
+ message?: string;
27
+ error?: Error;
28
+ stack?: string;
29
+ shouldNotifyPlayer?: boolean;
30
+ shouldSendRemote?: boolean;
31
+ }
32
+ export interface IEvents {
33
+ logError(report: IReport): any;
34
+ logWarning(report: IReport): any;
35
+ notifyPlayer(report: IReport): any;
36
+ sendToServer(report: IReport): any;
37
+ }
38
+ export class ErrorReport {
39
+ message?: string;
40
+ error?: Error;
41
+ stack?: string;
42
+ source: string[];
43
+ private hash?;
44
+ private oncePerSessionAllowed?;
45
+ constructor(options: ICaptureOptions);
46
+ private getHash;
47
+ /**
48
+ * Only do the following reporting methods once per session.
49
+ * @param dedupeId By default deduping happens by message+stack, so each unique cause of an error will be logged separately. You can provide a custom dedupeId if that's not enough or too much deduping.
50
+ */
51
+ thenOncePerSession(dedupeId?: WarningId): this;
52
+ logError(): this;
53
+ logError(source: string | string[]): this;
54
+ logError(log: ILog): this;
55
+ logWarning(): this;
56
+ logWarning(source: string | string[]): this;
57
+ logWarning(log: ILog): this;
58
+ notifyPlayer(): this;
59
+ sendToServer(remoteId?: string): this;
60
+ private shouldExecute;
61
+ private snapshot;
62
+ private resolveLogger;
63
+ }
64
+ export const event: import("@wayward/utilities/event/EventEmitter").IEventEmitter<typeof ErrorReporting, IEvents>;
65
+ type WarningId = ArrayOr<string | Log.SimplifyString>;
66
+ export function capture(message: string): ErrorReport;
67
+ export function capture(options: ICaptureOptions): ErrorReport;
68
+ export function reporter<ARGS extends any[]>(reporter: (report: ErrorReport, ...args: ARGS) => unknown): (error: unknown, ...args: ARGS) => void;
69
+ export function canEnableErrorReporting(versionInfo?: Version.Info | undefined): boolean;
70
+ export function shouldSendErrorReport(versionInfo?: Version.Info | undefined): boolean;
71
+ export function initializeGlobalHandlers(): void;
72
+ export function formatPlayerErrorStack(error?: Error): string;
73
+ export {};
30
74
  }
31
75
  export default ErrorReporting;
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.15.5-beta.dev.20260424.1",
4
+ "version": "2.15.5-beta.dev.20260427.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",