@wayward/types 2.14.3-beta.dev.20241226.1 → 2.14.3-beta.dev.20241227.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.
@@ -217,7 +217,8 @@ export declare enum SaveType {
217
217
  Quit = 2,
218
218
  BackToMainMenu = 3,
219
219
  Multiplayer = 4,
220
- ReplayConvert = 5
220
+ ReplayConvert = 5,
221
+ AutoSave = 6
221
222
  }
222
223
  export declare enum TileUpdateType {
223
224
  Batch = 0,
@@ -200,7 +200,6 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
200
200
  */
201
201
  getName(article?: Article, options?: Partial<IItemGetNameOptions>): TranslationImpl;
202
202
  protected get debug(): any;
203
- private getDebug;
204
203
  protected get typeEnum(): typeof ItemType;
205
204
  protected getDescription(): IItemDescription | undefined;
206
205
  get isTransient(): boolean;
@@ -22,7 +22,7 @@ export declare class SaveLoad {
22
22
  * Saves the game (asynchronously)
23
23
  * Keep in sync with saveGameSynchronous
24
24
  */
25
- save(saveType: SaveType, load?: Load): Promise<ISaveInfo | undefined>;
25
+ save(saveType: SaveType, load?: Load, disableSave?: true): Promise<ISaveInfo | undefined>;
26
26
  /**
27
27
  * Saves the game (synchronously)
28
28
  * Keep in sync with saveGame
@@ -10,24 +10,24 @@
10
10
  */
11
11
  export declare enum PathType {
12
12
  Action = 0,
13
- AttackAnimation = 1,
14
- ChallengeIcon = 2,
15
- ChangelogChangeType = 3,
16
- ContainerTabAction = 4,
17
- Corpse = 5,
18
- Creature = 6,
19
- Damage = 7,
20
- Deity = 8,
21
- Doodad = 9,
22
- Equip = 10,
23
- EquipSlot = 11,
24
- GameOptionsIcon = 12,
25
- Hairstyle = 13,
26
- HelpArticleIcon = 14,
27
- InfoIcon = 15,
28
- ActionInfoIcon = 16,
29
- ActionSlotItemMethod = 17,
30
- ActionSlotType = 18,
13
+ ActionInfoIcon = 1,
14
+ ActionSlotItemMethod = 2,
15
+ ActionSlotType = 3,
16
+ AttackAnimation = 4,
17
+ ChallengeIcon = 5,
18
+ ChangelogChangeType = 6,
19
+ ContainerTabAction = 7,
20
+ Corpse = 8,
21
+ Creature = 9,
22
+ Damage = 10,
23
+ Deity = 11,
24
+ Doodad = 12,
25
+ Equip = 13,
26
+ EquipSlot = 14,
27
+ GameOptionsIcon = 15,
28
+ Hairstyle = 16,
29
+ HelpArticleIcon = 17,
30
+ InfoIcon = 18,
31
31
  InputIcon = 19,
32
32
  Island = 20,
33
33
  IslandModifier = 21,
@@ -146,6 +146,7 @@ export default class ContainerBucketItemList extends Component implements ISorta
146
146
  private getItemIdsInElements;
147
147
  private getItemElementId;
148
148
  private getItemComponentElements;
149
+ private getItemComponentById;
149
150
  private regenerate;
150
151
  private transfer;
151
152
  private getSorter;
@@ -8,8 +8,12 @@
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 DebugShared from "@wayward/utilities/dev/DebugShared";
11
12
  declare namespace Debug {
12
13
  function typeIfRelevant(type: string, name: string): string | undefined;
13
14
  function where(thing: unknown): string | undefined;
15
+ type JIT = DebugShared.JIT;
16
+ const JIT: typeof DebugShared.JIT;
17
+ const isJIT: typeof DebugShared.isJIT;
14
18
  }
15
19
  export default Debug;
@@ -26,7 +26,7 @@ declare class MemoryLeakDetector {
26
26
  onScreenShow(_: any, screen: Screen): Promise<any>;
27
27
  private onReset;
28
28
  private runCheck;
29
- garbageCollect(): Promise<void>;
29
+ garbageCollect(source: string): Promise<void>;
30
30
  private checkObjects;
31
31
  }
32
32
  export declare const memoryLeakDetector: MemoryLeakDetector;
@@ -9,7 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  declare namespace Functions {
12
- const noOp: () => void;
12
+ const noOp: (...args: any[]) => void;
13
13
  const noOpString: () => string;
14
14
  const noOpZero: () => number;
15
15
  const noOpNull: () => null;
@@ -24,6 +24,7 @@ export interface ILog {
24
24
  trace(...args: any[]): void;
25
25
  warn(...args: any[]): void;
26
26
  setSources(...sources: string[]): void;
27
+ ifEnabled(logger: (log: this) => any): void;
27
28
  }
28
29
  export interface ILogLine {
29
30
  type: LogLineType;
@@ -35,6 +36,7 @@ declare abstract class BaseLog implements ILog {
35
36
  info: (...args: any[]) => void;
36
37
  trace: (...args: any[]) => void;
37
38
  warn: (...args: any[]) => void;
39
+ ifEnabled: (logger: (log: this) => any) => void;
38
40
  protected sources: string[];
39
41
  constructor(...sources: Array<BaseLog | string>);
40
42
  setSources(...sources: Array<BaseLog | string>): void;
@@ -118,6 +120,8 @@ declare namespace Log {
118
120
  * @param sources A list of sources to log to.
119
121
  */
120
122
  function debug(...sources: string[]): (...args: any[]) => void;
123
+ function ifEnabled(...sources: string[]): (logger: (log: ILog) => any) => void;
124
+ function ifEnabled<LOG extends ILog>(log: LOG, ...sources: string[]): (logger: (log: LOG) => any) => void;
121
125
  /**
122
126
  * Returns a method that can be used to `Log.trace` with the given sources.
123
127
  * @param sources A list of sources to log to.
@@ -0,0 +1,23 @@
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 DebugShared {
12
+ const SYMBOL_JIT: unique symbol;
13
+ export interface JIT<A extends any[] = []> {
14
+ (): any;
15
+ (...args: A): any;
16
+ [SYMBOL_JIT]: true;
17
+ }
18
+ export function isJIT(value: unknown): value is JIT;
19
+ export function JIT<A extends any[]>(debug: JIT, fn: (debug: any, ...args: A) => any): JIT<A>;
20
+ export function JIT<A extends any[]>(fn: (...args: A) => any): JIT<A>;
21
+ export {};
22
+ }
23
+ export default DebugShared;
@@ -11,6 +11,8 @@
11
11
  type Implementation<P, K extends keyof P> = (this: P, ...args: P[K] extends (...args: infer A) => any ? A : []) => P[K] extends (...args: any[]) => infer R ? R : never;
12
12
  declare function Define<P, K extends string & keyof P>(proto: P, key: K, implementation: Implementation<P, K>): void;
13
13
  declare namespace Define {
14
+ export function set<P, K extends string & keyof P>(proto: P, key: K, value: P[K]): P[K];
15
+ export function set<V>(proto: any, key: PropertyKey, value: V): V;
14
16
  export function all<P, K extends string & keyof P>(protos: P[], key: K, implementation: Implementation<P, K>): void;
15
17
  interface IMagicImplementation<O, K extends string & keyof O> {
16
18
  get(this: O): O[K];
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.3-beta.dev.20241226.1",
4
+ "version": "2.14.3-beta.dev.20241227.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",