@wayward/types 2.13.0-beta.dev.20230506.1 → 2.13.0-beta.dev.20230508.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.
@@ -107,7 +107,6 @@ export interface IIslandLoadOptions {
107
107
  * Set to true when the island load is happening for everyone eveywhere all at once
108
108
  */
109
109
  isSynced: boolean;
110
- isNewSave?: boolean;
111
110
  travelTime?: number;
112
111
  pauseAndShowLoadingScreen?: boolean;
113
112
  multiplayerLoadingDescription?: MultiplayerLoadingDescription;
@@ -195,9 +195,9 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Item
195
195
  isNearby(executor: Entity, allowNearby?: boolean): boolean;
196
196
  /**
197
197
  * Fixes item issues.
198
- * Note: Be careful with what gets fixed in multiplayer! (when onlyRestoreIslandIds is set)
198
+ * Note: Be careful with what gets fixed in multiplayer!
199
199
  */
200
- verifyAndFixItem(allowFixes: boolean): void;
200
+ verifyAndFixItem(): void;
201
201
  /**
202
202
  * @param source A string representing the reason for this damage. Used for multiplayer debugging. Just put a unique string of characters here
203
203
  * @param modifier The amount of damage to take. Defaults to 1.
@@ -9,6 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type ISshShell from "multiplayer/dedicatedServer/ssh/ISshShell";
12
+ import type CommandLine from "utilities/CommandLine";
12
13
  export interface ISshCommand {
13
14
  type: SshCommandType;
14
15
  category: SshCommandCategory;
@@ -16,7 +17,7 @@ export interface ISshCommand {
16
17
  requirements: SshCommandRequirement;
17
18
  callback: SshCommandCallback;
18
19
  }
19
- export type SshCommandCallback = (shell: ISshShell, args: string) => Promise<SshCommandResult>;
20
+ export type SshCommandCallback = (shell: ISshShell, args: CommandLine.Args) => Promise<SshCommandResult>;
20
21
  export type SshCommandResult = ISshShell | false | undefined | void;
21
22
  export declare enum SshCommandType {
22
23
  Help = 0,
@@ -12,7 +12,6 @@ import type { IslandId } from "game/island/IIsland";
12
12
  import ClientPacket from "multiplayer/packets/ClientPacket";
13
13
  export default class LoadIslandPacket extends ClientPacket<Promise<void>> {
14
14
  islandId: IslandId;
15
- isSynced: boolean;
16
15
  getDebugInfo(): string;
17
16
  isSyncCheckEnabled(): boolean;
18
17
  process(): Promise<void>;
@@ -71,7 +71,7 @@ export default class SaveManager extends EventEmitter.Host<ISaveManagerEvents> {
71
71
  */
72
72
  load(slot: number): Promise<boolean>;
73
73
  loadSpecificData(slot: number, keys: Set<AnyPropertyToSerialize>): Promise<Record<AnyPropertyToSerialize, any>>;
74
- loadSpecificDatas(slots: number[], keys: Set<AnyPropertyToSerialize>): Promise<Array<Record<AnyPropertyToSerialize, any>>>;
74
+ loadSpecificDatas(slots: number[], keys: Set<AnyPropertyToSerialize>): Promise<Map<number, Record<AnyPropertyToSerialize, any>>>;
75
75
  /**
76
76
  * Returns the number of bytes the save takes up
77
77
  */
@@ -22,7 +22,7 @@ export default abstract class BindableManager {
22
22
  static MANAGERS: Map<string, BindableManager>;
23
23
  static registerManager(name: string, manager: BindableManager): boolean;
24
24
  static deregisterManager(name: string): boolean;
25
- private static setNeedsUpdate;
25
+ static setNeedsUpdate(markBindingsCacheInvalid?: boolean): void;
26
26
  private static BINDABLES;
27
27
  private static BINDABLES_BY_VALUE;
28
28
  private static needsUpdate;
@@ -35,7 +35,7 @@ declare module Bindings {
35
35
  function translate(bindable?: Bindable, noBindings?: TranslationImpl | null, simplify?: true): TranslationImpl | undefined;
36
36
  function translateRaw(bindable?: Bindable, noBindings?: TranslationImpl): TranslationImpl;
37
37
  function translateRaw(bindable?: Bindable, noBindings?: TranslationImpl | null): TranslationImpl | undefined;
38
- function markCacheInvalid(): void;
38
+ function markCacheInvalid(updateBindableManagers?: boolean): void;
39
39
  function getBoundTo(binding: Binding): Set<Bindable>;
40
40
  }
41
41
  export default Bindings;
@@ -8,8 +8,13 @@
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 Args1 from "@hosts/shared/args";
11
12
  import type { IPlayOptions } from "game/IGame";
12
- export * from "@hosts/shared/args";
13
- export declare function parseNewGameOptions(argsString: string): Partial<IPlayOptions> & {
14
- dailyChallenge?: boolean;
15
- };
13
+ declare namespace CommandLine {
14
+ const Args: typeof Args1;
15
+ type Args = Args1;
16
+ function parseNewGameOptions(args: Args): Partial<IPlayOptions> & {
17
+ dailyChallenge?: boolean;
18
+ };
19
+ }
20
+ export default CommandLine;
@@ -23,7 +23,7 @@ export declare class TemplateWriter {
23
23
  * @param mode What to do if the file already exists
24
24
  * @param report Whether to report the changes to the file
25
25
  */
26
- addJSON(file: string | false | 0 | undefined | null, contents: any, mode: "notexist" | "replace" | "mergebefore" | "mergeafter" | "ignore", report?: boolean): this;
26
+ addJSON(file: string | false | 0 | undefined | null, contents: any, mode: "notexist" | "replace" | "mergebefore" | "mergeafter" | "ignore", report?: string | boolean | undefined): this;
27
27
  /**
28
28
  * @param report What to report on success, `false` or `undefined` to skip
29
29
  */
@@ -8,14 +8,27 @@
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
- export declare function hasSwitch(args: string, name: string, indicators?: string[]): boolean;
12
- export declare function parseArgument(args: string, name: string, indicators?: string[]): string | undefined;
13
- /**
14
- * @param searchSwitch Returns the arguments after this given switch, up until an argument starts with the switch indicator
15
- */
16
- export declare function getNextArguments(searchSwitch: string, indicator?: string): string[];
17
- /**
18
- * @param searchSwitch Returns the argument after this given switch
19
- * @param orElse What to return if the argument was not passed
20
- */
21
- export declare function getNextArgument(searchSwitch: string, orElse?: string, indicator?: string): string | undefined;
11
+ export default class Args {
12
+ readonly all: string[];
13
+ readonly raw: string;
14
+ readonly string: string;
15
+ readonly indicators: string[];
16
+ readonly length: number;
17
+ constructor(args?: string | string[], indicators?: string[]);
18
+ /**
19
+ * @returns whether the arguments contains the `anyOf` switch.
20
+ */
21
+ hasSwitch(...anyOf: Array<string | string[]>): boolean;
22
+ /**
23
+ * @returns the first index of the `anyOf` switch in the arguments.
24
+ */
25
+ getSwitchIndex(...anyOf: Array<string | string[]>): number;
26
+ /**
27
+ * @returns all non-switch arguments directly following the first `anyOf` switch in the arguments, stopping upon reaching the next switch argument.
28
+ */
29
+ getInput(anyOf: string | string[], maxLength?: number): string[];
30
+ /**
31
+ * @returns the non-switch text argument directly following the `anyOf` switch, if it exists.
32
+ */
33
+ getStringInput(anyOf: string | string[]): string | undefined;
34
+ }
@@ -23,6 +23,7 @@ export interface IApplicationOptions {
23
23
  nodeJsMode?: boolean;
24
24
  random?: Random;
25
25
  serverPort?: number;
26
+ ignoreErrorsInLogs?: boolean;
26
27
  }
27
28
  export interface ITestState {
28
29
  seed: number;
@@ -56,7 +56,10 @@ export declare class Apps {
56
56
  getTestState(): Promise<ITestState>;
57
57
  startAll(): Promise<void>;
58
58
  lastTestState?: ITestState;
59
- stopAll(): Promise<Map<string, string[]>>;
59
+ stopAll(): Promise<Map<string, {
60
+ logs: string[];
61
+ errorsAreFatal: boolean;
62
+ }>>;
60
63
  get(): readonly Application[];
61
64
  getLogs(): string[];
62
65
  verifyGameStates(): Promise<void>;
@@ -47,4 +47,5 @@ export interface IPaths extends Omit<IAppPaths, "saveZipPath"> {
47
47
  generalDataPath: string;
48
48
  specificDataPath: string;
49
49
  versionsPath: string;
50
+ saveImportsPath: string;
50
51
  }
@@ -9,5 +9,5 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type { TestConfig } from "@wayward/test";
12
- import type { IPaths } from "@wayward/test/interfaces";
12
+ import { type IPaths } from "@wayward/test/interfaces";
13
13
  export default function (paths: IPaths, config: TestConfig): void;
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.13.0-beta.dev.20230506.1",
4
+ "version": "2.13.0-beta.dev.20230508.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",