@wayward/types 2.15.0-beta.dev.20251011.1 → 2.15.0-beta.dev.20251018.2

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 (79) hide show
  1. package/definitions/game/audio/IAudio.d.ts +70 -66
  2. package/definitions/game/game/curse/Curse.d.ts +11 -4
  3. package/definitions/game/game/curse/CurseEvent.d.ts +14 -5
  4. package/definitions/game/game/curse/ICurse.d.ts +11 -1
  5. package/definitions/game/game/curse/event/CurseEventCraftingInspiration.d.ts +2 -0
  6. package/definitions/game/game/curse/event/CurseEventFrigidNight.d.ts +1 -0
  7. package/definitions/game/game/curse/event/CurseEventHeatWave.d.ts +1 -0
  8. package/definitions/game/game/curse/event/CurseEventHorde.d.ts +20 -0
  9. package/definitions/game/game/curse/event/CurseEventLucky.d.ts +1 -0
  10. package/definitions/game/game/curse/event/CurseEventNewPlants.d.ts +15 -0
  11. package/definitions/game/game/curse/event/CurseEventPlantDeath.d.ts +15 -0
  12. package/definitions/game/game/curse/event/CurseEventShadows.d.ts +2 -1
  13. package/definitions/game/game/curse/event/CurseEventSwarm.d.ts +18 -0
  14. package/definitions/game/game/curse/event/CurseEventUnlucky.d.ts +1 -0
  15. package/definitions/game/game/doodad/Doodad.d.ts +3 -7
  16. package/definitions/game/game/doodad/DoodadUtilities.d.ts +3 -1
  17. package/definitions/game/game/doodad/Doodads.d.ts +2 -1
  18. package/definitions/game/game/doodad/IDoodad.d.ts +35 -3
  19. package/definitions/game/game/entity/CombatStrengthManager.d.ts +1 -1
  20. package/definitions/game/game/entity/Human.d.ts +3 -4
  21. package/definitions/game/game/entity/IEntity.d.ts +11 -0
  22. package/definitions/game/game/entity/IHuman.d.ts +2 -2
  23. package/definitions/game/game/entity/IStats.d.ts +17 -42
  24. package/definitions/game/game/entity/Stats.d.ts +1 -0
  25. package/definitions/game/game/entity/action/Action.d.ts +2 -20
  26. package/definitions/game/game/entity/action/actions/SetTitle.d.ts +1 -1
  27. package/definitions/game/game/entity/player/IMessageManager.d.ts +5 -1
  28. package/definitions/game/game/entity/skill/ISkills.d.ts +1 -0
  29. package/definitions/game/game/entity/status/IStatus.d.ts +13 -8
  30. package/definitions/game/game/entity/status/IStatusContext.d.ts +1 -1
  31. package/definitions/game/game/entity/status/StatusEffectList.d.ts +2 -0
  32. package/definitions/game/game/inspection/IInspection.d.ts +5 -3
  33. package/definitions/game/game/inspection/InspectionTypeMap.d.ts +4 -2
  34. package/definitions/game/game/inspection/infoProviders/MagicalCurseProperties.d.ts +30 -0
  35. package/definitions/game/game/inspection/infoProviders/MagicalPropertyValue.d.ts +1 -0
  36. package/definitions/game/game/inspection/infoProviders/item/MagicalSourceTooltip.d.ts +3 -3
  37. package/definitions/game/game/inspection/infoProviders/item/use/ItemBuildInfo.d.ts +1 -1
  38. package/definitions/game/game/inspection/inspections/MagicCurseInspection.d.ts +29 -0
  39. package/definitions/game/game/inspection/inspections/utility/EffectRadiusRegistry.d.ts +24 -0
  40. package/definitions/game/game/item/IItem.d.ts +24 -2
  41. package/definitions/game/game/item/Item.d.ts +0 -5
  42. package/definitions/game/game/item/ItemManager.d.ts +5 -0
  43. package/definitions/game/game/magic/IMagicalProperty.d.ts +6 -1
  44. package/definitions/game/game/magic/MagicalPropertyManager.d.ts +39 -5
  45. package/definitions/game/game/magic/MagicalPropertyType.d.ts +4 -0
  46. package/definitions/game/game/milestones/MilestoneDefinition.d.ts +2 -2
  47. package/definitions/game/game/options/IGameOptions.d.ts +7 -0
  48. package/definitions/game/game/reference/IReferenceManager.d.ts +12 -1
  49. package/definitions/game/game/tile/ITerrain.d.ts +3 -22
  50. package/definitions/game/game/tile/Tile.d.ts +4 -2
  51. package/definitions/game/game/time/TimeManager.d.ts +4 -1
  52. package/definitions/game/language/DictionaryMap.d.ts +32 -0
  53. package/definitions/game/language/LanguageManager.d.ts +0 -2
  54. package/definitions/game/language/Translation.d.ts +1 -0
  55. package/definitions/game/language/dictionary/Message.d.ts +565 -564
  56. package/definitions/game/language/dictionary/Misc.d.ts +69 -65
  57. package/definitions/game/language/dictionary/UiTranslation.d.ts +858 -850
  58. package/definitions/game/language/english/item/DoodadsExtra.d.ts +2 -2
  59. package/definitions/game/language/english/item/ItemsExtra.d.ts +2 -2
  60. package/definitions/game/language/english/item/MagicalPropertyTypes.d.ts +1 -1
  61. package/definitions/game/renderer/fieldOfView/IFieldOfView.d.ts +4 -1
  62. package/definitions/game/renderer/overlay/EffectRadiusOverlay.d.ts +36 -0
  63. package/definitions/game/renderer/world/WorldRenderer.d.ts +4 -0
  64. package/definitions/game/save/data/ISaveDataGlobal.d.ts +1 -0
  65. package/definitions/game/save/upgrade/UpgradeVersion.d.ts +4 -0
  66. package/definitions/game/save/upgrade/versions/beta2.15.0/beta2.15.0-dev20251012.d.ts +12 -0
  67. package/definitions/game/save/upgrade/versions/beta2.15.0/beta2.15.0-dev20251016.d.ts +12 -0
  68. package/definitions/game/save/upgrade/versions/beta2.15.0/beta2.15.0-dev20251018.d.ts +12 -0
  69. package/definitions/game/ui/old/OldUi.d.ts +2 -0
  70. package/definitions/game/ui/screen/screens/game/component/ItemComponent.d.ts +1 -0
  71. package/definitions/game/ui/screen/screens/game/static/Stats.d.ts +1 -0
  72. package/definitions/game/ui/screen/screens/game/static/stats/IStatDisplayDescription.d.ts +16 -4
  73. package/definitions/game/ui/screen/screens/game/static/stats/TemperatureDisplay.d.ts +13 -0
  74. package/definitions/game/ui/screen/screens/game/static/stats/component/StatComponent.d.ts +3 -0
  75. package/definitions/game/ui/screen/screens/menu/menus/options/TabPerformance.d.ts +1 -0
  76. package/definitions/game/ui/screen/screens/menu/menus/options/TabVideo.d.ts +2 -0
  77. package/definitions/game/utilities/math/Vector2.d.ts +25 -5
  78. package/definitions/utilities/math/Range.d.ts +6 -6
  79. package/package.json +1 -1
