@wayward/types 2.11.6-beta.dev.20220401.1 → 2.11.6-beta.dev.20220410.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.
@@ -128,7 +128,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
128
128
  passTurn(player: Player, turnType?: TurnType): void;
129
129
  tickRealtime(): void;
130
130
  updateView(source: RenderSource, updateFov?: boolean, computeSpritesNow?: boolean): void;
131
- updateTablesAndWeight(): void;
131
+ updateTablesAndWeight(deferTableUpdates?: boolean): void;
132
132
  /**
133
133
  * Gets the largest damage type weaknesses of a human or creature based on a type and damage value
134
134
  * @param defense Defense of the human or creature
@@ -9,7 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type { Events, IEventEmitter } from "event/EventEmitter";
12
- import EntityManager from "game/entity/EntityManager";
12
+ import EntityManager, { IEntityCanCreateOptions } from "game/entity/EntityManager";
13
13
  import type { NPCType } from "game/entity/npc/INPCs";
14
14
  import type NPC from "game/entity/npc/NPC";
15
15
  export interface INPCManagerEvents extends Events<EntityManager<NPC>> {
@@ -26,7 +26,7 @@ export interface INPCManagerEvents extends Events<EntityManager<NPC>> {
26
26
  export default class NPCManager extends EntityManager<NPC> {
27
27
  readonly event: IEventEmitter<this, INPCManagerEvents>;
28
28
  load(): void;
29
- spawn(npcType: NPCType, x: number, y: number, z: number): NPC | undefined;
29
+ spawn(npcType: NPCType, x: number, y: number, z: number, options?: IEntityCanCreateOptions): NPC | undefined;
30
30
  remove(npc: NPC): void;
31
31
  updateAll(): void;
32
32
  }
@@ -123,6 +123,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
123
123
  */
124
124
  importFromSaveGameMod(modIndex: number, jsonOrUint8Array: string | Uint8Array, callback?: (success: boolean) => void): Promise<boolean>;
125
125
  deleteSaveGameMod(name: string): Promise<void>;
126
+ saveFile(fileName: string, blob: Blob): Promise<void>;
126
127
  hasServerToJoin(): boolean;
127
128
  getServerToJoin(): ServerInfo | undefined;
128
129
  setServerToJoin(serverToJoin: ServerInfo, automatic?: boolean): void;
@@ -91,6 +91,8 @@ export default class InGameScreen extends BaseScreen {
91
91
  private nonCraftableItemTypes;
92
92
  private dismantleItems;
93
93
  private craftingDialogDirty;
94
+ private dismantleDialogDirty;
95
+ private invalidatingTargets;
94
96
  constructor();
95
97
  selector(): string;
96
98
  bindElements(): void;
@@ -219,9 +221,13 @@ export default class InGameScreen extends BaseScreen {
219
221
  */
220
222
  filterContainers(): void;
221
223
  /**
222
- * Invalidates and updates mouse targets when mouse is inside crafting/dismantle containers
224
+ * Invalidates and updates mouse targets after 300 milliseconds (should be enough time to calculate all the new stuffs).
223
225
  */
224
226
  invalidateTableTargets(): void;
227
+ /**
228
+ * Will force an update on crafting and dismantle tables based on dirty variables.
229
+ */
230
+ updateTablesDirty(which?: "crafting" | "dismantle"): void;
225
231
  showSortContextMenu(element: JQuery, container: JQuery, messageType: Message): void;
226
232
  getContainerId(containerElement: JQuery): string;
227
233
  sortItems(containerElement: JQuery, sortType: SortType, messageType?: Message, canReverse?: boolean, activeSort?: boolean): void;
@@ -16,8 +16,8 @@ declare module Files {
16
16
  function getArrayBuffer(path: string, signal?: AbortSignal): Promise<ArrayBuffer>;
17
17
  function getImage(path: string, signal?: AbortSignal): Promise<HTMLImageElement>;
18
18
  function getImageDataURL(path: string, signal?: AbortSignal): Promise<string | undefined>;
19
- function download(name: string, data: Uint8Array): void;
20
- function downloadWithJsonEncoding(name: string, data: any, stringify?: boolean, pretty?: boolean): void;
19
+ function download(fileName: string, data: Uint8Array): void;
20
+ function downloadWithJsonEncoding(fileName: string, data: any, stringify?: boolean, pretty?: boolean): void;
21
21
  function getFromEvent(event: Event): File[];
22
22
  function getSingleFromEvent(event: Event): File | undefined;
23
23
  function uploadSingle(file: File): Promise<IFileUploadSuccess>;
@@ -28,4 +28,5 @@ export declare class ElectronIPCHandler implements IElectron, IIPCHandler<IElect
28
28
  reloadWindow(): Promise<void>;
29
29
  invalidateWindow(): Promise<void>;
30
30
  destroyWindow(): Promise<void>;
31
+ showSaveDialog(defaultPath: string, filterName: string, filterExtension: string): Promise<string | undefined>;
31
32
  }
@@ -173,6 +173,7 @@ export interface IPath {
173
173
  resolve(...path: string[]): string;
174
174
  join(...path: string[]): string;
175
175
  basename(...path: string[]): string;
176
+ extname(path: string): string;
176
177
  isAbsolute(path: string): boolean;
177
178
  }
178
179
  export interface INapi {
@@ -22,4 +22,5 @@ export interface IElectron {
22
22
  reloadWindow(): Promise<void>;
23
23
  invalidateWindow(): Promise<void>;
24
24
  destroyWindow(): Promise<void>;
25
+ showSaveDialog(defaultPath: string, filterName: string, filterExtension: string): Promise<string | undefined>;
25
26
  }
@@ -15,12 +15,14 @@ export declare class SharedFileSystemIPCHandler implements IFileSystem {
15
15
  private readonly shell;
16
16
  private safePathsEnabled;
17
17
  readonly safePaths: Set<string>;
18
+ readonly safeFileWritePaths: Set<string>;
18
19
  private readonly logFile;
19
20
  constructor(defaultSafePaths: string[], shell: {
20
21
  openExternal(url: string): Promise<void>;
21
22
  openPath(path: string): Promise<string>;
22
23
  } | undefined);
23
24
  addSafePath(path: string): Promise<void>;
25
+ addSafeFileWritePath(filePath: string): Promise<void>;
24
26
  enableSafePaths(): Promise<void>;
25
27
  openExternal(url: string): Promise<void>;
26
28
  openPath(path: string): Promise<string>;
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.11.6-beta.dev.20220401.1",
4
+ "version": "2.11.6-beta.dev.20220410.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",