@wayward/types 2.14.2-beta.dev.20241221.1 → 2.14.3-beta.dev.20241223.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 (46) hide show
  1. package/definitions/game/IGlobal.d.ts +3 -0
  2. package/definitions/game/game/Game.d.ts +2 -0
  3. package/definitions/game/game/doodad/Doodad.d.ts +1 -0
  4. package/definitions/game/game/entity/Entity.d.ts +10 -6
  5. package/definitions/game/game/entity/EntityWithStats.d.ts +2 -1
  6. package/definitions/game/game/entity/action/usable/UsableAction.d.ts +11 -0
  7. package/definitions/game/game/entity/action/usable/UsableActionRegistrar.d.ts +7 -1
  8. package/definitions/game/game/entity/ai/AI.d.ts +4 -0
  9. package/definitions/game/game/entity/ai/AiManager.d.ts +2 -2
  10. package/definitions/game/game/entity/creature/Creature.d.ts +4 -3
  11. package/definitions/game/game/entity/creature/corpse/Corpse.d.ts +1 -0
  12. package/definitions/game/game/entity/npc/NPC.d.ts +7 -6
  13. package/definitions/game/game/entity/player/Player.d.ts +3 -2
  14. package/definitions/game/game/island/Island.d.ts +3 -0
  15. package/definitions/game/game/item/Item.d.ts +5 -1
  16. package/definitions/game/game/item/ItemFinder.d.ts +1 -1
  17. package/definitions/game/game/item/ItemManager.d.ts +2 -0
  18. package/definitions/game/game/tile/Tile.d.ts +2 -0
  19. package/definitions/game/game/tile/TileEvent.d.ts +1 -0
  20. package/definitions/game/save/data/SaveData.d.ts +2 -0
  21. package/definitions/game/save/data/SaveDataGlobal.d.ts +2 -0
  22. package/definitions/game/save/serializer/PropertiesToSerialize.d.ts +6 -0
  23. package/definitions/game/save/upgrade/UpgradeVersion.d.ts +6 -1
  24. package/definitions/game/save/upgrade/versions/beta2.14.0/_beta.2.14.0-dev20240828.d.ts +1 -1
  25. package/definitions/game/save/upgrade/versions/beta2.14.0/{beta2.14.0-dev1.d.ts → beta2.14.0-dev00000001.d.ts} +1 -1
  26. package/definitions/game/save/upgrade/versions/beta2.14.0/{beta2.14.0-dev2.d.ts → beta2.14.0-dev00000002.d.ts} +1 -1
  27. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240827.d.ts +1 -1
  28. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240828.d.ts +1 -1
  29. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240829.d.ts +1 -1
  30. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240901.d.ts +1 -1
  31. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20240905.d.ts +1 -1
  32. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20241024.d.ts +1 -1
  33. package/definitions/game/save/upgrade/versions/beta2.14.0/beta2.14.0-dev20241129.d.ts +1 -1
  34. package/definitions/game/save/upgrade/versions/beta2.14.3/beta2.14.3-dev20241223.d.ts +12 -0
  35. package/definitions/game/steamworks/ISteamworks.d.ts +1 -0
  36. package/definitions/game/steamworks/Steamworks.d.ts +15 -0
  37. package/definitions/game/ui/screen/screens/game/component/container/ContainerBucketItemList.d.ts +5 -1
  38. package/definitions/game/utilities/Version.d.ts +16 -7
  39. package/definitions/game/utilities/dev/Debug.d.ts +15 -0
  40. package/definitions/hosts/shared/globalTypes.d.ts +4 -0
  41. package/definitions/hosts/shared/globals.d.ts +2 -2
  42. package/definitions/utilities/Errors.d.ts +10 -0
  43. package/definitions/utilities/Log.d.ts +5 -0
  44. package/definitions/utilities/collection/map/LimitedMap.d.ts +45 -0
  45. package/definitions/utilities/console/ConsoleUtility.d.ts +20 -0
  46. package/package.json +1 -1
@@ -26,6 +26,7 @@ import type OldUi from "@wayward/game/ui/old/OldUi";
26
26
  import type Version from "@wayward/game/utilities/Version";
27
27
  import "@wayward/goodstream/apply";
28
28
  import "@wayward/hosts/shared/globalTypes";
29
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
29
30
  import "@wayward/utilities/IGlobal";
30
31
  import "@wayward/utilities/prototype/Promise";
31
32
  import "@wayward/utilities/typesglobal/Class";