@@ -9,5 +9,5 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { DoodadTypeExtra } from "@wayward/game/game/doodad/IDoodad";
12
- declare const doodads: Descriptions<DoodadTypeExtra, [string, string]>;
13
- export default doodads;
12
+ declare const _default: Descriptions<DoodadTypeExtra, string | [string, string?]>;
13
+ export default _default;
@@ -9,5 +9,5 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { ItemTypeExtra } from "@wayward/game/game/item/IItem";
12
- declare const items: Descriptions<ItemTypeExtra, string | [string, string?]>;
13
- export default items;
12
+ declare const _default: Descriptions<ItemTypeExtra, string | [string, string?]>;
13
+ export default _default;
@@ -9,5 +9,5 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import MagicalPropertyType from "@wayward/game/game/magic/MagicalPropertyType";
12
- declare const magicalPropertyTypes: Descriptions<MagicalPropertyType, [string, string]>;
12
+ declare const magicalPropertyTypes: Descriptions<MagicalPropertyType, [string, string, string]>;
13
13
  export default magicalPropertyTypes;
@@ -36,5 +36,8 @@ export declare enum CanASeeBType {
36
36
  TileIsInRange = 13,
37
37
  CurseDespawning = 14,
38
38
  CreatureDespawning = 15,
39
- CreatureOfferFromGround = 16
39
+ CreatureOfferFromGround = 16,
40
+ CursePositionRandom = 17,
41
+ CurseSpawning = 18,
42
+ CurseWitness = 19
40
43
  }
