@wayward/types 2.14.4-beta.dev.20250102.1 → 2.14.4-beta.dev.20250104.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 +0 -2
- package/definitions/game/game/entity/Human.d.ts +9 -1
- package/definitions/game/game/entity/action/ActionExecutor.d.ts +9 -8
- package/definitions/game/game/inspection/infoProviders/doodad/StillWater.d.ts +3 -5
- package/definitions/game/game/island/automation/IAutomation.d.ts +10 -0
- package/definitions/game/game/tile/Tile.d.ts +9 -1
- package/definitions/game/game/time/TimeManager.d.ts +8 -0
- package/definitions/game/language/dictionary/Message.d.ts +794 -791
- package/definitions/game/language/dictionary/UiTranslation.d.ts +855 -853
- package/definitions/game/save/upgrade/UpgradeVersionRegistry.d.ts +2 -0
- package/definitions/game/steamworks/Steamworks.d.ts +5 -1
- package/definitions/game/ui/component/Component.d.ts +1 -0
- package/definitions/game/ui/screen/screens/game/component/InspectionsList.d.ts +0 -1
- package/definitions/game/ui/screen/screens/game/dialog/QuestDialog.d.ts +1 -0
- package/definitions/game/ui/tooltip/Tooltip.d.ts +2 -2
- package/definitions/game/ui/util/ComponentManipulator.d.ts +6 -5
- package/definitions/game/utilities/Observer.d.ts +1 -1
- package/definitions/game/utilities/memory/MemoryLeakDetector.d.ts +7 -1
- package/definitions/server/error/util/SendDiscordMessage.d.ts +19 -0
- package/definitions/utilities/Log.d.ts +1 -0
- package/definitions/utilities/Version.d.ts +3 -2
- package/definitions/utilities/event/EventEmitter.d.ts +13 -0
- package/definitions/utilities/memory/ILifetime.d.ts +5 -1
- package/package.json +1 -1
@@ -11,8 +11,10 @@
|
|
11
11
|
import type { IUpgradeVersion, UpgradeParameters, UpgradeType } from "@wayward/game/save/upgrade/UpgradeVersion";
|
12
12
|
import type UpgradesArray from "@wayward/game/save/upgrade/UpgradesArray";
|
13
13
|
import type Version from "@wayward/utilities/Version";
|
14
|
+
import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
|
14
15
|
export declare const BUILD_TIME_INTRODUCED_TIME: Date;
|
15
16
|
declare namespace UpgradeVersionRegistry {
|
17
|
+
function getMostRecentBuildId(): IBuildId | undefined;
|
16
18
|
function getAll(): readonly IUpgradeVersion[];
|
17
19
|
function run<TYPE extends UpgradeType>(version: Version.Info, messages: UpgradesArray, which: TYPE, ...params: UpgradeParameters<TYPE>): void;
|
18
20
|
}
|
@@ -12,7 +12,7 @@ import type { HeapStatistics } from "electron";
|
|
12
12
|
import type { Game } from "@wayward/game/game/Game";
|
13
13
|
import type Entity from "@wayward/game/game/entity/Entity";
|
14
14
|
import IActionContext from "@wayward/game/game/entity/action/IActionContext";
|
15
|
-
import { ModType } from "@wayward/game/mod/IModInformation";
|
15
|
+
import { ModState, ModType } from "@wayward/game/mod/IModInformation";
|
16
16
|
import type { ModInformation } from "@wayward/game/mod/ModInformation";
|
17
17
|
import type { IJoinServerOptions, ServerInfo } from "@wayward/game/multiplayer/IMultiplayer";
|
18
18
|
import type { IDedicatedServerInfo, IModPath, ISteamworksEvents, RunningContext, SteamStatTypeValues } from "@wayward/game/steamworks/ISteamworks";
|
@@ -219,6 +219,10 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
|
|
219
219
|
private refreshSetupMods;
|
220
220
|
private cleanupTemporaryLocalFiles;
|
221
221
|
private cleanupTemporaryRemoteFiles;
|
222
|
+
/**
|
223
|
+
* Called when the overlay is closed or when the refresh mods button is clicked
|
224
|
+
*/
|
225
|
+
refreshWorkshopMods(waitForRefresh?: boolean, initialModState?: ModState.Enabled | ModState.Disabled): Promise<void>;
|
222
226
|
private refreshPublishedMods;
|
223
227
|
private getIdFromWorkshopItem;
|
224
228
|
private syncWorkshopItems;
|
@@ -94,6 +94,7 @@ 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;
|
97
98
|
/**
|
98
99
|
* Alias of `.element.addEventListener`, except it returns `this` instead and prevents memory leaks
|
99
100
|
*/
|
@@ -30,7 +30,6 @@ export default abstract class InspectionsList<INSPECTIONS_HANDLER extends Inspec
|
|
30
30
|
event: IEventEmitter<this, ITileInspectionsEvents>;
|
31
31
|
private readonly paragraphInspectionsInvalid;
|
32
32
|
private inspectTypeFilter;
|
33
|
-
private _removed?;
|
34
33
|
protected inspectionsHandler?: InspectionsHandler;
|
35
34
|
protected refreshPromiseSequence: PromiseSequence;
|
36
35
|
protected inspectionsHandlerUpdatedInspectionsCallback?: (_: any, inspectType: InspectType, inspections: HashSet<Inspection<any>>, oldInspections: HashSet<Inspection<any>> | undefined) => void;
|
@@ -27,6 +27,7 @@ export default class QuestDialog extends Dialog {
|
|
27
27
|
private readonly childQuestsHeading;
|
28
28
|
private readonly childQuests;
|
29
29
|
private readonly completeQuestButton;
|
30
|
+
private readonly activateQuestButton;
|
30
31
|
private current;
|
31
32
|
constructor();
|
32
33
|
getBindable(): Bindable;
|
@@ -43,9 +43,9 @@ export default class Tooltip extends Component {
|
|
43
43
|
private forceShown;
|
44
44
|
private maxWidth;
|
45
45
|
private hasSetPosition;
|
46
|
-
initialized?: Promise<
|
46
|
+
initialized?: Promise<boolean>;
|
47
47
|
context?: InfoProviderContext;
|
48
|
-
constructor(source: Component | HTMLElement, initialize?: (tooltip: Tooltip) =>
|
48
|
+
constructor(source: Component | HTMLElement, initialize?: (tooltip: Tooltip) => Promise<boolean>);
|
49
49
|
protected onRemove(): void;
|
50
50
|
setSecondary(): this;
|
51
51
|
setForceShown(forceShown?: boolean): this;
|
@@ -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
|
+
import type Component from "@wayward/game/ui/component/Component";
|
11
12
|
export type Until<T> = Record<string, (...args: any[]) => T>;
|
12
13
|
export type UntilHandler<T, U extends Until<T>> = {
|
13
14
|
[key in keyof U]: {
|
@@ -16,7 +17,7 @@ export type UntilHandler<T, U extends Until<T>> = {
|
|
16
17
|
};
|
17
18
|
};
|
18
19
|
type EmptyIfUndefined<T> = T extends undefined ? Empty : T;
|
19
|
-
export declare abstract class Manipulator<T, U extends Until<T> | undefined = undefined> {
|
20
|
+
export declare abstract class Manipulator<T extends Component, U extends Until<T> | undefined = undefined> {
|
20
21
|
protected readonly element: () => HTMLElement;
|
21
22
|
protected readonly host: T;
|
22
23
|
protected getUntilHandler?(): UntilHandler<T, EmptyIfUndefined<U>>;
|
@@ -32,7 +33,7 @@ export interface ClassUntil<T> extends Until<T> {
|
|
32
33
|
remove(...classes: string[]): T;
|
33
34
|
toggle(hasClass: boolean, ...classes: string[]): T;
|
34
35
|
}
|
35
|
-
export declare class ClassManipulator<T> extends Manipulator<T, ClassUntil<T>> {
|
36
|
+
export declare class ClassManipulator<T extends Component> extends Manipulator<T, ClassUntil<T>> {
|
36
37
|
protected getUntilHandler(): {
|
37
38
|
add: {
|
38
39
|
start: (...classes: string[]) => T;
|
@@ -68,7 +69,7 @@ export interface AttributeUntil<T> extends Until<T> {
|
|
68
69
|
set(attribute: string, value: string): T;
|
69
70
|
set(attributes: Iterable<[string, string | null]>): T;
|
70
71
|
}
|
71
|
-
export declare class AttributeManipulator<T> extends Manipulator<T, AttributeUntil<T>> {
|
72
|
+
export declare class AttributeManipulator<T extends Component> extends Manipulator<T, AttributeUntil<T>> {
|
72
73
|
protected getUntilHandler(): {
|
73
74
|
set: any;
|
74
75
|
};
|
@@ -80,7 +81,7 @@ export declare class AttributeManipulator<T> extends Manipulator<T, AttributeUnt
|
|
80
81
|
has(...attributes: string[]): boolean;
|
81
82
|
private getAttributeIterator;
|
82
83
|
}
|
83
|
-
export declare class DataManipulator<T> extends Manipulator<T> {
|
84
|
+
export declare class DataManipulator<T extends Component> extends Manipulator<T> {
|
84
85
|
set(name: string, value: string): T;
|
85
86
|
set(data: Iterable<[string, string | undefined]>): T;
|
86
87
|
get(name: string): string;
|
@@ -92,7 +93,7 @@ export declare class DataManipulator<T> extends Manipulator<T> {
|
|
92
93
|
export interface StyleUntil<T> extends Until<T> {
|
93
94
|
set(rule: string, value: string): T;
|
94
95
|
}
|
95
|
-
export declare class StyleManipulator<T> extends Manipulator<T, StyleUntil<T>> {
|
96
|
+
export declare class StyleManipulator<T extends Component> extends Manipulator<T, StyleUntil<T>> {
|
96
97
|
protected getUntilHandler(): {
|
97
98
|
set: {
|
98
99
|
start: (rule: string, value: string | number) => T;
|
@@ -57,7 +57,7 @@ declare namespace Observer {
|
|
57
57
|
start(): void;
|
58
58
|
end(): void;
|
59
59
|
setDefaultPriority(priority?: number): this;
|
60
|
-
inherit(registrar: IRegistrar<any>):
|
60
|
+
inherit(registrar: IRegistrar<any>): HOST;
|
61
61
|
}
|
62
62
|
export function createRegistrar<HOST>(host: HOST, handler: () => any): IRegistrar<HOST>;
|
63
63
|
export {};
|
@@ -16,11 +16,17 @@ declare class MemoryLeakDetector {
|
|
16
16
|
private objectsCollected;
|
17
17
|
private readonly objects;
|
18
18
|
private activeTask;
|
19
|
+
private queuedGarbageCollectionTimeoutId;
|
19
20
|
get isReportingErrors(): boolean;
|
20
21
|
get isMonitoring(): boolean;
|
21
22
|
getCount(prefix: string): number;
|
23
|
+
/**
|
24
|
+
* Queues a garbage collection to run after a delay
|
25
|
+
* @param delay Delay in milliseconds
|
26
|
+
*/
|
27
|
+
queueNextGarbageCollection(delay?: number): void;
|
22
28
|
waitForIdle(): Promise<void>;
|
23
|
-
register(object: object, objectName: string, expectedLifetime: ExpectedLifetime, parentObjectIdentifier?: string): void;
|
29
|
+
register(object: object, objectName: string, expectedLifetime: ExpectedLifetime, parentObjectIdentifier?: string, includeStackTrace?: boolean): void;
|
24
30
|
registerMultiple<T extends object>(prefix: string, objects: SaferArray<T>, objectNamer: (object: T) => string, expectedLifetime: ExpectedLifetime): void;
|
25
31
|
onStopPlay(): void;
|
26
32
|
onScreenShow(_: any, screen: Screen): Promise<any>;
|
@@ -0,0 +1,19 @@
|
|
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 interface IDiscordMessage {
|
12
|
+
color?: number;
|
13
|
+
author?: string;
|
14
|
+
title: string;
|
15
|
+
url?: string;
|
16
|
+
description?: string;
|
17
|
+
footer?: string;
|
18
|
+
}
|
19
|
+
export default function (message: IDiscordMessage): Promise<void>;
|
@@ -87,6 +87,7 @@ declare namespace Log {
|
|
87
87
|
Memory = 2
|
88
88
|
}
|
89
89
|
function setMemoryLog(memoryLog: MemoryLog | undefined): void;
|
90
|
+
function setTimestampType(type: "full" | "build"): void;
|
90
91
|
function disableFileLogger(): void;
|
91
92
|
function disableFileLoggingForSource(source: string): void;
|
92
93
|
function initializeGameState(): void;
|
@@ -9,6 +9,7 @@
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
10
10
|
*/
|
11
11
|
import type { IBuild, IBuildId } from "@wayward/hosts/shared/globalTypes";
|
12
|
+
import type { IFileSystem } from "@wayward/hosts/shared/ipc/fileSystem";
|
12
13
|
export interface IVersionInfo {
|
13
14
|
str: Version.String;
|
14
15
|
strSemver: Version.StringSemVer;
|
@@ -30,7 +31,7 @@ export declare namespace IVersionInfo {
|
|
30
31
|
}
|
31
32
|
}
|
32
33
|
declare namespace Version {
|
33
|
-
export function readBuildFile(): Promise<IBuild | undefined>;
|
34
|
+
export function readBuildFile(path?: string, fs?: IFileSystem): Promise<IBuild | undefined>;
|
34
35
|
export type Stage = "beta" | "release";
|
35
36
|
export type String = `${Stage}${bigint}.${bigint}.${bigint}` | `${Stage}${bigint}.${bigint}` | `${Stage}${bigint}`;
|
36
37
|
export type StringSemVer = `${bigint}.${bigint}.${bigint}-${Stage}` | `${bigint}.${bigint}.${bigint}`;
|
@@ -68,7 +69,7 @@ declare namespace Version {
|
|
68
69
|
export function createRawVersionInfo(stage: Version.Stage, major: number, minor: number, patch?: number, date?: Date): IVersionInfo;
|
69
70
|
export function convertStringToRawInfo(version: Version.String | Version.StringSemVer | Version.StringBuildId): IVersionInfo;
|
70
71
|
export function create(stage: Version.Stage, major: number, minor: number, patch?: number, date?: Date): Info;
|
71
|
-
export function getVersionInfo(version
|
72
|
+
export function getVersionInfo(version?: IVersionInfo | Version.String | Version.StringSemVer | Version.StringBuildId): Info;
|
72
73
|
export function isSameVersion(version: IVersionInfo, compareVersion: IVersionInfo): boolean;
|
73
74
|
const timezones: {
|
74
75
|
nz: string;
|
@@ -79,6 +79,10 @@ export interface IEventEmitter<H = any, E = any> {
|
|
79
79
|
until<E2>(emitter: IEventEmitterHost<E2>, ...events: Array<keyof E2>): IUntilSubscriber<H, E>;
|
80
80
|
until(promise: Promise<any>): IUntilSubscriber<H, E>;
|
81
81
|
hasHandlersForEvent(...events: Array<keyof E>): boolean;
|
82
|
+
/**
|
83
|
+
* Closes an event emitter, which will prevent any further subscriptions from being made.
|
84
|
+
*/
|
85
|
+
close(): void;
|
82
86
|
}
|
83
87
|
export interface IUntilSubscriber<H, E> {
|
84
88
|
until(promise: Promise<any>): this;
|
@@ -101,7 +105,16 @@ declare class EventEmitter<H, E> {
|
|
101
105
|
private subscriptions?;
|
102
106
|
private cachedEmitSelfHandlers?;
|
103
107
|
private cachedClassHandlers?;
|
108
|
+
private closed?;
|
104
109
|
constructor(host: H);
|
110
|
+
/**
|
111
|
+
* Closes an event emitter, which will prevent any further subscriptions from being made.
|
112
|
+
*/
|
113
|
+
close(): void;
|
114
|
+
/**
|
115
|
+
* @returns True if closed
|
116
|
+
*/
|
117
|
+
private throwErrorIfClosed;
|
105
118
|
raw(): IEventEmitter<H, E>;
|
106
119
|
emitSelf<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
107
120
|
emit<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
@@ -16,5 +16,9 @@ export declare enum ExpectedLifetime {
|
|
16
16
|
/**
|
17
17
|
* should only exist while playing the game
|
18
18
|
*/
|
19
|
-
WhilePlaying = 1
|
19
|
+
WhilePlaying = 1,
|
20
|
+
/**
|
21
|
+
* The object is expected to last until the next garbage collection system
|
22
|
+
*/
|
23
|
+
UntilNextGarbageCollection = 2
|
20
24
|
}
|
package/package.json
CHANGED