@@ -57,6 +58,8 @@ declare global {
57
58
  const gameVersionTitleMajor: string;
58
59
  const gameVersionTitleMinor: string;
59
60
  const gameVersionTitle: string;
61
+ let gameVersionDeployId: IBuildId | undefined;
62
+ let gameVersionBuildId: IBuildId | undefined;
60
63
  let webGlVersion: number;
61
64
  const VIEWPORT_MIN_WIDTH: number;
62
65
  const VIEWPORT_MIN_HEIGHT: number;
@@ -51,6 +51,7 @@ import type { IVector2 } from "@wayward/game/utilities/math/IVector";
51
51
  import { WebWorkerManager } from "@wayward/game/webWorker/WebWorkerManager";
52
52
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
53
53
  import type { Random } from "@wayward/utilities/random/Random";
54
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
54
55
  export declare class Game extends EventEmitter.Host<IGameEvents> {
55
56
  get isChallenge(): boolean;
56
57
  private difficultyOptions;
@@ -72,6 +73,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
72
73
  version: Version.String;
73
74
  lastSaveVersion?: Version.String;
74
75
  lastSaveBuildTime?: number;
76
+ lastSaveBuildId?: IBuildId;
75
77
  readonly interval = 16.6666;
76
78
  readonly autoSave: AutoSave;
77
79
  readonly commandManager: CommandManager;
@@ -133,6 +133,7 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
133
133
  private _isWell?;
134
134
  private readonly _doodadGroupCache;
135
135
  constructor(entityOptions?: IEntityConstructorOptions<DoodadType>, options?: IDoodadOptions);
136
+ protected get typeEnum(): typeof DoodadType;
136
137
  get asCorpse(): undefined;
137
138
  get asCreature(): undefined;
138
139
  get asDoodad(): Doodad | undefined;
@@ -27,11 +27,11 @@ import type { IslandId } from "@wayward/game/game/island/IIsland";
27
27
  import type Island from "@wayward/game/game/island/Island";
28
28
  import type { IUncastableContainer } from "@wayward/game/game/item/IItem";
29
29
  import type Item from "@wayward/game/game/item/Item";
30
- import type { EntityReferenceTypes, IReferenceable, Reference } from "@wayward/game/game/reference/IReferenceManager";
30
+ import { type EntityReferenceTypes, type IReferenceable, type Reference } from "@wayward/game/game/reference/IReferenceManager";
31
31
  import type { ITemperatureSource } from "@wayward/game/game/temperature/ITemperature";
32
32
  import type Tile from "@wayward/game/game/tile/Tile";
33
33
  import type TileEvent from "@wayward/game/game/tile/TileEvent";
34
- import type { ISerializedTranslation } from "@wayward/game/language/ITranslation";
34
+ import { type ISerializedTranslation } from "@wayward/game/language/ITranslation";
35
35
  import type Translation from "@wayward/game/language/Translation";
36
36
  import type { RenderSource, UpdateRenderFlag } from "@wayward/game/renderer/IRenderer";
37
37
  import type { INotificationLocation, ItemNotifierType, MarkerIconType, StatNotificationType } from "@wayward/game/renderer/notifier/INotifier";
@@ -57,10 +57,8 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
57
57
  /**
58
58
  * Notifier marker assigned to this entity
59
59
  */
60
- persistentMarker: {
61
- type: MarkerIconType;
62
- guid: string;
63
- } | undefined;
60
+ private persistentMarker;
61
+ private persistentMarkerHidden;
64
62
  private _humansWithinBound?;
65
63
  /**
66
64
  * Cached tile the entity is on.
@@ -75,11 +73,14 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
75
73
  * Get the entities description
76
74
  */
77
75
  get description(): Readonly<DescriptionType> | undefined;
76
+ protected abstract get typeEnum(): PartialRecord<string | TypeType, TypeType | string>;
78
77
  /**
79
78
  * Adds a referenceId to the entity if it doesn't already have one
80
79
  */
81
80
  addReferenceId(): void;
82
81
  abstract getName(): Translation;
82
+ /** @deprecated Console helper */
83
+ protected get debug(): any;
83
84
  /**
84
85
  * Called when filling out the entities description for the first time
85
86
  */
@@ -118,6 +119,9 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
118
119
  updateView(source: RenderSource, updateFov?: boolean | UpdateRenderFlag.FieldOfView | UpdateRenderFlag.FieldOfViewSkipTransition): void;
119
120
  notifyItem(itemNotifierType: ItemNotifierType, item: Item): void;
120
121
  notifyStat(type: StatNotificationType, value: number): void;
122
+ initMarker(): void;
123
+ getCurrentMarkerIconType(): MarkerIconType | undefined;
124
+ setMarkerIconHidden(hidden: boolean): void;
121
125
  addMarkerIcon(type: MarkerIconType): void;
122
126
  removeMarkerIcon(...types: MarkerIconType[]): void;
123
127
  getProducedTemperature(): number | undefined;
@@ -14,6 +14,7 @@ import type { IEntityConstructorOptions, IStatus, StatusChangeReason } from "@wa
14
14
  import { type IStatEvents, type IStats } from "@wayward/game/game/entity/IStats";
15
15
  import type { IStatHost } from "@wayward/game/game/entity/Stats";
16
16
  import Stats from "@wayward/game/game/entity/Stats";
17
+ import type { StatusApplicability } from "@wayward/game/game/entity/status/IStatus";
17
18
  import { StatusType } from "@wayward/game/game/entity/status/IStatus";
18
19
  import Status from "@wayward/game/game/entity/status/Status";
19
20
  import type { EntityReferenceTypes } from "@wayward/game/game/reference/IReferenceManager";
@@ -40,7 +41,7 @@ export default abstract class EntityWithStats<DescriptionType = unknown, TypeTyp
40
41
  readonly stat: Stats<this>;
41
42
  private readonly statusHandlers;
42
43
  constructor(entityOptions?: IEntityConstructorOptions<TypeType>);
43
- protected getApplicableStatuses(): Set<StatusType> | undefined;
44
+ protected getStatusApplicability(): StatusApplicability | undefined;
44
45
  get asEntityWithStats(): EntityWithStats<DescriptionType, TypeType, EntityReferenceType, TagType>;
45
46
  /**
46
47
  * Returns whether the entity has the given `StatusType`
@@ -35,6 +35,7 @@ export interface IUsableActionEvents {
35
35
  * Emitted when the UsableAction should be updated, exclusively for cached UsableActions.
36
36
  */
37
37
  update(): any;
38
+ dispose(): any;
38
39
  }
39
40
  /**
40
41
  * Create a basic usable action:
@@ -54,7 +55,13 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
54
55
  readonly definition: DEFINITION;
55
56
  id: ActionId;
56
57
  readonly observe: Observer.IRegistrar<this>;
58
+ private usersCount;
59
+ readonly users: WeakMap<UsableActionRegistrar, true>;
60
+ private _disposed;
61
+ get disposed(): boolean;
57
62
  constructor(requirements: REQUIREMENTS, definition: DEFINITION);
63
+ addUser(user: UsableActionRegistrar): this;
64
+ removeUser(user: UsableActionRegistrar): this;
58
65
  is(id?: ActionId): boolean;
59
66
  isExecutable(): this is UsableAction<REQUIREMENTS, IUsableActionDefinitionExecutable<REQUIREMENTS>>;
60
67
  execute(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): {
@@ -102,6 +109,10 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
102
109
  getInternalActionType(): ActionType | undefined;
103
110
  getAlignment(using?: IUsableActionPossibleUsing): DeityReal[];
104
111
  getInteractionDistance(provided?: IUsableActionPossibleUsing): InteractionDistance | undefined;
112
+ dispose(): void;
113
+ private readonly playerDisposalBindings;
114
+ private bindPlayerDisposal;
115
+ private clearItemFinderCache;
105
116
  }
106
117
  export interface IUsableActionFactory<REQUIREMENTS extends IUsableActionRequirements> {
107
118
  create: <DEFINITION extends IUsableActionDefinition<REQUIREMENTS>>(action: DEFINITION) => UsableAction<REQUIREMENTS, DEFINITION>;
@@ -15,11 +15,16 @@ import type UsableAction from "@wayward/game/game/entity/action/usable/UsableAct
15
15
  import ContextMenu from "@wayward/game/ui/component/ContextMenu";
16
16
  import type { IVector2 } from "@wayward/game/utilities/math/IVector";
17
17
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
18
- export default class UsableActionRegistrar {
18
+ export interface UsableActionRegistrarEvents {
19
+ dispose(): any;
20
+ }
21
+ export default class UsableActionRegistrar extends EventEmitter.Host<UsableActionRegistrarEvents> {
19
22
  readonly id: string;
20
23
  readonly actions: Array<[string, UsableAction]>;
21
24
  readonly actionIndices: Record<string, number>;
22
25
  readonly actionIds: string[];
26
+ private readonly _disposed;
27
+ get disposed(): boolean;
23
28
  constructor(id: string);
24
29
  byId(id?: ActionId): UsableAction | undefined;
25
30
  filter(filter: (action: UsableAction, id: string) => any): UsableActionRegistrar;
@@ -30,6 +35,7 @@ export default class UsableActionRegistrar {
30
35
  showContextMenu(provided: IUsableActionPossibleUsing, contextMenu?: ContextMenu<ActionId>, context?: ActionDisplayLevel, initialiser?: (contextMenu: ContextMenu<ActionId>) => any, position?: IVector2): ContextMenu<ActionId> | undefined;
31
36
  static getContextMenuActionExecutionContext(provided: IUsableActionPossibleUsing): IUsableActionExecutionContext;
32
37
  createContextMenu(provided: IUsableActionPossibleUsing, contextMenu?: ContextMenu<ActionId>, context?: ActionDisplayLevel, initialiser?: (contextMenu: ContextMenu<ActionId>) => any): ContextMenu<ActionId> | undefined;
38
+ dispose(): void;
33
39
  }
34
40
  export interface IUsableActionGeneratorEvents {
35
41
  stopPersisting(): any;
@@ -110,6 +110,10 @@ export interface IAiMaskDescription {
110
110
  * Whether this AI mask should currently be applied
111
111
  */
112
112
  condition?(entity: Entity): boolean;
113
+ /**
114
+ * Called when changing whether the AI mask is applied to the entity
115
+ */
116
+ onChange?(entity: Entity, change: ChangeAiType): void;
113
117
  }