@@ -0,0 +1,36 @@
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 { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
12
+ import type Tile from "@wayward/game/game/tile/Tile";
13
+ import UniversalOverlay from "@wayward/game/renderer/overlay/UniversalOverlay";
14
+ import { DistanceType } from "@wayward/game/utilities/math/Vector2";
15
+ import type { IColorFul } from "@wayward/utilities/Color";
16
+ export interface IEffectRadiusOverlayColor extends Partial<IColorFul> {
17
+ alpha?: number;
18
+ }
19
+ export declare namespace IEffectRadiusOverlayColor {
20
+ function equals(a: IEffectRadiusOverlayColor | undefined, b: IEffectRadiusOverlayColor | undefined): boolean;
21
+ }
22
+ export default class EffectRadiusOverlay extends UniversalOverlay {
23
+ static readonly INSTANCE: EffectRadiusOverlay;
24
+ private readonly tilesInRange;
25
+ private readonly topLeft;
26
+ private readonly bottomRight;
27
+ type: DistanceType;
28
+ center: Tile | undefined;
29
+ range: number;
30
+ color?: IEffectRadiusOverlayColor;
31
+ constructor();
32
+ set(type: DistanceType, center: Tile, range: number, color?: IEffectRadiusOverlayColor): void;
33
+ unset(center: Tile): void;
34
+ protected generateOverlayInfo(tile: Tile, existingOverlay: IOverlayInfo | undefined): IOverlayInfo | undefined;
35
+ protected onGameReset(): void;
36
+ }
@@ -213,6 +213,10 @@ export declare class WorldRenderer extends EventEmitter.Host<IWorldRendererEvent
213
213
  private renderStatus;
214
214
  private spriteBatchForLayer;
215
215
  addTileToViewport(timeStamp: number, visibleTiles: Set<Tile>, tile: Tile, itemBatch: ISpriteBatch | undefined): void;
216
+ private addDoodadToViewport;
217
+ private addCreatureToViewport;
218
+ private addNPCToViewport;
219
+ private addCorpsesToViewport;
216
220
  /**
217
221
  * Computes sprites in the viewport
218
222
  * @returns True when there's more rendering to be done
@@ -47,6 +47,7 @@ export interface IOptions {
47
47
  disableOverlaySupport: boolean;
48
48
  disableQuitConfirmation: boolean;
49
49
  disableSpritePack: boolean;
50
+ disableUIAnimation: boolean;
50
51
  disableUIEffects: boolean;
51
52
  disableUIOpacity: boolean;
52
53
  discoveredEverything: boolean;
@@ -28,6 +28,8 @@ import type Tile from "@wayward/game/game/tile/Tile";
28
28
  import type { ITileData } from "@wayward/game/game/tile/ITerrain";
29
29
  import type Human from "@wayward/game/game/entity/Human";
30
30
  import type Entity from "@wayward/game/game/entity/Entity";
31
+ import type MagicalPropertyManager from "@wayward/game/game/magic/MagicalPropertyManager";
32
+ import type { CurseEventInstance } from "@wayward/game/game/curse/Curse";
31
33
  export interface IUpgradeVersion {
32
34
  name?: string;
33
35
  buildId?: IBuildId;
@@ -49,6 +51,8 @@ export interface IUpgradeVersion {
49
51
  upgradeTileEvent?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, tileEvent: TileEvent): any;
50
52
  upgradeCorpse?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, corpse: Corpse): any;
51
53
  upgradeAi?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, ai: AiManager): any;
54
+ upgradeMagic?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, magic?: MagicalPropertyManager): any;
55
+ upgradeCurseEvent?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, curseEvent: CurseEventInstance): any;
52
56
  upgradeCreatureZone?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, zone: CreatureZone): any;
53
57
  upgradeTile?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, tile: Tile): any;
54
58
  upgradeTileData?(version: Version.Info, upgrades: UpgradesArrayCompressedPusher, tile: Tile, tileData: ITileData[]): any;
@@ -0,0 +1,12 @@
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
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition<unknown>;
12
+ export default _default;
@@ -0,0 +1,12 @@
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
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition<unknown>;
12
+ export default _default;
@@ -0,0 +1,12 @@
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
+ declare const _default: import("@wayward/game/save/upgrade/UpgradeVersion").IUpgradeVersionDefinition<unknown>;
12
+ export default _default;
@@ -36,4 +36,6 @@ export default class OldUi {
36
36
  logErrorEvent(eventOrError: unknown, skipLog?: true): void;
37
37
  private loggingRejection;
38
38
  private logPromiseRejectionEvent;
39
+ refreshUiTranslations(): void;
40
+ private refreshUiTranslation;
39
41
  }
@@ -117,6 +117,7 @@ export default class ItemComponent extends Component implements ItemSlot {
117
117
  protected onUpdateQuality(): void;
118
118
  protected onUpdateBaseItem(): void;
119
119
  protected onTickEnd(): void;
120
+ protected onRevertFromDoodad(): void;
120
121
  protected onRooted(): void;
121
122
  protected onRootedAndAppend(): void;
122
123
  protected onLoadedOnIsland(): void;
@@ -45,6 +45,7 @@ export declare class Stats extends Component {
45
45
  * separated by how a given stat should be displayed
46
46
  */
47
47
  private getStats;
48
+ private getStat;
48
49
  private getDisplayOrder;
49
50
  /**
50
51
  * Returns how the stat on an entity should be displayed.
@@ -13,25 +13,29 @@ import type EntityWithStats from "@wayward/game/game/entity/EntityWithStats";
13
13
  import type { IEntityWithStatsEvents } from "@wayward/game/game/entity/EntityWithStats";
14
14
  import type Human from "@wayward/game/game/entity/Human";
15
15
  import type { IHumanEvents } from "@wayward/game/game/entity/IHuman";
16
- import type { IStat, IStatBase, Stat, StatDisplayType } from "@wayward/game/game/entity/IStats";
16
+ import type { IStat, IStatBase, StatDisplayType } from "@wayward/game/game/entity/IStats";
17
+ import { Stat } from "@wayward/game/game/entity/IStats";
17
18
  import type Creature from "@wayward/game/game/entity/creature/Creature";
18
19
  import type { ICreatureEvents } from "@wayward/game/game/entity/creature/ICreature";
19
20
  import type { IPlayerEvents } from "@wayward/game/game/entity/player/IPlayer";
20
21
  import type Player from "@wayward/game/game/entity/player/Player";
22
+ import type { IIslandEvents } from "@wayward/game/game/island/IIsland";
23
+ import type Island from "@wayward/game/game/island/Island";
21
24
  import type { Reference } from "@wayward/game/game/reference/IReferenceManager";
22
25
  import type Translation from "@wayward/game/language/Translation";
23
26
  import type { IModdable } from "@wayward/game/mod/ModRegistry";
24
27
  import type Component from "@wayward/game/ui/component/Component";
28
+ import type StatComponent from "@wayward/game/ui/screen/screens/game/static/stats/component/StatComponent";
25
29
  import type Tooltip from "@wayward/game/ui/tooltip/Tooltip";
26
30
  import type { IUntilSubscriber } from "@wayward/utilities/event/EventEmitter";
27
- export interface IStatDisplayDescription extends IModdable, IHasImagePath<string | ((entity: EntityWithStats, stat: IStat) => string)> {
31
+ export interface IStatDisplayDescription extends IModdable, IHasImagePath<string | ((entity: EntityWithStats, stat: IStat) => string | undefined)> {
28
32
  /**
29
33
  * This stat displays as multiple sub-stats. (Incompatible with all other properties)
30
34
  *
31
35
  * Sub-stats always display as `StatDisplayType.Attribute`
32
36
  */
33
37
  multi?: Map<Stat, IStatDisplayDescription>;
34
- imagePath?: string | ((entity: EntityWithStats | undefined, stat: IStat) => string);
38
+ imagePath?: string | ((entity: EntityWithStats | undefined, stat: IStat) => string | undefined);
35
39
  /**
36
40
  * The CSS variable to use for the stat bar color
37
41
  * Defaults to white
@@ -47,6 +51,11 @@ export interface IStatDisplayDescription extends IModdable, IHasImagePath<string
47
51
  * Defaults to black
48
52
  */
49
53
  darkColor?: string | ((entity: EntityWithStats | undefined, stat: IStat) => string);
54
+ /**
55
+ * By default statbars render as though they're full at the minimum value
56
+ * so that both the ::before and ::after elements can be used for animation.
57
+ */
58
+ disableRenderFullAtMin?: true;
50
59
  /**
51
60
  * Defaults to `StatDisplayType.Auto`
52
61
  */
@@ -58,7 +67,7 @@ export interface IStatDisplayDescription extends IModdable, IHasImagePath<string
58
67
  */
59
68
  displayOrder?: number;
60
69
  /**
61
- * Whether this stat display should be unlockable. (Unlocked by doing `player.addMilestone(Milestone.InternalStatDiscovery, stat)`)
70
+ * Whether this stat display should be unlockable. (Unlocked by doing `player.addMilestone(Milestone.InternalStatDiscovery, Stat[stat])`)
62
71
  */
63
72
  unlockable?: true;
64
73
  /**
@@ -77,7 +86,9 @@ export interface IStatDisplayDescription extends IModdable, IHasImagePath<string
77
86
  tooltip?: Reference | ((tooltip: Tooltip, entity: EntityWithStats, stat: IStat) => any);
78
87
  subscriber?: (events: IStatDisplayDescriptionSubscriber, refresh: () => void) => any;
79
88
  getValue?(entity?: EntityWithStats): number | undefined;
89
+ getMin?(entity?: EntityWithStats): number | undefined;
80
90
  getMax?(entity?: EntityWithStats): number | undefined;
91
+ tweak?(component: StatComponent): unknown;
81
92
  }
82
93
  export interface IStatDisplayDescriptionSubscriber {
83
94
  removed: Promise<[]>;
@@ -85,6 +96,7 @@ export interface IStatDisplayDescriptionSubscriber {
85
96
  human?: IUntilSubscriber<Human, IHumanEvents>;
86
97
  player?: IUntilSubscriber<Player, IPlayerEvents>;
87
98
  creature?: IUntilSubscriber<Creature, ICreatureEvents>;
99
+ island?: IUntilSubscriber<Island, IIslandEvents>;
88
100
  }
89
101
  export declare const STAT_DEFAULT_DISPLAY_ORDER = 100;
90
102
  export interface IStatInfo extends Partial<IStatBase> {
@@ -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 { IStatDisplayDescription } from "@wayward/game/ui/screen/screens/game/static/stats/IStatDisplayDescription";
12
+ declare const _default: IStatDisplayDescription;
13
+ export default _default;
@@ -48,6 +48,8 @@ export default abstract class StatComponent extends Component {
48
48
  readonly statIcon: ImagePath<PathType.StatIcon>;
49
49
  private readonly entityRef;
50
50
  protected get entity(): EntityWithStats | undefined;
51
+ private hidingDueToMilestone;
52
+ private updatingVisibility;
51
53
  constructor(entity: EntityWithStats, stat: Stat, noEvents?: true, statDescription?: import("../IStatDisplayDescription").IStatDisplayDescription | undefined);
52
54
  private onUpdateMilestone;
53
55
  protected onRemove(): void;
@@ -85,6 +87,7 @@ export default abstract class StatComponent extends Component {
85
87
  protected onStatChange(_?: any, stat?: IStat, oldValue?: number, info?: IStatChangeInfo): void;
86
88
  private getTooltip;
87
89
  private getTooltipLocation;
90
+ private updateVisibility;
88
91
  }
89
92
  export declare class StatsContainer extends Component {
90
93
  private readonly entity;
@@ -13,6 +13,7 @@ import { Tab } from "@wayward/game/ui/screen/screens/menu/component/Menu";
13
13
  export default class TabPerformance extends Tab implements IRefreshable {
14
14
  private readonly refreshables;
15
15
  private readonly acrylicTransparency;
16
+ private get animations();
16
17
  constructor();
17
18
  refresh(): this;
18
19
  private addRefreshable;
@@ -18,6 +18,7 @@ export default class TabVideo extends Tab implements IRefreshable {
18
18
  readonly checkButtonSmoothZooming: CheckButton;
19
19
  readonly inputUiScale: RangeRow;
20
20
  readonly inputHudWidth: RangeRow;
21
+ readonly checkButtonAnimations: CheckButton;
21
22
  constructor();
22
23
  refresh(): this;
23
24
  protected onViewportResize(): void;
@@ -26,4 +27,5 @@ export default class TabVideo extends Tab implements IRefreshable {
26
27
  private onCustomTitleBar;
27
28
  private onDitherFOW;
28
29
  private onDefaultCursor;
30
+ private onDisableUIAnimation;
29
31
  }
@@ -14,6 +14,26 @@ import { Direction } from "@wayward/game/utilities/math/Direction";
14
14
  import type { IVector2, IVector3 } from "@wayward/game/utilities/math/IVector";
15
15
  import Vector3 from "@wayward/game/utilities/math/Vector3";
16
16
  type ConsumerVectorRange = (vec: IVector2, value: number) => any;
17
+ export declare enum DistanceType {
18
+ /**
19
+ * The number of adjacent grid cell movements needed to get from A to B.
20
+ *
21
+ * This distance formula covers a diamond pattern on a grid.
22
+ */
23
+ Manhattan = 0,
24
+ /**
25
+ * The measure of a straight line between points A and B.
26
+ *
27
+ * This distance formula covers a circular pattern on a grid.
28
+ */
29
+ Euclidean = 1,
30
+ /**
31
+ * The greater of the distances from points A and B on each axis.
32
+ *
33
+ * This distance formula covers a square pattern on a grid.
34
+ */
35
+ Chebyshev = 2
36
+ }
17
37
  export default class Vector2 implements IVector2, ISerializable {
18
38
  static get ZERO(): Vector2;
19
39
  static get ONE(): Vector2;
@@ -45,12 +65,12 @@ export default class Vector2 implements IVector2, ISerializable {
45
65
  clientX?: number;
46
66
  clientY?: number;
47
67
  }): Vector2 | undefined;
