@wayward/types 2.11.6-beta.dev.20220405.1 → 2.11.6-beta.dev.20220415.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/entity/npc/NPCManager.d.ts +2 -2
- package/definitions/game/steamworks/Steamworks.d.ts +1 -0
- package/definitions/game/utilities/Files.d.ts +2 -2
- package/definitions/hosts/electron/main/ipc/handlers/electron/electron.d.ts +1 -0
- package/definitions/hosts/shared/interfaces.d.ts +1 -0
- package/definitions/hosts/shared/ipc/electron.d.ts +1 -0
- package/definitions/hosts/shared/ipc/handlers/fileSystem/fileSystem.d.ts +2 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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(
|
|
20
|
-
function downloadWithJsonEncoding(
|
|
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
|
}
|
|
@@ -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