114
118
  export declare const aiMaskDescriptions: OptionalDescriptions<AiMaskType, IAiMaskDescription>;
115
119
  export declare enum ChangeAiType {
@@ -33,9 +33,9 @@ export default class AiManager<ENTITY extends EntityMovable = EntityMovable> {
33
33
  aiMasks: AiMaskType[];
34
34
  private lastCalculatedAi;
35
35
  private wanderIntent?;
36
- private entityRef?;
36
+ private readonly entityRef?;
37
+ constructor(entity: ENTITY);
37
38
  get entity(): ENTITY | undefined;
38
- set entity(entity: ENTITY | undefined);
39
39
  protected get entityEvent(): IEventEmitter<EntityMovable, IEntityMovableEvents & IEntityAiEvents> | undefined;
40
40
  protected get island(): Island | undefined;
41
41
  /**
@@ -27,7 +27,7 @@ import type Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
27
27
  import type { CreatureZone } from "@wayward/game/game/entity/creature/zone/CreatureZone";
28
28
  import type NPC from "@wayward/game/game/entity/npc/NPC";
29
29
  import type Player from "@wayward/game/game/entity/player/Player";
30
- import { StatusType } from "@wayward/game/game/entity/status/IStatus";
30
+ import { StatusApplicability } from "@wayward/game/game/entity/status/IStatus";
31
31
  import type { IUncastableContainer } from "@wayward/game/game/item/IItem";
32
32
  import type Item from "@wayward/game/game/item/Item";
33
33
  import type { Reference, ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
@@ -50,6 +50,7 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
50
50
  fromX: number;
51
51
  fromY: number;
52
52
  aberrant?: true;
53
+ ai: AiManager<this>;
53
54
  enemy?: {
54
55
  reference: Reference;
55
56
  attacks: number;
@@ -64,7 +65,6 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
64
65
  };
65
66
  respawned?: number;
66
67
  zonePoint?: IVector3;
67
- ai: AiManager;
68
68
  spawnAnimationTime: IMovementTime | undefined;
69
69
  constructor(entityOptions?: IEntityConstructorOptions<CreatureType>, aberrant?: boolean);
70
70
  initializeAi(resetAiType?: boolean): void;
@@ -83,6 +83,7 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
83
83
  * - `creature.getName(undefined, 3)` // "acid spitter demons"
84
84
  */
85
85
  getName(article?: Article, count?: number): Translation;
86
+ protected get typeEnum(): typeof CreatureType;
86
87
  protected getDescription(): ICreatureDescription | undefined;
87
88
  get isHostile(): boolean;
88
89
  get canAlert(): boolean;
@@ -91,7 +92,7 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
91
92
  get isTamed(): boolean;
92
93
  get isValid(): boolean;
93
94
  getCommandedAiType(): AiType | undefined;
94
- protected getApplicableStatuses(): Set<StatusType> | undefined;
95
+ protected getStatusApplicability(): StatusApplicability | undefined;
95
96
  tickStatuses(): void;
96
97
  getDefense(human?: Human): Defense;
97
98
  /**
@@ -90,6 +90,7 @@ export default class Corpse extends Entity<ICorpseDescription, CreatureType, Ref
90
90
  * - `corpse.getName(undefined, 3)` // "acid spitter demons"
91
91
  */
92
92
  getName(article?: Article, count?: number): Translation;
93
+ protected get typeEnum(): typeof CreatureType;
93
94
  protected getDescription(): ICorpseDescription | undefined;
94
95
  creatureDescription(): ICreatureDescription | undefined;
95
96
  get isValid(): boolean;
@@ -21,14 +21,14 @@ import { AiType, ChangeAiType } from "@wayward/game/game/entity/ai/AI";
21
21
  import type { IEntityAiEvents } from "@wayward/game/game/entity/ai/AiManager";
22
22
  import AiManager from "@wayward/game/game/entity/ai/AiManager";
23
23
  import type { INPCDescription } from "@wayward/game/game/entity/npc/INPC";
24
- import type { NPCType } from "@wayward/game/game/entity/npc/INPCs";
24
+ import { NPCType } from "@wayward/game/game/entity/npc/INPCs";
25
25
  import type MerchantNPC from "@wayward/game/game/entity/npc/npcs/Merchant";
26
26
  import type ShipperNPC from "@wayward/game/game/entity/npc/npcs/Shipper";
27
27
  import { MessageManagerNoOp } from "@wayward/game/game/entity/player/MessageManager";
28
28
  import type Player from "@wayward/game/game/entity/player/Player";
29
29
  import { NoteManagerNoOp } from "@wayward/game/game/entity/player/note/NoteManager";
30
30
  import { QuestManagerNoOp } from "@wayward/game/game/entity/player/quest/QuestManager";
31
- import { StatusType } from "@wayward/game/game/entity/status/IStatus";
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
34
  import type { ReferenceType } from "@wayward/game/game/reference/IReferenceManager";
@@ -58,14 +58,15 @@ export default abstract class NPC extends Human<INPCDescription, NPCType, Refere
58
58
  get entityType(): EntityType.NPC;
59
59
  get tileUpdateType(): TileUpdateType;
60
60
  event: IEventEmitter<this, INPCEvents>;
61
- seen: number;
62
61
  private weightCapacity;
63
- talked?: Map<string, number>;
62
+ ai: AiManager<this>;
64
63
  interactions?: Map<string, Set<number>>;
65
- ai: AiManager;
64
+ seen: number;
65
+ talked?: Map<string, number>;
66
66
  static getRegistrarId(): number;
67
67
  static setRegistrarId(id: number): void;
68
68
  constructor(entityOptions?: IEntityConstructorOptions<NPCType>);
69
+ protected get typeEnum(): typeof NPCType;
69
70
  getDescription(): INPCDescription | undefined;
70
71
  getWeightCapacity(): number;
71
72
  getRegistrarId(): number;
@@ -73,7 +74,7 @@ export default abstract class NPC extends Human<INPCDescription, NPCType, Refere
73
74
  createMessageManager(): MessageManagerNoOp;
74
75
  createQuestManager(): QuestManagerNoOp;
75
76
  addMilestone(): void;
76
- protected getApplicableStatuses(): Set<StatusType> | undefined;
77
+ protected getStatusApplicability(): StatusApplicability | undefined;
77
78
  get isValid(): boolean;
78
79
  load(): void;
79
80
  /**
@@ -20,7 +20,7 @@ import type { IMovementIntent, IPlayerEvents, PlayerTitle } from "@wayward/game/
20
20
  import MessageManager from "@wayward/game/game/entity/player/MessageManager";
21
21
  import NoteManager from "@wayward/game/game/entity/player/note/NoteManager";
22
22
  import QuestManager from "@wayward/game/game/entity/player/quest/QuestManager";
23
- import { StatusType } from "@wayward/game/game/entity/status/IStatus";
23
+ import { StatusApplicability } from "@wayward/game/game/entity/status/IStatus";
24
24
  import type { IslandId } from "@wayward/game/game/island/IIsland";
25
25
  import type { IContainer } from "@wayward/game/game/item/IItem";
26
26
  import { ItemType } from "@wayward/game/game/item/IItem";
@@ -63,6 +63,7 @@ export default class Player extends Human<undefined, number, ReferenceType.Playe
63
63
  delete(): void;
64
64
  get isValid(): boolean;
65
65
  get clientStore(): IClientStore;
66
+ protected get typeEnum(): {};
66
67
  getDescription(): undefined;
67
68
  createNoteManager(): NoteManager;
68
69
  createMessageManager(): MessageManager;
@@ -123,7 +124,7 @@ export default class Player extends Human<undefined, number, ReferenceType.Playe
123
124
  */
124
125
  isExploredClientSide(x: number, y: number, z: number): boolean;
125
126
  protected onSkillGain(skill: SkillType, fromValue: number, toValue: number, mod: number): void;
126
- protected getApplicableStatuses(): Set<StatusType> | undefined;
127
+ protected getStatusApplicability(): StatusApplicability | undefined;
127
128
  private canWriteInHours;
128
129
  private canWriteNote;
129
130
  private onWriteNote;
@@ -48,6 +48,7 @@ import Version from "@wayward/game/utilities/Version";
48
48
  import { Direction } from "@wayward/game/utilities/math/Direction";
49
49
  import type { IVector2, IVector3 } from "@wayward/game/utilities/math/IVector";
50
50
  import Vector2 from "@wayward/game/utilities/math/Vector2";
51
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
51
52
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
52
53
  import type { Random } from "@wayward/utilities/random/Random";
53
54
  import type { LegacySeededGenerator } from "@wayward/utilities/random/generators/LegacySeededGenerator";
@@ -85,11 +86,13 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
85
86
  */
86
87
  mapGenVersion: Version.String;
87
88
  mapGenBuildTime?: number;
89
+ mapGenBuildId?: IBuildId;
88
90
  /**
89
91
  * The version this island was last loaded on
90
92
  */
91
93
  saveVersion: Version.String;
92
94
  saveBuildTime: number;
95
+ saveBuildId: IBuildId | undefined;
93
96
  biomeOptions?: unknown;
94
97
  biomeType: BiomeTypes;
95
98
  contaminatedWater: IWaterContamination[];
@@ -29,7 +29,8 @@ import type Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
29
29
  import type NPC from "@wayward/game/game/entity/npc/NPC";
30
30
  import type Player from "@wayward/game/game/entity/player/Player";
31
31
  import type { IMobCheck, IslandId } from "@wayward/game/game/island/IIsland";
32
- import type { ContainerReference, DisplayableItemType, IConstructedInfo, IContainable, IContainer, IItemChangeIntoOptions, IItemDescription, IItemDisassembleResult, IItemDisassembly, IItemGetNameOptions, IItemUsed, IItemVehicle, IMagicalPropertyInfo, IItemMovementResult as IMoveToTileMobCheckResult, IMoveToTileOptions, ItemTag, ItemTypeExtra } from "@wayward/game/game/item/IItem";
32
+ import type { ContainerReference, DisplayableItemType, IConstructedInfo, IContainable, IContainer, IItemChangeIntoOptions, IItemDescription, IItemDisassembleResult, IItemDisassembly, IItemGetNameOptions, IItemUsed, IItemVehicle, IMagicalPropertyInfo, IItemMovementResult as IMoveToTileMobCheckResult, IMoveToTileOptions, ItemTag } from "@wayward/game/game/item/IItem";
33
+ import { ItemTypeExtra } from "@wayward/game/game/item/IItem";
33
34
  import { BookType, ContainerSort, ItemDamageResult, ItemType, ItemTypeGroup, ItemWeightChange, SYMBOL_CONTAINER_CACHED_REFERENCE } from "@wayward/game/game/item/IItem";
34
35
  import type { IPlaceOnTileOptions } from "@wayward/game/game/item/IItemManager";
35
36
  import ItemMapManager from "@wayward/game/game/item/ItemMapManager";
@@ -198,6 +199,9 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
198
199
  * - `item.getName(undefined, 3)` // "stone axes"
199
200
  */
200
201
  getName(article?: Article, options?: Partial<IItemGetNameOptions>): TranslationImpl;
202
+ protected get debug(): any;
203
+ private getDebug;
204
+ protected get typeEnum(): typeof ItemType;
201
205
  protected getDescription(): IItemDescription | undefined;
202
206
  get isTransient(): boolean;
203
207
  get isValid(): boolean;
@@ -47,7 +47,7 @@ declare class ItemFinder extends EventEmitter.Host<IItemFinderEvents> {
47
47
  markDirty(): void;
48
48
  markDirtyPostFilter(): void;
49
49
  track(): this;
50
- dispose(): this;
50
+ dispose(): void;
51
51
  protected onItemStateChange(item: Item, event: "durabilityChange" | "toggleProtected" | "qualityChange" | "transformed"): void;
52
52
  protected onContainerItemAdd(items: ItemManager, itemsAdded: Item[], containerAddedTo: IContainer): void;
53
53
  protected onContainerItemRemove(items: ItemManager, itemsRemoved: Item[], containerRemovedFrom?: IContainer): void;
@@ -69,6 +69,8 @@ export interface IItemManagerEvents extends Events<EntityManager<Item>> {
69
69
  containerUpdateOrder(container: IContainer): any;
70
70
  containerStack(container: IContainer, type: ItemType): any;
71
71
  containerUnstack(container: IContainer, type: ItemType): any;
72
+ /** Called at the end of inserting new items into a container, specifically when sorting the container was not necessary. */
73
+ containerItemAddDidNotSort(container: IContainer): any;
72
74
  /**
73
75
  * Called when an item is crafted
74
76
  * @param human The human object
@@ -113,6 +113,8 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
113
113
  constructor(island: Island, x: number, y: number, z: number, id: number, rendererData: number, quality: Quality, isFake?: true);
114
114
  get point(): IVector3;
115
115
  get description(): ITerrainDescription | undefined;
116
+ /** @deprecated Console helper */
117
+ protected get debug(): any;
116
118
  toString(): string;
117
119
  getName(layerIndex?: number, article?: Article, options?: ITileGetNameOptions): Translation;
118
120
  get type(): TerrainType;
@@ -88,6 +88,7 @@ export default class TileEvent extends EntityMovable<ITileEventDescription, Tile
88
88
  get point(): IVector3;
89
89
  get tile(): Tile;
90
90
  toString(): string;
91
+ protected get typeEnum(): typeof TileEventType;
91
92
  protected getDescription(): ITileEventDescription | undefined;
92
93
  getName(article?: Article, count?: number): TranslationImpl;
93
94
  getProducedTemperature(): number | undefined;
@@ -14,6 +14,7 @@ import type { ISerializedTranslation } from "@wayward/game/language/ITranslation
14
14
  import type { IMultiplayerState } from "@wayward/game/multiplayer/IMultiplayer";
15
15
  import type IClientStore from "@wayward/game/save/clientStore/IClientStore";
16
16
  import type EnumInfo from "@wayward/game/utilities/enum/EnumInfo";
17
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
17
18
  export declare const saveDataVersionUnknown = "Unknown";
18
19
  export default class SaveData {
19
20
  gameSlotName: string;
@@ -23,6 +24,7 @@ export default class SaveData {
23
24
  gameThumbnail: string;
24
25
  gameDifficulty: GameMode;
25
26
  gameBuildTime: number;
27
+ gameBuildId?: IBuildId;
26
28
  saveManagerSaveTime: number;
27
29
  saveManagerTicks: number;
28
30
  saveManagerDifficulty: GameMode;
@@ -16,11 +16,13 @@ import type { IDialogInfo } from "@wayward/game/ui/old/IOldUi";
16
16
  import type { ISavedCharacter } from "@wayward/game/ui/screen/screens/menu/menus/character/Character";
17
17
  import type Version from "@wayward/game/utilities/Version";
18
18
  import type EnumInfo from "@wayward/game/utilities/enum/EnumInfo";
19
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
19
20
  export default class SaveDataGlobal {
20
21
  static defaultOptions: IOptions;
21
22
  gameCrafted: SaferNumberIndexedObject<ICrafted>;
22
23
  gameLastPlayedVersion: Version.String;
23
24
  gameLastPlayedBuildTime?: number;
25
+ gameLastPlayedBuildId?: IBuildId;
24
26
  gameHighscores: IHighscore[];
25
27
  gamePlayedCount: number;
26
28
  options: IOptions;
@@ -64,6 +64,9 @@ declare const propertiesToSerializeObject: {
64
64
  gameBuildTime: {
65
65
  property: string[];
66
66
  };
67
+ gameBuildId: {
68
+ property: string[];
69
+ };
67
70
  saveTime: {
68
71
  property: string[];
69
72
  savePropertyFlag: SavePropertyFlag;
@@ -120,6 +123,9 @@ declare const propertiesToSerializeGlobalObject: {
120
123
  lastPlayedBuildTime: {
121
124
  property: string[];
122
125
  };
126
+ lastPlayedBuildId: {
127
+ property: string[];
128
+ };
123
129
  gamesPlayed: {
124
130
  property: string[];
125
131
  };
@@ -23,8 +23,10 @@ import type { IGameOptions } from "@wayward/game/game/options/IGameOptions";
23
23
  import type TileEvent from "@wayward/game/game/tile/TileEvent";
24
24
  import type { UpgradesArrayCompressedPusher } from "@wayward/game/save/upgrade/UpgradesArray";
25
25
  import type Version from "@wayward/game/utilities/Version";
26
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
26
27
  export interface IUpgradeVersion {
27
28
  name?: string;
29
+ buildId?: IBuildId;
28
30
  applies(buildVersion: Version.Info): boolean;
29
31
  upgradeGlobal?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher): any;
30
32
  upgradeGame?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, game: Game): any;
@@ -44,4 +46,7 @@ export interface IUpgradeVersion {
44
46
  export type UpgradeType = Exclude<keyof IUpgradeVersion, "applies">;
45
47
  export type UpgradeParameters<TYPE extends UpgradeType> = Required<IUpgradeVersion>[TYPE] extends (_v: any, _u: any, ...params: infer PARAMS) => any ? PARAMS : never;
46
48
  export declare function oldify<CURRENT, OLD>(current: CURRENT): Merge<CURRENT, Partial<OLD>>;
47
- export default function (definition: IUpgradeVersion): IUpgradeVersion;
49
+ export interface IUpgradeVersionDefinition extends Omit<IUpgradeVersion, "applies" | "name" | "buildId"> {
50
+ applies?: IUpgradeVersion["applies"];
51
+ }
52
+ export default function (definition: IUpgradeVersionDefinition): IUpgradeVersionDefinition;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -8,5 +8,5 @@
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
- declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersion;
11
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
12
  export default _default;
@@ -0,0 +1,12 @@
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 const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition;
12
+ export default _default;
@@ -21,6 +21,7 @@ export interface ISteamworksEvents {
21
21
  onSteamNetworkingMessagesSessionRequest(steamIdRemote: string): void;
22
22
  onSteamNetworkingMessagesSessionFailed(steamIdRemote: string, state: SteamNetworkingConnectionState, endReason: number): void;
23
23
  requestJoinServer(serverInfo: ServerInfo): any;
24
+ changeBuildId(): any;
24
25
  }
25
26
  export interface IModPath {
26
27
  path: string;
@@ -20,6 +20,7 @@ import { SteamStatArea } from "@wayward/game/steamworks/ISteamworks";
20
20
  import type { ISteamBeta } from "@wayward/hosts/shared/interfaces";
21
21
  import { type IMatchmakingServer, type INapiDiscordPresenceInfo, type IRemoteFile, type ISteamFriend, type ISteamId, type ISteamworksNetworking, type IWaywardPreload, type IWorkshopItem, type LobbyType } from "@wayward/hosts/shared/interfaces";
22
22
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
23
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
23
24
  export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
24
25
  private readonly game;
25
26
  protected initialized: boolean;
@@ -88,6 +89,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
88
89
  getMatchmakingServer(): IMatchmakingServer | undefined;
89
90
  getMatchmakingServerPort(): number;
90
91
  getSteamNetworking(): ISteamworksNetworking | undefined;
92
+ setBuildId(id?: string): void;
91
93
  initialize(): Promise<IWaywardPreload | undefined>;
92
94
  enableSafePaths(): void;
93
95
  onUnload(): void;
@@ -114,6 +116,19 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
114
116
  * - {@link Island.saveBuildTime}
115
117
  */
116
118
  get buildTime(): number;
119
+ /**
120
+ * Returns the build ID of the game, not depending on any save that's currently loaded.
121
+ *
122
+ * **Note that this is NOT based on the deploy ID.** If a deploy reuses a previous build, for example due to no new commits happening,
123
+ * or due to the tests failing, this build ID will be for that previous build even if the deploy ID is different.
124
+ *
125
+ * Build IDs are saved in the following places:
126
+ * - {@link saveDataGlobal.gameLastPlayedBuildId}
127
+ * - {@link saveData.gameBuildId}
128
+ * - {@link Island.mapGenBuildId}
129
+ * - {@link Island.saveBuildId}
130
+ */
131
+ get buildId(): IBuildId | undefined;
117
132
  getPublishedMods(): IWorkshopItem[] | undefined;
118
133
  getStatInt(name: string): number | undefined;
119
134
  /**
@@ -82,7 +82,9 @@ export default class ContainerBucketItemList extends Component implements ISorta
82
82
  get container(): IContainer | undefined;
83
83
  isStacked(type?: ItemType): boolean;
84
84
  isStacked(item?: Item): boolean;
85
- getStackedItems(type?: ItemType): Item[];
85
+ isFirstVisiblyStacked(item?: Item, excluding?: Item): boolean;
86
+ getStackedItemsThatAreVisible(type?: ItemType, excluding?: Item): Item[];
87
+ getStackedItems(type?: ItemType, excluding?: Item): Item[];
86
88
  getStackIndex(type?: ItemType): number | undefined;
87
89
  constructor(container?: IContainer);
88
90
  private readonly activeReasons;
@@ -132,8 +134,10 @@ export default class ContainerBucketItemList extends Component implements ISorta
132
134
  protected onContainerOrderUpdate(manager: ItemManager, container: IContainer): void;
133
135
  protected onItemToggleProtected(item: Item): void;
134
136
  private getAppendStrategy;
137
+ private addItemAddedStacks?;
135
138
  protected onAddItem(manager: ItemManager, items: Item[], container: IContainer, index: number, options?: IMoveItemOptions): Promise<void>;
136
139
  protected onRemoveItem(manager: ItemManager, items: Item[], container?: IContainer, containerTile?: Tile): void;
140
+ protected onAddItemDidNotSort(manager: ItemManager, container: IContainer): void;
137
141
  protected onTransformItem(item: Item, newType: ItemType, oldType: ItemType): void;
138
142
  protected onStack(manager: ItemManager, container: IContainer, type: ItemType): void;
139
143
  protected onUnstack(manager: ItemManager, container: IContainer, type: ItemType): void;
@@ -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
  *
@@ -0,0 +1,15 @@
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 Debug {
12
+ function typeIfRelevant(type: string, name: string): string | undefined;
13
+ function where(thing: unknown): string | undefined;
14
+ }
15
+ export default Debug;
@@ -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;
@@ -123,6 +123,11 @@ declare namespace Log {
123
123
  * @param sources A list of sources to log to.
124
124
  */
125
125
  function trace(...sources: string[]): (...args: any[]) => void;
126
+ /**
127
+ * Warn about something once per session based on unique warning ids.
128
+ * This is like how node.js does warnings in console.
129
+ */
130
+ function warnOncePerSession(warningId: string | string[], ...message: any[]): void;
126
131
  }
127
132
  declare class NullLog extends BaseLog {
128
133
  setup(): void;
@@ -0,0 +1,45 @@
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
+ type MapIt<K, V> = Iterable<readonly [K, V]>;
12
+ type MapArr<K, V> = ReadonlyArray<readonly [K, V]>;
13
+ export default class LimitedMap<K, V> extends Map<K, V> {
14
+ readonly maxSize: number;
15
+ constructor(maxSize: number);
16
+ constructor(iterable: MapIt<K, V> | null, maxSize: number);
17
+ constructor(entries: MapArr<K, V> | null, maxSize: number);
18
+ private disposeHandler?;
19
+ /**
20
+ * Set a handler that handles when the map exceeds its limit, deleting the oldest item.
21
+ *
22
+ * Return `false` from the handler to instead "bump" the first item to the end, and then try to delete the oldest item again.
23
+ *
24
+ * Returning `false` for every item will forcibly delete the oldest item.
25
+ */
26
+ setDisposeHandler(handler: (key: K, value: V, canCancel: boolean) => boolean | void): this;
27
+ /**
28
+ * 1. Sets the given key and value in the map.
29
+ * 2. If/while the map size exceeds the limit, the dispose handler is called for the oldest item.
30
+ * 3. If the handler returns `false`, the item is instead "bumped" to the end of the map.
31
+ * 4. If the handler returns `false` for every item, oldest items are forcibly deleted until the map no longer exceeds the limit.
32
+ */
33
+ set(key: K, value: V): this;
34
+ private bumping;
35
+ bump(key: K): boolean;
36
+ /**
37
+ * Deletes the item with the given key, and calls the dispose handler if it's been set.
38
+ */
39
+ delete(key: K): boolean;
40
+ /**
41
+ * Clears the map, calling the dispose handler for each item if it's been set.
42
+ */
43
+ clear(): void;
44
+ }
45
+ export {};
@@ -0,0 +1,20 @@
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 type ConsoleCreateMagic = <HOST extends WeakKey>(value: HOST, getter?: (value?: HOST) => any) => void;
12
+ export interface ConsoleMagic extends Record<string, any> {
13
+ magic: Record<string, ConsoleCreateMagic>;
14
+ }
15
+ /**
16
+ * A proxy for `window` when it's available. Assigning to this does nothing when it's not.
17
+ * Used to add utilities availble in the console
18
+ */
19
+ declare const _default: ConsoleMagic;
20
+ export default _default;
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.2-beta.dev.20241221.1",
4
+ "version": "2.14.3-beta.dev.20241223.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",