48
- static inRange(center: IVector2, range: number, includeCenter?: boolean): Generator<IVector2>;
68
+ static inRange(type: DistanceType, center: IVector2, range: number, includeCenter?: boolean): Generator<IVector2>;
49
69
  static angle(directionInRadians: number, distance?: number): Vector2;
50
- static forRange(center: IVector2, range: number, consumer: ConsumerVectorRange): void;
51
- static forRange(center: IVector2, range: number, includeCenter: boolean, consumer: ConsumerVectorRange): void;
52
- static forRange(center: IVector2, range: number, min: IVector2, max: IVector2, consumer: ConsumerVectorRange): void;
53
- static forRange(center: IVector2, range: number, min: IVector2, max: IVector2, includeCenter: boolean, consumer: ConsumerVectorRange): void;
70
+ static forRange(type: DistanceType, center: IVector2, range: number, consumer: ConsumerVectorRange): void;
71
+ static forRange(type: DistanceType, center: IVector2, range: number, includeCenter: boolean, consumer: ConsumerVectorRange): void;
72
+ static forRange(type: DistanceType, center: IVector2, range: number, min: IVector2, max: IVector2, consumer: ConsumerVectorRange): void;
73
+ static forRange(type: DistanceType, center: IVector2, range: number, min: IVector2, max: IVector2, includeCenter: boolean, consumer: ConsumerVectorRange): void;
54
74
  static raycast(center: IVector2, range: number, angle: IVector2): IVector2[];
