@wayward/types 2.14.4-beta.dev.20250105.1 → 2.14.4-beta.dev.20250107.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.
- package/definitions/game/game/doodad/Doodad.d.ts +7 -2
- package/definitions/game/game/doodad/DoodadUtilities.d.ts +25 -0
- package/definitions/game/game/doodad/IDoodad.d.ts +6 -0
- package/definitions/game/game/inspection/InfoProvider.d.ts +0 -2
- package/definitions/game/game/item/IItem.d.ts +2 -1
- package/definitions/game/ui/component/Component.d.ts +0 -1
- package/definitions/game/ui/input/InputManager.d.ts +1 -0
- package/definitions/game/ui/input/Macros.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/component/ItemComponent.d.ts +5 -0
- package/definitions/utilities/Log.d.ts +25 -1
- package/definitions/utilities/object/Objects.d.ts +8 -0
- package/definitions/utilities/prototype/Array.d.ts +2 -1
- package/package.json +1 -1
@@ -19,7 +19,7 @@ import type Human from "@wayward/game/game/entity/Human";
|
|
19
19
|
import type { IEntityConstructorOptions } from "@wayward/game/game/entity/IEntity";
|
20
20
|
import { EntityType } from "@wayward/game/game/entity/IEntity";
|
21
21
|
import { SkillType } from "@wayward/game/game/entity/IHuman";
|
22
|
-
import { EquipType } from "@wayward/game/game/entity/IHuman";
|
22
|
+
import type { EquipType } from "@wayward/game/game/entity/IHuman";
|
23
23
|
import { ActionType } from "@wayward/game/game/entity/action/IAction";
|
24
24
|
import type Creature from "@wayward/game/game/entity/creature/Creature";
|
25
25
|
import type Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
|
@@ -210,7 +210,7 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
|
|
210
210
|
/**
|
211
211
|
* Returns whether the doodad can be trampled
|
212
212
|
*/
|
213
|
-
canTrample(): boolean
|
213
|
+
canTrample(): boolean;
|
214
214
|
/**
|
215
215
|
* Trampling growing things.
|
216
216
|
*/
|
@@ -323,6 +323,11 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
|
|
323
323
|
* Regenerate (heal durability) over time
|
324
324
|
*/
|
325
325
|
private processRegeneration;
|
326
|
+
/**
|
327
|
+
* Process the magical properties of the doodad when updating
|
328
|
+
* @param ticks the number of ticks to process
|
329
|
+
*/
|
330
|
+
private processMagicalProperties;
|
326
331
|
/**
|
327
332
|
* Melt doodads (or things on doodads over time)
|
328
333
|
* @param description Doodad description
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2011-2024 Unlok
|
3
|
+
* https://www.unlok.ca
|
4
|
+
*
|
5
|
+
* Credits & Thanks:
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
7
|
+
*
|
8
|
+
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
9
|
+
* https://github.com/WaywardGame/types/wiki
|
10
|
+
*/
|
11
|
+
import type Doodad from "@wayward/game/game/doodad/Doodad";
|
12
|
+
import type { DoodadType } from "@wayward/game/game/doodad/IDoodad";
|
13
|
+
import { GrowingStage } from "@wayward/game/game/doodad/IDoodad";
|
14
|
+
import type Human from "@wayward/game/game/entity/Human";
|
15
|
+
declare namespace DoodadUtilities {
|
16
|
+
type DoodadIn = Doodad | DoodadType;
|
17
|
+
export function hasGrownEnoughIfCanGrow(doodad: Doodad, requiredGrowthStage: GrowingStage): boolean;
|
18
|
+
export function hasGrownEnoughIfCanGrow(doodad: DoodadIn, requiredGrowthStage: GrowingStage): undefined;
|
19
|
+
export function wouldWalkingOnDealFireDamage(doodad: DoodadIn, human?: Human): boolean;
|
20
|
+
export function wouldWalkingOnDealNormalDamage(doodad: DoodadIn, human?: Human): boolean;
|
21
|
+
export function isDangerous(doodad: DoodadIn, human?: Human): boolean;
|
22
|
+
export function canCauseStatus(doodad: DoodadIn): boolean;
|
23
|
+
export {};
|
24
|
+
}
|
25
|
+
export default DoodadUtilities;
|
@@ -528,6 +528,12 @@ export declare enum GrowingStage {
|
|
528
528
|
Ripening = 5,
|
529
529
|
Bare = 6
|
530
530
|
}
|
531
|
+
export declare namespace Growth {
|
532
|
+
function isAtLeast(growth: GrowingStage | undefined, stage: GrowingStage): boolean;
|
533
|
+
function isAtMost(growth: GrowingStage | undefined, stage: GrowingStage): boolean;
|
534
|
+
function isMoreThan(growth: GrowingStage | undefined, stage: GrowingStage): boolean;
|
535
|
+
function isLessThan(growth: GrowingStage | undefined, stage: GrowingStage): boolean;
|
536
|
+
}
|
531
537
|
export interface IHasBuilder {
|
532
538
|
getBuilder(): Human | undefined;
|
533
539
|
}
|
@@ -126,8 +126,6 @@ export declare abstract class InfoProvider extends EventEmitter.Host<IInfoProvid
|
|
126
126
|
* Call when this info provider should be removed.
|
127
127
|
*/
|
128
128
|
remove(): this;
|
129
|
-
onStoppingPlay(): void;
|
130
|
-
onPreMoveToIsland(): void;
|
131
129
|
private _shouldDisplayWhenEmpty;
|
132
130
|
protected shouldDisplayWhenEmpty(): boolean;
|
133
131
|
setShouldDisplayWhenEmpty(shouldDisplayWhenEmpty?: boolean): this;
|
@@ -1852,7 +1852,8 @@ export declare enum ItemTypeGroup {
|
|
1852
1852
|
ExcludedFromRandom = -9856,
|
1853
1853
|
Leaves = -9855,
|
1854
1854
|
Flute = -9854,
|
1855
|
-
|
1855
|
+
InternalNoDropOnDoodadBreak = -9853,
|
1856
|
+
All = -9852
|
1856
1857
|
}
|
1857
1858
|
export type StillContainerBaseItemType = ItemType.Waterskin | ItemType.GlassBottle | ItemType.ClayJug | ItemType.CoconutContainer;
|
1858
1859
|
export interface IItemMovementResult {
|
@@ -94,7 +94,6 @@ export default class Component<E extends HTMLElement = HTMLElement> extends Even
|
|
94
94
|
*/
|
95
95
|
get selectable(): SelectableLayer | false;
|
96
96
|
constructor(elementType?: string, namespace?: Namespace);
|
97
|
-
toString(): string;
|
98
97
|
/**
|
99
98
|
* Alias of `.element.addEventListener`, except it returns `this` instead and prevents memory leaks
|
100
99
|
*/
|
@@ -107,6 +107,7 @@ declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
|
|
107
107
|
register(component: Component): this;
|
108
108
|
deregister(): this;
|
109
109
|
isRegistered(): boolean;
|
110
|
+
private didReset;
|
110
111
|
reset(): void;
|
111
112
|
/**
|
112
113
|
* @param disabler Each `disableUntil` call should be given a unique `disabler`,
|
@@ -37,7 +37,7 @@ declare namespace Macros {
|
|
37
37
|
function getCurrent(): Macro;
|
38
38
|
function getTouch(): Macro;
|
39
39
|
function reset(): void;
|
40
|
-
function setHandled(): void;
|
40
|
+
function setHandled(input: IInput): void;
|
41
41
|
function setIsolated(_isolated?: boolean): void;
|
42
42
|
function didRequestIsolation(): boolean;
|
43
43
|
function handleInput(input: IInput, api: IBindHandlerApi): Macro | undefined;
|
@@ -69,6 +69,11 @@ export declare enum ItemRefreshType {
|
|
69
69
|
export interface IItemComponentEvents extends Events<Component>, IDraggableEvents, IItemSlotEvents, ISortableDraggableEvents {
|
70
70
|
deregisterHighlights(): any;
|
71
71
|
refresh(type: ItemRefreshType): any;
|
72
|
+
/**
|
73
|
+
* Called when the item (within the item component) is changing.
|
74
|
+
* Usually during a refresh.
|
75
|
+
*/
|
76
|
+
itemChange(): any;
|
72
77
|
}
|
73
78
|
export interface IItemComponentStaticEvents {
|
74
79
|
update(type: ItemRefreshType): any;
|
@@ -129,11 +129,35 @@ declare namespace Log {
|
|
129
129
|
* @param sources A list of sources to log to.
|
130
130
|
*/
|
131
131
|
function trace(...sources: string[]): (...args: any[]) => void;
|
132
|
+
/**
|
133
|
+
* Warns about an occurrence of something, due to a specific caller, once per session.
|
134
|
+
* @param skip Number of callsites to skip. Automatically skips this function and its caller.
|
135
|
+
* If this is called from a function that is registered in `Errors.ts` as a skipped callsite, you might have to pass `-1`.
|
136
|
+
* @param id The ID of this warning. Can be `Log.simplify` strings.
|
137
|
+
*/
|
138
|
+
function warnForCaller(skip: number, id: ArrayOr<string | SimplifyString>, ...message: any[]): void;
|
132
139
|
/**
|
133
140
|
* Warn about something once per session based on unique warning ids.
|
134
141
|
* This is like how node.js does warnings in console.
|
135
142
|
*/
|
136
|
-
function warnOncePerSession(warningId: string |
|
143
|
+
function warnOncePerSession(warningId: ArrayOr<string | SimplifyString>, ...message: any[]): void;
|
144
|
+
interface SimplifyString extends String {
|
145
|
+
simplified: string;
|
146
|
+
}
|
147
|
+
namespace SimplifyString {
|
148
|
+
function is(value: unknown): value is SimplifyString;
|
149
|
+
function get(value: unknown): string;
|
150
|
+
}
|
151
|
+
function simplify(segments: TemplateStringsArray, ...interpolations: unknown[]): SimplifyString;
|
152
|
+
function simplify(mainLog: string, simplified: string): SimplifyString;
|
153
|
+
/**
|
154
|
+
* Returns a combination of the object's constructor and the result of calling `toString` on it.
|
155
|
+
*
|
156
|
+
* If the `toString` result is redundant or useless, it is omitted.
|
157
|
+
*
|
158
|
+
* The resulting string will be automatically simplified when reported to the error server.
|
159
|
+
*/
|
160
|
+
function objectToString(object?: object): string;
|
137
161
|
}
|
138
162
|
declare class NullLog extends BaseLog {
|
139
163
|
setup(): void;
|
@@ -49,6 +49,14 @@ declare namespace Objects {
|
|
49
49
|
};
|
50
50
|
function getDirections(target: any, within: any): Generator<string[]>;
|
51
51
|
function stringify(object: any, pretty?: boolean, noDepth?: boolean, maxIterations?: number): string;
|
52
|
+
namespace stringify {
|
53
|
+
const SYMBOL_EXCLUDED_PROPERTIES: unique symbol;
|
54
|
+
export function excludeProperties(...properties: string[]): {
|
55
|
+
[SYMBOL_EXCLUDED_PROPERTIES]: string[];
|
56
|
+
};
|
57
|
+
export function isExcluded(object: any, property: string): boolean;
|
58
|
+
export {};
|
59
|
+
}
|
52
60
|
function mutable<T>(object: T): Mutable<T>;
|
53
61
|
function removeUndefinedProperties<T extends object>(object: T): T;
|
54
62
|
function filterProperties<T extends object>(object: T, filter: (key: keyof T, value: T[keyof T]) => any): T;
|
@@ -25,7 +25,8 @@ declare global {
|
|
25
25
|
toggle(value: T, includes?: boolean): void;
|
26
26
|
awaitAll(): Promise<Array<Awaited<T>>>;
|
27
27
|
layerSort(sortInitializer: (sorter: ISorter<T>) => any): T[];
|
28
|
-
groupBy<GROUP>(grouper: (value: T, index: number,
|
28
|
+
groupBy<GROUP>(grouper: (value: T, index: number, array: T[]) => GROUP): Array<[GROUP, T[]]>;
|
29
|
+
groupBy<GROUP, R>(grouper: (value: T, index: number, array: T[]) => GROUP, mapper: (values: T[], group: GROUP) => R): Array<[GROUP, R]>;
|
29
30
|
/**
|
30
31
|
* Alias of `.toSet().toArray()`
|
31
32
|
*/
|
package/package.json
CHANGED