@wayward/types 2.11.0-beta.dev.20211202.1 → 2.11.0-beta.dev.20211205.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.
- package/definitions/game/game/entity/Human.d.ts +1 -0
- package/definitions/game/game/inspection/InfoProvider.d.ts +2 -0
- package/definitions/game/game/inspection/inspections/ItemInspection.d.ts +1 -1
- package/definitions/game/game/item/IItem.d.ts +4 -0
- package/definitions/game/game/item/Item.d.ts +12 -2
- package/definitions/game/game/item/ItemManager.d.ts +4 -4
- package/definitions/game/game/item/ItemRecipeRequirementChecker.d.ts +4 -4
- package/definitions/game/game/item/ItemReferenceManager.d.ts +0 -1
- package/definitions/game/game/mapping/DrawnMap.d.ts +2 -1
- package/definitions/game/game/reference/ReferenceManager.d.ts +2 -2
- package/definitions/game/language/dictionary/Message.d.ts +885 -884
- package/definitions/game/renderer/Renderer.d.ts +1 -1
- package/definitions/game/save/serializer/Serializer.d.ts +1 -0
- package/definitions/game/ui/input/InputManager.d.ts +7 -0
- package/definitions/game/ui/old/screens/InGameScreen.d.ts +1 -1
- package/definitions/game/ui/screen/Screen.d.ts +3 -2
- package/definitions/game/ui/screen/screens/game/InspectionsTooltipHandler.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/component/CanvasDialog.d.ts +2 -0
- package/definitions/game/ui/screen/screens/game/component/GameDetails.d.ts +1 -0
- package/definitions/game/ui/screen/screens/game/component/InspectionsList.d.ts +4 -0
- package/definitions/game/ui/screen/screens/game/static/Messages.d.ts +1 -0
- package/definitions/game/ui/screen/screens/menu/MenuManager.d.ts +11 -1
- package/definitions/game/ui/tooltip/TooltipManager.d.ts +1 -1
- package/definitions/game/utilities/Log.d.ts +11 -10
- package/definitions/game/utilities/Timer.d.ts +25 -0
- package/definitions/game/utilities/memory/ILifetime.d.ts +20 -0
- package/definitions/game/utilities/memory/IMemoryLeakDetector.d.ts +1 -6
- package/definitions/game/utilities/memory/MemoryLeakDetector.d.ts +1 -1
- package/package.json +1 -1
- package/tsconfig.mod.base.json +2 -1
|
@@ -21,7 +21,7 @@ export default class Renderer extends EventEmitter.Host<IRendererEvents> {
|
|
|
21
21
|
readonly id: number;
|
|
22
22
|
readonly worldRenderer: WorldRenderer;
|
|
23
23
|
private fadeInTime;
|
|
24
|
-
private thumbnailResolve
|
|
24
|
+
private thumbnailResolve;
|
|
25
25
|
private ambientLightLevelCache;
|
|
26
26
|
private updateRendering;
|
|
27
27
|
private animationTimer;
|
|
@@ -14,6 +14,7 @@ import StringTokenizer from "save/serializer/StringTokenizer";
|
|
|
14
14
|
export default class Serializer implements ISerializer {
|
|
15
15
|
private readonly options;
|
|
16
16
|
private readonly stringTokenizer?;
|
|
17
|
+
static convertStringToUint8Array(data: string): Uint8Array;
|
|
17
18
|
private static array;
|
|
18
19
|
private static usingArray;
|
|
19
20
|
private static readonly savedObjectCache;
|
|
@@ -110,7 +110,14 @@ declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
|
|
|
110
110
|
*/
|
|
111
111
|
extractModifiers(evt: Event): Set<Modifier> | undefined;
|
|
112
112
|
getCatalyst(evt: Event): InputCatalyst | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* @param disabler Each `disableUntil` call should be given a unique `disabler`,
|
|
115
|
+
* as this system uses the timing from the latest `disableUntil` call
|
|
116
|
+
*/
|
|
113
117
|
disableUntil(until: number | Promise<any>, disabler: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* @param disabler Each `disable` call should be given a unique `disabler`
|
|
120
|
+
*/
|
|
114
121
|
disable(disabler: string): boolean;
|
|
115
122
|
enable(disabler: string): void;
|
|
116
123
|
isDisabled(): boolean;
|
|
@@ -165,7 +165,7 @@ export default class InGameScreen extends BaseScreen {
|
|
|
165
165
|
setQuickSlotByContextAction(quickSlot: number, action: IContextMenuAction): void;
|
|
166
166
|
addItemToFreeQuickSlot(itemId: number): boolean;
|
|
167
167
|
clearQuickSlot(quickSlot: number, internal?: boolean): void;
|
|
168
|
-
removeItemFromQuickSlot(itemId?: number, skipSync?: boolean): void;
|
|
168
|
+
removeItemFromQuickSlot(quickSlot: number, itemId?: number, skipSync?: boolean): void;
|
|
169
169
|
setItemQuickslot(item: Item, quickSlot: number | undefined): void;
|
|
170
170
|
updateQuickSlotItem(quickSlot: number): boolean;
|
|
171
171
|
onUpdateQuickSlotsOrEquips(): void;
|
|
@@ -31,13 +31,14 @@ export default abstract class Screen extends Component {
|
|
|
31
31
|
log: Log;
|
|
32
32
|
private contextMenu?;
|
|
33
33
|
private mouse;
|
|
34
|
-
get background(): Background;
|
|
35
|
-
set background(background: Background);
|
|
36
34
|
readonly menus: MenuManager;
|
|
37
35
|
dialogs: DialogManager;
|
|
38
36
|
visibleDialogs: IDialogStates;
|
|
39
37
|
constructor(type: ScreenId);
|
|
40
38
|
remove(): this;
|
|
39
|
+
getBackground(): Background;
|
|
40
|
+
setBackground(background: Background): this;
|
|
41
|
+
removeBackground(): this;
|
|
41
42
|
/**
|
|
42
43
|
* Remove the context menu from this element
|
|
43
44
|
*/
|
|
@@ -21,7 +21,7 @@ export default abstract class InspectionsTooltipHandler<INSPECTIONS_LIST extends
|
|
|
21
21
|
showExtraInfo?: Text;
|
|
22
22
|
} | undefined;
|
|
23
23
|
private lastMousePosition?;
|
|
24
|
-
initializeTooltip(tooltip: Tooltip):
|
|
24
|
+
initializeTooltip(tooltip: Tooltip): Promise<void>;
|
|
25
25
|
remove(): void;
|
|
26
26
|
protected abstract initializeInspections(): INSPECTIONS_LIST | undefined;
|
|
27
27
|
protected onUpdateTooltipPosition(position: Vector2): void;
|
|
@@ -80,6 +80,7 @@ export default class CanvasDialog extends Dialog {
|
|
|
80
80
|
protected buttonSurface: Component<HTMLElement>;
|
|
81
81
|
protected drawer: Component<HTMLElement>;
|
|
82
82
|
constructor(id: DialogId);
|
|
83
|
+
protected onCanvasDialogRemove(): void;
|
|
83
84
|
setZoomLevels(levels: Iterable<number>): this;
|
|
84
85
|
get isHovering(): boolean;
|
|
85
86
|
getMousePosition(): Vector2;
|
|
@@ -99,6 +100,7 @@ export default class CanvasDialog extends Dialog {
|
|
|
99
100
|
private dragStart;
|
|
100
101
|
private drag;
|
|
101
102
|
private dragEnd;
|
|
103
|
+
private removeDragEventListeners;
|
|
102
104
|
protected onCanvasClick(): void;
|
|
103
105
|
private getAbsoluteMousePosition;
|
|
104
106
|
protected rotateClockwise(): void;
|
|
@@ -26,6 +26,7 @@ export declare class GameDetails extends Component implements IGameIconsHost, IG
|
|
|
26
26
|
readonly gameModifiers: GameModifiers;
|
|
27
27
|
readonly gameIcons: GameIcons;
|
|
28
28
|
questsWrapper?: Component;
|
|
29
|
+
private refreshGameIconsTimeout?;
|
|
29
30
|
private steamworksFriends;
|
|
30
31
|
constructor(island: Island);
|
|
31
32
|
lockHidden(): this;
|
|
@@ -12,9 +12,11 @@ import type { Events, IEventEmitter } from "event/EventEmitter";
|
|
|
12
12
|
import { InfoDisplayLevel } from "game/inspection/IInfoProvider";
|
|
13
13
|
import type { InspectType } from "game/inspection/IInspection";
|
|
14
14
|
import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
15
|
+
import type Inspection from "game/inspection/Inspection";
|
|
15
16
|
import type InspectionsHandler from "game/inspection/InspectionsHandler";
|
|
16
17
|
import Component from "ui/component/Component";
|
|
17
18
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
19
|
+
import type HashSet from "utilities/collection/set/HashSet";
|
|
18
20
|
export interface ITileInspectionsEvents extends Events<Component> {
|
|
19
21
|
refreshed(isValid?: boolean): any;
|
|
20
22
|
updateInspectTypeFilter(): any;
|
|
@@ -26,6 +28,7 @@ export default abstract class InspectionsList<INSPECTIONS_HANDLER extends Inspec
|
|
|
26
28
|
private readonly paragraphInspectionsInvalid;
|
|
27
29
|
private inspectTypeFilter;
|
|
28
30
|
protected inspectionsHandler?: InspectionsHandler;
|
|
31
|
+
protected inspectionsHandlerUpdatedInspectionsCallback?: (_: any, inspectType: InspectType, inspections: HashSet<Inspection<any>>, oldInspections: HashSet<Inspection<any>> | undefined) => Promise<void>;
|
|
29
32
|
private displayLevel;
|
|
30
33
|
private refreshingId?;
|
|
31
34
|
private readonly inspectTypeWrappers;
|
|
@@ -38,6 +41,7 @@ export default abstract class InspectionsList<INSPECTIONS_HANDLER extends Inspec
|
|
|
38
41
|
protected abstract initializeInspections(): INSPECTIONS_HANDLER | undefined;
|
|
39
42
|
isValid?(): boolean;
|
|
40
43
|
protected getInvalidTranslation?(): TranslationGenerator | undefined;
|
|
44
|
+
private deregisterInspectionsHandler;
|
|
41
45
|
private refreshInspectionsOfType;
|
|
42
46
|
private initializeTooltipSection;
|
|
43
47
|
}
|
|
@@ -75,6 +75,7 @@ export default class Messages extends QuadrantComponent {
|
|
|
75
75
|
onReadNote(player: Player, id: number): void;
|
|
76
76
|
onFocusChat(): boolean;
|
|
77
77
|
getDefaultFilterName(filter: MessageFilterDefault): string;
|
|
78
|
+
protected onAppend(): void;
|
|
78
79
|
protected onChangeQuadrant(): void;
|
|
79
80
|
/**
|
|
80
81
|
* Event handler for when the text in the chat box should be sent as a message.
|
|
@@ -8,11 +8,17 @@
|
|
|
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 EventEmitter from "event/EventEmitter";
|
|
11
12
|
import type Screen from "ui/screen/Screen";
|
|
12
13
|
import { MenuId } from "ui/screen/screens/menu/component/IMenu";
|
|
13
14
|
import Menu from "ui/screen/screens/menu/component/Menu";
|
|
14
15
|
import type { MenuById } from "ui/screen/screens/menu/MenuMap";
|
|
15
|
-
export
|
|
16
|
+
export interface IMenuManagerEvents {
|
|
17
|
+
init(menu: Menu): any;
|
|
18
|
+
show(menu: Menu): any;
|
|
19
|
+
hide(menu: Menu): any;
|
|
20
|
+
}
|
|
21
|
+
export default class MenuManager extends EventEmitter.Host<IMenuManagerEvents> {
|
|
16
22
|
allowNoMenus: boolean;
|
|
17
23
|
all: Record<number, Menu>;
|
|
18
24
|
chain: Menu[];
|
|
@@ -39,4 +45,8 @@ export default class MenuManager {
|
|
|
39
45
|
* Sets the given menu to be the new top menu. (Removes super-menus, keeps sub-menus)
|
|
40
46
|
*/
|
|
41
47
|
setTop(menu: Menu): this;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a promise that resolves when the given screen is shown.
|
|
50
|
+
*/
|
|
51
|
+
await<MENU extends MenuId>(menuId: MENU): Promise<MenuById[MENU]>;
|
|
42
52
|
}
|
|
@@ -18,7 +18,7 @@ export default class TooltipManager {
|
|
|
18
18
|
private current;
|
|
19
19
|
private readonly disablers;
|
|
20
20
|
constructor();
|
|
21
|
-
show(host: HTMLElement): Tooltip | undefined;
|
|
21
|
+
show(host: HTMLElement, initialize?: (tooltip: Tooltip) => any): Tooltip | undefined;
|
|
22
22
|
hide(host?: HTMLElement | undefined): void;
|
|
23
23
|
/**
|
|
24
24
|
* Disables tooltips.
|
|
@@ -69,16 +69,17 @@ export declare enum LogSource {
|
|
|
69
69
|
TemperatureManager = 56,
|
|
70
70
|
TileEventManager = 57,
|
|
71
71
|
TileUpdate = 58,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
Timer = 59,
|
|
73
|
+
Trello = 60,
|
|
74
|
+
Ui = 61,
|
|
75
|
+
Utilities = 62,
|
|
76
|
+
WebAssembly = 63,
|
|
77
|
+
WebGlContext = 64,
|
|
78
|
+
WebRTCConnection = 65,
|
|
79
|
+
WebSocketConnection = 66,
|
|
80
|
+
World = 67,
|
|
81
|
+
WorldLayerRenderer = 68,
|
|
82
|
+
WorldRenderer = 69
|
|
82
83
|
}
|
|
83
84
|
export declare enum LogLineType {
|
|
84
85
|
Debug = 0,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 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
|
+
/// <reference types="node" />
|
|
12
|
+
import { ExpectedLifetime } from "utilities/memory/ILifetime";
|
|
13
|
+
declare module Timer {
|
|
14
|
+
function apply(): void;
|
|
15
|
+
function printActiveTimers(expectedLifetime: ExpectedLifetime): void;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a timeout with the provided expected lifetime
|
|
18
|
+
*/
|
|
19
|
+
function createTimeout(callback: (...args: any[]) => void, ms: number, expectedLifetime: ExpectedLifetime): NodeJS.Timer;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an interval with the provided expected lifetime
|
|
22
|
+
*/
|
|
23
|
+
function createInterval(callback: (...args: any[]) => void, ms: number, expectedLifetime: ExpectedLifetime): NodeJS.Timer;
|
|
24
|
+
}
|
|
25
|
+
export default Timer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 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 declare enum ExpectedLifetime {
|
|
12
|
+
/**
|
|
13
|
+
* should always exist
|
|
14
|
+
*/
|
|
15
|
+
Always = 0,
|
|
16
|
+
/**
|
|
17
|
+
* should only exist while playing the game
|
|
18
|
+
*/
|
|
19
|
+
WhilePlaying = 1
|
|
20
|
+
}
|
|
@@ -8,12 +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
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Object should only exist while playing the game
|
|
14
|
-
*/
|
|
15
|
-
WhilePlaying = 0
|
|
16
|
-
}
|
|
11
|
+
import { ExpectedLifetime } from "utilities/memory/ILifetime";
|
|
17
12
|
export declare const SYMBOL_MEMORY_LEAK_DETECTOR_PROPERTIES: unique symbol;
|
|
18
13
|
export declare const SYMBOL_MEMORY_LEAK_DETECTOR_EXPECTED_LIFETIME: unique symbol;
|
|
19
14
|
export declare function DetectMemoryLeaks(expectedLifetime?: ExpectedLifetime): PropertyDecorator;
|
|
@@ -8,7 +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 { ExpectedLifetime } from "utilities/memory/
|
|
11
|
+
import { ExpectedLifetime } from "utilities/memory/ILifetime";
|
|
12
12
|
declare class MemoryLeakDetector {
|
|
13
13
|
private surpressLogs;
|
|
14
14
|
private nextObjectId;
|
package/package.json
CHANGED