55
75
  static raycastArc(center: IVector2, radius: number, angleStart: IVector2 | number, angleEnd: IVector2 | number): IVector2[];
56
76
  static cross(vector: IVector2, vector2: IVector2): Vector3;
@@ -18,9 +18,9 @@ export default function range(maximum: number): IRange;
18
18
  * @param maximum Exclusive
19
19
  */
20
20
  export default function range(minimum: number, maximum: number): IRange;
21
- export interface IRange {
22
- minimum: number;
23
- maximum: number;
21
+ export interface IRange<T = number> {
22
+ minimum: T;
23
+ maximum: T;
24
24
  }
25
25
  export declare namespace IRange {
26
26
  const ZERO: Readonly<IRange>;
@@ -31,9 +31,9 @@ export declare namespace IRange {
31
31
  function add(...rangesOrNumbers: Array<IRange | number>): IRange;
32
32
  function flatten(rangeOrNumber: IRange | number): IRange | number;
33
33
  function flatten(rangeOrNumber: IRange | number | undefined): IRange | number | undefined;
34
- function multiply(range: IRange, by: number, into?: IRange): IRange;
35
- function ceil(range: IRange, into?: IRange): IRange;
36
- function floor(range: IRange, into?: IRange): IRange;
34
+ function multiply(range: IRange, by: number, into?: IRange<number>): IRange;
35
+ function ceil(range: IRange, into?: IRange<number>): IRange;
36
+ function floor(range: IRange, into?: IRange<number>): IRange;
37
37
  function average(range: IRange): number;
38
38
  namespace Optional {
39
39
  function simplify(value: number | IRange): number | IRange;
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.0-beta.dev.20251011.1",
4
+ "version": "2.15.0-beta.dev.20251018.2",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",