@etothepii/satisfactory-file-parser
Advanced tools
Comparing version 0.0.27 to 0.0.28
1338
dist/index.d.ts
@@ -1,774 +0,610 @@ | ||
declare module '@etothepii/satisfactory-file-parser/index' { | ||
export * from '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint.types'; | ||
export { DataFields } from '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/DataFields'; | ||
export { ObjectReference } from '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference'; | ||
export * from '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/Property'; | ||
export { SaveComponent } from '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent'; | ||
export { SaveEntity } from '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity'; | ||
export { Level } from '@etothepii/satisfactory-file-parser/parser/satisfactory/save/level.class'; | ||
export { SatisfactorySave } from '@etothepii/satisfactory-file-parser/parser/satisfactory/save/satisfactory-save'; | ||
export * from '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save.types'; | ||
export { ByteReader } from '@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class'; | ||
export { ByteWriter } from '@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class'; | ||
export { BlueprintConfigReader, BlueprintReader } from '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint-reader'; | ||
export { BlueprintConfigWriter, BlueprintWriter } from '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint-writer'; | ||
export { SaveReader } from '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-reader'; | ||
export { SaveWriter } from '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-writer'; | ||
export * from '@etothepii/satisfactory-file-parser/parser/satisfactory/structs/util.types'; | ||
export { CompressionLibraryError, CorruptSaveError, ParserError, UnsupportedVersionError } from '@etothepii/satisfactory-file-parser/parser/error/parser.error'; | ||
export * from '@etothepii/satisfactory-file-parser/parser/file.types'; | ||
export { Parser } from '@etothepii/satisfactory-file-parser/parser/parser'; | ||
// Generated by dts-bundle-generator v8.0.0 | ||
export type ChunkCompressionInfo = { | ||
chunkHeaderSize: number; | ||
packageFileTag: number; | ||
maxChunkContentSize: number; | ||
}; | ||
export type ChunkSummary = { | ||
uncompressedSize: number; | ||
compressedSize: number; | ||
}; | ||
declare enum Alignment { | ||
BIG_ENDIAN = 0, | ||
LITTLE_ENDIAN = 1 | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/byte/alignment.enum' { | ||
export enum Alignment { | ||
BIG_ENDIAN = 0, | ||
LITTLE_ENDIAN = 1 | ||
} | ||
export declare abstract class ByteReader { | ||
protected bufferView: DataView; | ||
protected fileBuffer: ArrayBuffer; | ||
protected alignment: Alignment; | ||
protected currentByte: number; | ||
protected handledByte: number; | ||
protected maxByte: number; | ||
protected lastStrRead: number; | ||
constructor(fileBuffer: ArrayBuffer, alignment: Alignment); | ||
reset(newFileBuffer: ArrayBuffer): void; | ||
skipBytes(byteLength?: number): void; | ||
readByte(): number; | ||
readBytes(count: number): Uint8Array; | ||
readHex(hexLength: number): string; | ||
readInt8(): number; | ||
readUint8(): number; | ||
readUint16(): number; | ||
readInt32(): number; | ||
readUint32(): number; | ||
readLong(): bigint; | ||
readFloat(): number; | ||
readDouble(): number; | ||
protected getStringInfo(): { | ||
payload: string; | ||
counter: number; | ||
}; | ||
getBufferPosition: () => number; | ||
getBufferSlice: (begin: number, end: number | undefined) => ArrayBuffer; | ||
getBufferProgress: () => number; | ||
getBufferLength: () => number; | ||
getBuffer: () => ArrayBuffer; | ||
readString(): string; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class' { | ||
import { Alignment } from "@etothepii/satisfactory-file-parser/parser/byte/alignment.enum"; | ||
export abstract class ByteReader { | ||
protected bufferView: DataView; | ||
protected fileBuffer: ArrayBuffer; | ||
protected alignment: Alignment; | ||
protected currentByte: number; | ||
protected handledByte: number; | ||
protected maxByte: number; | ||
protected lastStrRead: number; | ||
constructor(fileBuffer: ArrayBuffer, alignment: Alignment); | ||
reset(newFileBuffer: ArrayBuffer): void; | ||
skipBytes(byteLength?: number): void; | ||
readByte(): number; | ||
readBytes(count: number): Uint8Array; | ||
readHex(hexLength: number): string; | ||
readInt8(): number; | ||
readUint8(): number; | ||
readUint16(): number; | ||
readInt32(): number; | ||
readUint32(): number; | ||
readLong(): bigint; | ||
readFloat(): number; | ||
readDouble(): number; | ||
protected getStringInfo(): { | ||
payload: string; | ||
counter: number; | ||
}; | ||
getBufferPosition: () => number; | ||
getBufferSlice: (begin: number, end: number | undefined) => ArrayBuffer; | ||
getBufferProgress: () => number; | ||
getBufferLength: () => number; | ||
getBuffer: () => ArrayBuffer; | ||
readString(): string; | ||
} | ||
export declare abstract class ByteWriter { | ||
protected alignment: Alignment; | ||
protected bufferArray: ArrayBuffer; | ||
protected bufferView: DataView; | ||
protected currentByte: number; | ||
constructor(alignment: Alignment, bufferSize?: number); | ||
skipBytes(count?: number): void; | ||
jumpTo(pos: number): void; | ||
writeByte(value: number): void; | ||
writeBytesArray(bytes: number[]): void; | ||
writeBytes(bytes: Uint8Array): void; | ||
writeInt8(value: number): void; | ||
writeUint8(value: number): void; | ||
writeInt16(value: number): void; | ||
writeUint16(value: number): void; | ||
writeInt32(value: number): void; | ||
writeUint32(value: number): void; | ||
writeInt64(value: bigint): void; | ||
writeUint64(value: bigint): void; | ||
writeFloat(value: number): void; | ||
writeDouble(value: number): void; | ||
writeString(value: string): void; | ||
static IsASCIICompatible: (value: string) => boolean; | ||
getBufferPosition: () => number; | ||
getBufferSlice: (start: number, end?: number) => ArrayBuffer; | ||
writeBinarySizeFromPosition(lenIndicatorPos: number, start: number): void; | ||
protected extendBufferIfNeeded(countNeededBytes: number, factor?: number): void; | ||
protected truncateBuffer(): void; | ||
endWriting(): ArrayBuffer; | ||
static ToInt32(num: number): Uint8Array; | ||
static AppendBuffer(buffer1: ArrayBuffer, buffer2: ArrayBuffer): ArrayBuffer; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class' { | ||
import { Alignment } from "@etothepii/satisfactory-file-parser/parser/byte/alignment.enum"; | ||
export abstract class ByteWriter { | ||
protected alignment: Alignment; | ||
protected bufferArray: ArrayBuffer; | ||
protected bufferView: DataView; | ||
protected currentByte: number; | ||
constructor(alignment: Alignment, bufferSize?: number); | ||
skipBytes(count?: number): void; | ||
jumpTo(pos: number): void; | ||
writeByte(value: number): void; | ||
writeBytesArray(bytes: number[]): void; | ||
writeBytes(bytes: Uint8Array): void; | ||
writeInt8(value: number): void; | ||
writeUint8(value: number): void; | ||
writeInt16(value: number): void; | ||
writeUint16(value: number): void; | ||
writeInt32(value: number): void; | ||
writeUint32(value: number): void; | ||
writeInt64(value: bigint): void; | ||
writeUint64(value: bigint): void; | ||
writeFloat(value: number): void; | ||
writeDouble(value: number): void; | ||
writeString(value: string): void; | ||
static IsASCIICompatible: (value: string) => boolean; | ||
getBufferPosition: () => number; | ||
getBufferSlice: (start: number, end?: number) => ArrayBuffer; | ||
writeBinarySizeFromPosition(lenIndicatorPos: number, start: number): void; | ||
protected extendBufferIfNeeded(countNeededBytes: number, factor?: number): void; | ||
protected truncateBuffer(): void; | ||
endWriting(): ArrayBuffer; | ||
static ToInt32(num: number): Uint8Array; | ||
static AppendBuffer(buffer1: ArrayBuffer, buffer2: ArrayBuffer): ArrayBuffer; | ||
} | ||
export declare class ObjectReference { | ||
levelName: string; | ||
pathName: string; | ||
constructor(levelName: string, pathName: string); | ||
static Parse(reader: ByteReader): ObjectReference; | ||
static Serialize(writer: ByteWriter, ref: ObjectReference): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/error/parser.error' { | ||
export class ParserError extends Error { | ||
constructor(name: string, message: string); | ||
} | ||
export class UnsupportedVersionError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export class CorruptSaveError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export class CompressionLibraryError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export type col4 = { | ||
r: number; | ||
g: number; | ||
b: number; | ||
a: number; | ||
}; | ||
export declare const SerializeCol4RGBA: (writer: ByteWriter, value: col4) => void; | ||
export declare const ParseCol4RGBA: (reader: ByteReader) => col4; | ||
export declare const SerializeCol4BGRA: (writer: ByteWriter, value: col4) => void; | ||
export declare const ParseCol4BGRA: (reader: ByteReader) => col4; | ||
export type vec4 = vec3 & { | ||
w: number; | ||
}; | ||
export declare const ParseVec4: (reader: ByteReader) => vec4; | ||
export declare const SerializeVec4: (writer: ByteWriter, vec: vec4) => void; | ||
export declare const sub: (other: vec3, vec: vec3) => vec3; | ||
export declare const add: (vec: vec3, other: vec3) => vec3; | ||
export declare const length: (vec: vec3) => number; | ||
export declare const mult: (vec: vec3, scale: number) => vec3; | ||
export declare const norm: (vec: vec3) => vec3; | ||
export type vec3 = vec2 & { | ||
z: number; | ||
}; | ||
export declare const ParseVec3: (reader: ByteReader) => vec3; | ||
export declare const SerializeVec3: (writer: ByteWriter, vec: vec3) => void; | ||
export type vec2 = { | ||
x: number; | ||
y: number; | ||
}; | ||
export declare const ParseVec2: (reader: ByteReader) => vec2; | ||
export declare const SerializeVec2: (writer: ByteWriter, vec: vec2) => void; | ||
export type Transform = { | ||
rotation: vec4; | ||
translation: vec3; | ||
scale3d: vec3; | ||
}; | ||
export declare const ParseTransform: (reader: ByteReader) => Transform; | ||
export declare const SerializeTransform: (writer: ByteWriter, transform: Transform) => void; | ||
export declare class SaveEntity extends SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
parentEntityName: string; | ||
static readonly TypeID = 1; | ||
readonly type = "SaveEntity"; | ||
needTransform: boolean; | ||
transform: Transform; | ||
wasPlacedInLevel: boolean; | ||
parentObjectRoot: string; | ||
parentObjectName: string; | ||
components: ObjectReference[]; | ||
constructor(typePath: string, rootObject: string, instanceName: string, parentEntityName?: string, needsTransform?: boolean); | ||
static ParseHeader(reader: ByteReader, obj: SaveEntity): void; | ||
static ParseData(entity: SaveEntity, length: number, reader: ByteReader, buildVersion: number): void; | ||
static SerializeHeader(writer: ByteWriter, entity: SaveEntity): void; | ||
static SerializeData(writer: ByteWriter, entity: SaveEntity, buildVersion: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/file.types' { | ||
export type ChunkCompressionInfo = { | ||
chunkHeaderSize: number; | ||
packageFileTag: number; | ||
maxChunkContentSize: number; | ||
}; | ||
export type ChunkSummary = { | ||
uncompressedSize: number; | ||
compressedSize: number; | ||
}; | ||
export interface ModData { | ||
Reference: string; | ||
Name: string; | ||
Version: string; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/parser' { | ||
/// <reference types="node" /> | ||
import { ChunkSummary } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { Blueprint } from "@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint.types"; | ||
import { SatisfactorySave } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/satisfactory-save"; | ||
import { SaveProjectionConfig } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-reader"; | ||
export class Parser { | ||
static WriteSave(save: SatisfactorySave, onBinaryBeforeCompressing: (buffer: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
static ParseSaveFile(file: Buffer, onDecompressedSaveBody?: (buffer: ArrayBuffer) => void, onProgress?: (progress: number, message?: string) => void): SatisfactorySave; | ||
static WriteBlueprintFiles(blueprint: Blueprint, onMainFileBinaryBeforeCompressing?: (binary: ArrayBuffer) => void, onMainFileHeader?: (header: Uint8Array) => void, onMainFileChunk?: (chunk: Uint8Array) => void): { | ||
mainFileChunkSummary: ChunkSummary[]; | ||
configFileBinary: ArrayBuffer; | ||
}; | ||
static ParseBlueprintFiles(name: string, blueprintFile: Buffer, blueprintConfigFile: Buffer, onDecompressedBlueprintBody?: (buffer: ArrayBuffer) => void): Blueprint; | ||
static ProjectSave(save: SatisfactorySave, config: SaveProjectionConfig): SatisfactorySave; | ||
static JSONStringifyModified: (obj: any, indent?: number) => string; | ||
} | ||
export interface SatisfactoryModMetadata { | ||
Mods: ModData[]; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint-reader' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ChunkCompressionInfo } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { SaveComponent } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent"; | ||
import { SaveEntity } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity"; | ||
import { BlueprintConfig, BlueprintHeader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint.types"; | ||
export class BlueprintReader extends ByteReader { | ||
compressionInfo: ChunkCompressionInfo; | ||
constructor(bluePrintBuffer: ArrayBuffer); | ||
static ReadHeader(reader: ByteReader): BlueprintHeader; | ||
inflateChunks(): any; | ||
static ParseObjects(reader: ByteReader): (SaveEntity | SaveComponent)[]; | ||
} | ||
export class BlueprintConfigReader extends ByteReader { | ||
bluePrintConfigBuffer: ArrayBuffer; | ||
constructor(bluePrintConfigBuffer: ArrayBuffer); | ||
parse: () => BlueprintConfig; | ||
static ParseConfig(reader: ByteReader): BlueprintConfig; | ||
} | ||
export interface SatisfactorySaveHeader { | ||
saveHeaderType: number; | ||
saveVersion: number; | ||
buildVersion: number; | ||
mapName: string; | ||
mapOptions: string; | ||
sessionName: string; | ||
playDurationSeconds: number; | ||
saveDateTime: string; | ||
sessionVisibility: number; | ||
rawModMetadataString?: string; | ||
modMetadata?: SatisfactoryModMetadata; | ||
isModdedSave?: number; | ||
saveIdentifier?: string; | ||
fEditorObjectVersion?: number; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint-writer' { | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { ChunkCompressionInfo, ChunkSummary } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { SaveComponent } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent"; | ||
import { SaveEntity } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity"; | ||
import { BlueprintConfig, BlueprintHeader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint.types"; | ||
export class BlueprintWriter extends ByteWriter { | ||
constructor(); | ||
static SerializeHeader(writer: ByteWriter, header: BlueprintHeader): void; | ||
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
static SerializeObjects(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[]): void; | ||
} | ||
export class BlueprintConfigWriter extends ByteWriter { | ||
constructor(); | ||
static SerializeConfig(writer: ByteWriter, config: BlueprintConfig): void; | ||
} | ||
export type ResourceNodeEntry = { | ||
purity: string; | ||
pathName: string; | ||
position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
type: string; | ||
}; | ||
export type CollectibleEntry = { | ||
pathName: string; | ||
position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
type: string; | ||
}; | ||
export type StaticData = { | ||
collectibles: CollectibleEntry[]; | ||
artifacts: CollectibleEntry[]; | ||
slugs: CollectibleEntry[]; | ||
resourceNodes: ResourceNodeEntry[]; | ||
}; | ||
export type EntityPathFilter = { | ||
behavior: "whitelist" | "blacklist"; | ||
list: string[]; | ||
}; | ||
export type SaveProjectionConfig = { | ||
entityPathFilter: EntityPathFilter; | ||
includeComponents: boolean; | ||
}; | ||
export declare class SaveReader extends ByteReader { | ||
onProgressCallback: (progress: number, msg?: string) => void; | ||
header: SatisfactorySaveHeader | undefined; | ||
levels: Level[]; | ||
trailingCollectedObjects: ObjectReference[]; | ||
compressionInfo: ChunkCompressionInfo; | ||
static readonly EPOCH_TICKS = 621355968000000000n; | ||
constructor(fileBuffer: ArrayBuffer, onProgressCallback?: (progress: number, msg?: string) => void); | ||
readHeader(): SatisfactorySaveHeader; | ||
inflateChunks(): { | ||
concatenatedChunkLength: number; | ||
numChunks: number; | ||
}; | ||
readLevels(): Level[]; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/blueprint/blueprint.types' { | ||
import { ChunkCompressionInfo } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { SaveComponent } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent"; | ||
import { SaveEntity } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity"; | ||
import { col4 } from "@etothepii/satisfactory-file-parser/parser/satisfactory/structs/util.types"; | ||
export interface BlueprintConfig { | ||
description: string; | ||
color: col4; | ||
iconID: number; | ||
} | ||
export type BlueprintHeader = { | ||
itemCosts: [string, number][]; | ||
recipeReferences: string[]; | ||
}; | ||
export interface Blueprint { | ||
name: string; | ||
compressionInfo: ChunkCompressionInfo; | ||
header: BlueprintHeader; | ||
config: BlueprintConfig; | ||
objects: (SaveEntity | SaveComponent)[]; | ||
} | ||
export declare class Level { | ||
name: string; | ||
objects: (SaveEntity | SaveComponent)[]; | ||
collectables: ObjectReference[]; | ||
constructor(name: string); | ||
static SerializeObjectHeaders(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[]): void; | ||
static WriteLevel(writer: ByteWriter, level: Level, buildVersion: number): void; | ||
static SerializeObjectContents(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[], buildVersion: number): void; | ||
static ReadObjectHeaders(reader: ByteReader, objectsList: SaveObject[], onProgressCallback: (progress: number, msg?: string) => void): void; | ||
static ReadObjectContents(reader: ByteReader, objectsList: SaveObject[], buildVersion: number, onProgressCallback: (progress: number, msg?: string) => void): void; | ||
static ReadLevel(reader: SaveReader, levelName: string, buildVersion: number): Level; | ||
static SerializeCollectablesList(writer: ByteWriter, collectables: ObjectReference[]): void; | ||
static ReadCollectablesList(reader: SaveReader): ObjectReference[]; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/DataFields' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { SaveWriter } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-writer"; | ||
import { AbstractBaseProperty } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/Property"; | ||
export class DataFields { | ||
properties: any[]; | ||
trailingData: number[]; | ||
shouldBeNulled: boolean; | ||
constructor(); | ||
static Parse(length: number, reader: ByteReader, buildVersion: number): DataFields; | ||
static ParseProperty(reader: ByteReader, buildVersion: number, propertyName: string): AbstractBaseProperty | null; | ||
static Serialize(writer: SaveWriter, fields: DataFields, buildVersion: number): void; | ||
static SerializeProperty(writer: SaveWriter, property: AbstractBaseProperty, propertyName: string, buildVersion: number): void; | ||
} | ||
export declare class SatisfactorySave { | ||
header: SatisfactorySaveHeader; | ||
levels: Level[]; | ||
trailingCollectedObjects: ObjectReference[]; | ||
compressionInfo?: ChunkCompressionInfo; | ||
constructor(header: SatisfactorySaveHeader); | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
export class ObjectReference { | ||
levelName: string; | ||
pathName: string; | ||
constructor(levelName: string, pathName: string); | ||
static Parse(reader: ByteReader): ObjectReference; | ||
static Serialize(writer: ByteWriter, ref: ObjectReference): void; | ||
} | ||
export declare class SaveWriter extends ByteWriter { | ||
constructor(); | ||
static WriteHeader(writer: ByteWriter, header: SatisfactorySaveHeader): void; | ||
static WriteLevels(writer: ByteWriter, save: SatisfactorySave, buildVersion: number): void; | ||
static GenerateCompressedChunksFromData(bufferArray: ArrayBuffer, compressionInfo: ChunkCompressionInfo, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onChunk: (chunk: Uint8Array) => void, alignment?: Alignment): ChunkSummary[]; | ||
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/Property' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { SaveWriter } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-writer"; | ||
import { col4, vec3, vec4 } from "@etothepii/satisfactory-file-parser/parser/satisfactory/structs/util.types"; | ||
import { ObjectReference } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference"; | ||
export type Properties = { | ||
[key: string]: string | number | boolean | any; | ||
}; | ||
export abstract class AbstractProperty { | ||
type: string; | ||
index?: number | undefined; | ||
constructor(type: string, index?: number | undefined); | ||
} | ||
export abstract class AbstractBaseProperty extends AbstractProperty { | ||
ueType: string; | ||
name: string; | ||
constructor(type: string, ueType: string, index: number); | ||
} | ||
export abstract class BasicProperty extends AbstractBaseProperty { | ||
guidInfo: GUID; | ||
constructor(type: string, ueType: string, guidInfo: GUID, index?: number); | ||
} | ||
export type GUID = undefined | Uint8Array; | ||
export const ParseGUID: (reader: ByteReader) => GUID; | ||
export const SerializeGUID: (writer: SaveWriter, guid: GUID) => void; | ||
export type OverheadResult = { | ||
overhead: number; | ||
}; | ||
export class BoolProperty extends BasicProperty { | ||
value: boolean; | ||
constructor(value: boolean, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): BoolProperty; | ||
static ReadValue(reader: ByteReader): boolean; | ||
static CalcOverhead(property: BoolProperty): number; | ||
static Serialize(writer: SaveWriter, property: BoolProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: boolean): void; | ||
} | ||
export type BytePropertyValue = { | ||
type: string; | ||
value: string | number; | ||
}; | ||
export class ByteProperty extends BasicProperty { | ||
value: BytePropertyValue; | ||
constructor(value: BytePropertyValue, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): ByteProperty; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: ByteProperty): number; | ||
static Serialize(writer: SaveWriter, property: ByteProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class Int8Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int8Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Int8Property): number; | ||
static Serialize(writer: SaveWriter, property: Int8Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class Uint8Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Uint8Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Uint8Property): number; | ||
static Serialize(writer: SaveWriter, property: Uint8Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class Int32Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int32Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Int32Property): number; | ||
static Serialize(writer: SaveWriter, property: Int32Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class Uint32Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Uint32Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Uint32Property): number; | ||
static Serialize(writer: SaveWriter, property: Uint32Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class Int64Property extends BasicProperty { | ||
value: string; | ||
constructor(value: string, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int64Property; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: Int64Property): number; | ||
static Serialize(writer: SaveWriter, property: Int64Property): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export class FloatProperty extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): FloatProperty; | ||
static CalcOverhead(property: FloatProperty): number; | ||
static ReadValue(reader: ByteReader): number; | ||
static Serialize(writer: SaveWriter, property: FloatProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class DoubleProperty extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): DoubleProperty; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: DoubleProperty): number; | ||
static Serialize(writer: SaveWriter, property: DoubleProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export class StrProperty extends BasicProperty { | ||
value: string; | ||
constructor(value: string, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): StrProperty; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: StrProperty): number; | ||
static Serialize(writer: SaveWriter, property: StrProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export class ObjectProperty extends BasicProperty { | ||
value: ObjectReference; | ||
constructor(value: ObjectReference, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): ObjectProperty; | ||
static ReadValue(reader: ByteReader): ObjectReference; | ||
static CalcOverhead(property: ObjectProperty): number; | ||
static Serialize(writer: SaveWriter, property: ObjectProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: { | ||
levelName: string; | ||
pathName: string; | ||
}): void; | ||
} | ||
export class EnumProperty extends BasicProperty { | ||
value: { | ||
name: string; | ||
value: string; | ||
}; | ||
constructor(value: { | ||
name: string; | ||
value: string; | ||
}, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): EnumProperty; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: EnumProperty): number; | ||
static Serialize(writer: SaveWriter, property: EnumProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export type TextPropertyValue = { | ||
flags: number; | ||
historyType: number; | ||
namespace?: string; | ||
key?: string; | ||
value?: string; | ||
sourceFmt?: TextPropertyValue; | ||
arguments?: { | ||
name: string; | ||
valueType: number; | ||
argumentValue: TextPropertyValue; | ||
}[]; | ||
sourceText?: TextPropertyValue; | ||
transformType?: number; | ||
hasCultureInvariantString?: boolean; | ||
}; | ||
export class TextProperty extends BasicProperty { | ||
value: TextPropertyValue; | ||
constructor(value: TextPropertyValue, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): TextProperty; | ||
static ParseValue(reader: ByteReader): TextPropertyValue; | ||
static CalcOverhead(property: TextProperty): number; | ||
static Serialize(writer: SaveWriter, property: TextProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: TextPropertyValue): void; | ||
} | ||
export type BasicMultipleStructPropertyValue = { | ||
values: any; | ||
}; | ||
export type BasicStructPropertyValue = { | ||
value: any; | ||
}; | ||
export type BoxStructPropertyValue = { | ||
min: vec3; | ||
max: vec3; | ||
isValid: boolean; | ||
}; | ||
export type RailroadTrackPositionStructPropertyValue = { | ||
root: string; | ||
instanceName: string; | ||
offset: number; | ||
forward: number; | ||
}; | ||
export type InventoryItemStructPropertyValue = { | ||
unk1: number; | ||
itemName: string; | ||
unk2: string; | ||
unk3: string; | ||
properties: any[]; | ||
}; | ||
export type FICFrameRangeStructPropertyValue = { | ||
begin: string; | ||
end: string; | ||
}; | ||
export type DynamicStructPropertyValue = { | ||
type: string; | ||
properties: Properties; | ||
}; | ||
export type GENERIC_STRUCT_PROPERTY_VALUE = BasicMultipleStructPropertyValue | BasicStructPropertyValue | BoxStructPropertyValue | RailroadTrackPositionStructPropertyValue | InventoryItemStructPropertyValue | FICFrameRangeStructPropertyValue | DynamicStructPropertyValue | col4 | vec3 | vec4 | string; | ||
export class StructProperty extends AbstractBaseProperty { | ||
subtype: string; | ||
guid: number; | ||
value: GENERIC_STRUCT_PROPERTY_VALUE; | ||
unk1?: number; | ||
unk2?: number; | ||
unk3?: number; | ||
unk4?: number; | ||
constructor(subtype: string, ueType?: string, index?: number, guid?: number); | ||
static Parse(reader: ByteReader, ueType: string, index: number, size: number): StructProperty; | ||
static ParseValue(reader: ByteReader, subtype: string, size: number): GENERIC_STRUCT_PROPERTY_VALUE; | ||
static CalcOverhead(property: StructProperty): number; | ||
static Serialize(writer: SaveWriter, property: StructProperty): void; | ||
static SerializeValue(writer: SaveWriter, subtype: string, value: GENERIC_STRUCT_PROPERTY_VALUE): void; | ||
} | ||
export type ArrayPropertyStructValueFields = { | ||
allStructType: string; | ||
allIndex: number; | ||
allGuid: number; | ||
allUnk1?: number; | ||
allUnk2?: number; | ||
allUnk3?: number; | ||
allUnk4?: number; | ||
}; | ||
export class ArrayProperty<T> extends BasicProperty { | ||
subtype: string; | ||
values: T[]; | ||
structValueFields?: ArrayPropertyStructValueFields | undefined; | ||
constructor(subtype: string, values: T[], ueType?: string, index?: number, structValueFields?: ArrayPropertyStructValueFields | undefined); | ||
static Parse(reader: ByteReader, ueType: string, index: number, propertyName: string): ArrayProperty<any>; | ||
static CalcOverhead(property: ArrayProperty<any>): number; | ||
static Serialize(writer: SaveWriter, property: ArrayProperty<any>, propertyName: string): void; | ||
} | ||
export class SetProperty<T> extends BasicProperty { | ||
subtype: string; | ||
values: T[]; | ||
constructor(subtype: string, values: T[], ueType: string, index: number); | ||
static Parse(reader: ByteReader, ueType: string, index: number, propertyName: string): SetProperty<any>; | ||
static CalcOverhead(property: SetProperty<any>): number; | ||
static Serialize(writer: SaveWriter, property: SetProperty<any>): void; | ||
} | ||
export class MapProperty extends BasicProperty { | ||
keyType: string; | ||
valueType: string; | ||
modeType: number; | ||
modeUnk1: string | undefined; | ||
modeUnk2: string; | ||
modeUnk3: string; | ||
remainingData: number[]; | ||
values: { | ||
key: any; | ||
value: any; | ||
}[]; | ||
constructor(keyType: string, valueType: string, ueType: string, index: number); | ||
static Parse(reader: ByteReader, propertyName: string, buildVersion: number, size: number, ueType?: string, index?: number): MapProperty; | ||
static CalcOverhead(property: MapProperty): number; | ||
static Serialize(writer: SaveWriter, property: MapProperty): void; | ||
} | ||
export const ParseDynamicStructData: (reader: ByteReader, buildVersion: number, type: string) => DynamicStructPropertyValue; | ||
export const SerializeDynamicStructData: (writer: SaveWriter, buildVersion: number, data: DynamicStructPropertyValue) => void; | ||
export const ReadFINNetworkTrace: (reader: ByteReader) => any; | ||
export const SerializeFINNetworkTrace: (writer: SaveWriter, obj: any) => void; | ||
export const ReadFINLuaProcessorStateStorage: (reader: ByteReader, size: number) => any; | ||
export const SerializeFINLuaProcessorStateStorage: (writer: SaveWriter, stateStorage: any) => void; | ||
export type Properties = { | ||
[key: string]: string | number | boolean | any; | ||
}; | ||
export declare abstract class AbstractProperty { | ||
type: string; | ||
index?: number | undefined; | ||
constructor(type: string, index?: number | undefined); | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { SaveObject } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveObject"; | ||
export const isSaveComponent: (obj: any) => obj is SaveComponent; | ||
export class SaveComponent extends SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
parentEntityName: string; | ||
static readonly TypeID = 0; | ||
readonly type = "SaveComponent"; | ||
constructor(typePath: string, rootObject: string, instanceName: string, parentEntityName?: string); | ||
static ParseHeader(reader: ByteReader, obj: SaveComponent): void; | ||
static SerializeHeader(writer: ByteWriter, component: SaveComponent): void; | ||
static ParseData(component: SaveComponent, length: number, reader: ByteReader, buildVersion: number): void; | ||
} | ||
export declare abstract class AbstractBaseProperty extends AbstractProperty { | ||
ueType: string; | ||
name: string; | ||
constructor(type: string, ueType: string, index: number); | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { Transform } from "@etothepii/satisfactory-file-parser/parser/satisfactory/structs/util.types"; | ||
import { ObjectReference } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference"; | ||
import { SaveObject } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveObject"; | ||
export const isSaveEntity: (obj: any) => obj is SaveEntity; | ||
export class SaveEntity extends SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
parentEntityName: string; | ||
static readonly TypeID = 1; | ||
readonly type = "SaveEntity"; | ||
needTransform: boolean; | ||
transform: Transform; | ||
wasPlacedInLevel: boolean; | ||
parentObjectRoot: string; | ||
parentObjectName: string; | ||
components: ObjectReference[]; | ||
constructor(typePath: string, rootObject: string, instanceName: string, parentEntityName?: string, needsTransform?: boolean); | ||
static ParseHeader(reader: ByteReader, obj: SaveEntity): void; | ||
static ParseData(entity: SaveEntity, length: number, reader: ByteReader, buildVersion: number): void; | ||
static SerializeHeader(writer: ByteWriter, entity: SaveEntity): void; | ||
static SerializeData(writer: ByteWriter, entity: SaveEntity, buildVersion: number): void; | ||
} | ||
export declare abstract class BasicProperty extends AbstractBaseProperty { | ||
guidInfo: GUID; | ||
constructor(type: string, ueType: string, guidInfo: GUID, index?: number); | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveObject' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { DataFields } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/DataFields"; | ||
export abstract class SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
dataFields: DataFields; | ||
constructor(typePath: string, rootObject: string, instanceName: string); | ||
protected static ParseHeader(reader: ByteReader, obj: SaveObject): void; | ||
protected static SerializeHeader(writer: ByteWriter, obj: SaveObject): void; | ||
static ParseData(obj: SaveObject, length: number, reader: ByteReader, buildVersion: number): void; | ||
static SerializeData(writer: any, obj: SaveObject, buildVersion: number): void; | ||
} | ||
export type GUID = undefined | Uint8Array; | ||
export declare const ParseGUID: (reader: ByteReader) => GUID; | ||
export declare const SerializeGUID: (writer: SaveWriter, guid: GUID) => void; | ||
export type OverheadResult = { | ||
overhead: number; | ||
}; | ||
export declare class BoolProperty extends BasicProperty { | ||
value: boolean; | ||
constructor(value: boolean, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): BoolProperty; | ||
static ReadValue(reader: ByteReader): boolean; | ||
static CalcOverhead(property: BoolProperty): number; | ||
static Serialize(writer: SaveWriter, property: BoolProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: boolean): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/save/level.class' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { ObjectReference } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference"; | ||
import { SaveComponent } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent"; | ||
import { SaveEntity } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity"; | ||
import { SaveObject } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveObject"; | ||
import { SaveReader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-reader"; | ||
export class Level { | ||
name: string; | ||
objects: (SaveEntity | SaveComponent)[]; | ||
collectables: ObjectReference[]; | ||
constructor(name: string); | ||
static SerializeObjectHeaders(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[]): void; | ||
static WriteLevel(writer: ByteWriter, level: Level, buildVersion: number): void; | ||
static SerializeObjectContents(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[], buildVersion: number): void; | ||
static ReadObjectHeaders(reader: ByteReader, objectsList: SaveObject[], onProgressCallback: (progress: number, msg?: string) => void): void; | ||
static ReadObjectContents(reader: ByteReader, objectsList: SaveObject[], buildVersion: number, onProgressCallback: (progress: number, msg?: string) => void): void; | ||
static ReadLevel(reader: SaveReader, levelName: string, buildVersion: number): Level; | ||
static SerializeCollectablesList(writer: ByteWriter, collectables: ObjectReference[]): void; | ||
static ReadCollectablesList(reader: SaveReader): ObjectReference[]; | ||
} | ||
export type BytePropertyValue = { | ||
type: string; | ||
value: string | number; | ||
}; | ||
export declare class ByteProperty extends BasicProperty { | ||
value: BytePropertyValue; | ||
constructor(value: BytePropertyValue, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): ByteProperty; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: ByteProperty): number; | ||
static Serialize(writer: SaveWriter, property: ByteProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/save/satisfactory-save' { | ||
import { ChunkCompressionInfo } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { ObjectReference } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference"; | ||
import { Level } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/level.class"; | ||
import { SatisfactorySaveHeader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save.types"; | ||
export class SatisfactorySave { | ||
header: SatisfactorySaveHeader; | ||
levels: Level[]; | ||
trailingCollectedObjects: ObjectReference[]; | ||
compressionInfo?: ChunkCompressionInfo; | ||
constructor(header: SatisfactorySaveHeader); | ||
} | ||
export declare class Int8Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int8Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Int8Property): number; | ||
static Serialize(writer: SaveWriter, property: Int8Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-reader' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ChunkCompressionInfo } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { ObjectReference } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/ObjectReference"; | ||
import { SaveComponent } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveComponent"; | ||
import { SaveEntity } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveEntity"; | ||
import { SaveObject } from "@etothepii/satisfactory-file-parser/parser/satisfactory/objects/SaveObject"; | ||
import { Level } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/level.class"; | ||
import { SatisfactorySaveHeader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save.types"; | ||
export type EntityPathFilter = { | ||
behavior: 'whitelist' | 'blacklist'; | ||
list: string[]; | ||
}; | ||
export type SaveProjectionConfig = { | ||
entityPathFilter: EntityPathFilter; | ||
includeComponents: boolean; | ||
}; | ||
export const projectionFilterApplies: (config: SaveProjectionConfig, object: SaveComponent | SaveEntity) => boolean; | ||
export class SaveReader extends ByteReader { | ||
onProgressCallback: (progress: number, msg?: string) => void; | ||
header: SatisfactorySaveHeader | undefined; | ||
levels: Level[]; | ||
trailingCollectedObjects: ObjectReference[]; | ||
compressionInfo: ChunkCompressionInfo; | ||
static readonly EPOCH_TICKS = 621355968000000000n; | ||
constructor(fileBuffer: ArrayBuffer, onProgressCallback?: (progress: number, msg?: string) => void); | ||
readHeader(): SatisfactorySaveHeader; | ||
inflateChunks(): { | ||
concatenatedChunkLength: number; | ||
numChunks: number; | ||
}; | ||
readLevels(): Level[]; | ||
} | ||
export class Conveyor { | ||
static getConveyorBeltRegex(): RegExp; | ||
static getConveyorLiftRegex(): RegExp; | ||
static isAConveyorBelt(obj: SaveObject): boolean; | ||
static isAConveyorLift(obj: SaveObject): boolean; | ||
static get availableConnections(): string[]; | ||
static get availableConveyorBelts(): string[]; | ||
static get availableConveyorLifts(): string[]; | ||
static isConveyor(currentObject: any): boolean; | ||
static isConveyorBelt(currentObject: any): boolean; | ||
static isConveyorLift(currentObject: any): boolean; | ||
} | ||
export declare class Uint8Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Uint8Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Uint8Property): number; | ||
static Serialize(writer: SaveWriter, property: Uint8Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save-writer' { | ||
import { Alignment } from "@etothepii/satisfactory-file-parser/parser/byte/alignment.enum"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
import { ChunkCompressionInfo, ChunkSummary } from "@etothepii/satisfactory-file-parser/parser/file.types"; | ||
import { SatisfactorySave } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/satisfactory-save"; | ||
import { SatisfactorySaveHeader } from "@etothepii/satisfactory-file-parser/parser/satisfactory/save/save.types"; | ||
export class SaveWriter extends ByteWriter { | ||
constructor(); | ||
static WriteHeader(writer: ByteWriter, header: SatisfactorySaveHeader): void; | ||
static WriteLevels(writer: ByteWriter, save: SatisfactorySave, buildVersion: number): void; | ||
static GenerateCompressedChunksFromData(bufferArray: ArrayBuffer, compressionInfo: ChunkCompressionInfo, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onChunk: (chunk: Uint8Array) => void, alignment?: Alignment): ChunkSummary[]; | ||
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
} | ||
export declare class Int32Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int32Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Int32Property): number; | ||
static Serialize(writer: SaveWriter, property: Int32Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/save/save.types' { | ||
export interface ModData { | ||
Reference: string; | ||
Name: string; | ||
Version: string; | ||
} | ||
export interface SatisfactoryModMetadata { | ||
Mods: ModData[]; | ||
} | ||
export interface SatisfactorySaveHeader { | ||
saveHeaderType: number; | ||
saveVersion: number; | ||
buildVersion: number; | ||
mapName: string; | ||
mapOptions: string; | ||
sessionName: string; | ||
playDurationSeconds: number; | ||
saveDateTime: string; | ||
sessionVisibility: number; | ||
rawModMetadataString?: string; | ||
modMetadata?: SatisfactoryModMetadata; | ||
isModdedSave?: number; | ||
saveIdentifier?: string; | ||
fEditorObjectVersion?: number; | ||
} | ||
export type ResourceNodeEntry = { | ||
purity: string; | ||
pathName: string; | ||
position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
type: string; | ||
}; | ||
export type CollectibleEntry = { | ||
pathName: string; | ||
position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
type: string; | ||
}; | ||
export type StaticData = { | ||
collectibles: CollectibleEntry[]; | ||
artifacts: CollectibleEntry[]; | ||
slugs: CollectibleEntry[]; | ||
resourceNodes: ResourceNodeEntry[]; | ||
}; | ||
export declare class Uint32Property extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Uint32Property; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: Uint32Property): number; | ||
static Serialize(writer: SaveWriter, property: Uint32Property): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
declare module '@etothepii/satisfactory-file-parser/parser/satisfactory/structs/util.types' { | ||
import { ByteReader } from "@etothepii/satisfactory-file-parser/parser/byte/byte-reader.class"; | ||
import { ByteWriter } from "@etothepii/satisfactory-file-parser/parser/byte/byte-writer.class"; | ||
export type col4 = { | ||
r: number; | ||
g: number; | ||
b: number; | ||
a: number; | ||
}; | ||
export const SerializeCol4RGBA: (writer: ByteWriter, value: col4) => void; | ||
export const ParseCol4RGBA: (reader: ByteReader) => col4; | ||
export const SerializeCol4BGRA: (writer: ByteWriter, value: col4) => void; | ||
export const ParseCol4BGRA: (reader: ByteReader) => col4; | ||
export type vec4 = vec3 & { | ||
w: number; | ||
}; | ||
export const ParseVec4: (reader: ByteReader) => vec4; | ||
export const SerializeVec4: (writer: ByteWriter, vec: vec4) => void; | ||
export const sub: (other: vec3, vec: vec3) => vec3; | ||
export const add: (vec: vec3, other: vec3) => vec3; | ||
export const length: (vec: vec3) => number; | ||
export const mult: (vec: vec3, scale: number) => vec3; | ||
export const norm: (vec: vec3) => vec3; | ||
export type vec3 = vec2 & { | ||
z: number; | ||
}; | ||
export const ParseVec3: (reader: ByteReader) => vec3; | ||
export const SerializeVec3: (writer: ByteWriter, vec: vec3) => void; | ||
export type vec2 = { | ||
x: number; | ||
y: number; | ||
}; | ||
export const ParseVec2: (reader: ByteReader) => vec2; | ||
export const SerializeVec2: (writer: ByteWriter, vec: vec2) => void; | ||
export type Transform = { | ||
rotation: vec4; | ||
translation: vec3; | ||
scale3d: vec3; | ||
}; | ||
export const ParseTransform: (reader: ByteReader) => Transform; | ||
export const SerializeTransform: (writer: ByteWriter, transform: Transform) => void; | ||
export declare class Int64Property extends BasicProperty { | ||
value: string; | ||
constructor(value: string, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): Int64Property; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: Int64Property): number; | ||
static Serialize(writer: SaveWriter, property: Int64Property): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export declare class FloatProperty extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): FloatProperty; | ||
static CalcOverhead(property: FloatProperty): number; | ||
static ReadValue(reader: ByteReader): number; | ||
static Serialize(writer: SaveWriter, property: FloatProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export declare class DoubleProperty extends BasicProperty { | ||
value: number; | ||
constructor(value: number, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): DoubleProperty; | ||
static ReadValue(reader: ByteReader): number; | ||
static CalcOverhead(property: DoubleProperty): number; | ||
static Serialize(writer: SaveWriter, property: DoubleProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: number): void; | ||
} | ||
export declare class StrProperty extends BasicProperty { | ||
value: string; | ||
constructor(value: string, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): StrProperty; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: StrProperty): number; | ||
static Serialize(writer: SaveWriter, property: StrProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export declare class ObjectProperty extends BasicProperty { | ||
value: ObjectReference; | ||
constructor(value: ObjectReference, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): ObjectProperty; | ||
static ReadValue(reader: ByteReader): ObjectReference; | ||
static CalcOverhead(property: ObjectProperty): number; | ||
static Serialize(writer: SaveWriter, property: ObjectProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: { | ||
levelName: string; | ||
pathName: string; | ||
}): void; | ||
} | ||
export declare class EnumProperty extends BasicProperty { | ||
value: { | ||
name: string; | ||
value: string; | ||
}; | ||
constructor(value: { | ||
name: string; | ||
value: string; | ||
}, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): EnumProperty; | ||
static ReadValue(reader: ByteReader): string; | ||
static CalcOverhead(property: EnumProperty): number; | ||
static Serialize(writer: SaveWriter, property: EnumProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: string): void; | ||
} | ||
export type TextPropertyValue = { | ||
flags: number; | ||
historyType: number; | ||
namespace?: string; | ||
key?: string; | ||
value?: string; | ||
sourceFmt?: TextPropertyValue; | ||
arguments?: { | ||
name: string; | ||
valueType: number; | ||
argumentValue: TextPropertyValue; | ||
}[]; | ||
sourceText?: TextPropertyValue; | ||
transformType?: number; | ||
hasCultureInvariantString?: boolean; | ||
}; | ||
export declare class TextProperty extends BasicProperty { | ||
value: TextPropertyValue; | ||
constructor(value: TextPropertyValue, ueType?: string, guidInfo?: GUID, index?: number); | ||
static Parse(reader: ByteReader, ueType: string, index?: number): TextProperty; | ||
static ParseValue(reader: ByteReader): TextPropertyValue; | ||
static CalcOverhead(property: TextProperty): number; | ||
static Serialize(writer: SaveWriter, property: TextProperty): void; | ||
static SerializeValue(writer: SaveWriter, value: TextPropertyValue): void; | ||
} | ||
export type BasicMultipleStructPropertyValue = { | ||
values: any; | ||
}; | ||
export type BasicStructPropertyValue = { | ||
value: any; | ||
}; | ||
export type BoxStructPropertyValue = { | ||
min: vec3; | ||
max: vec3; | ||
isValid: boolean; | ||
}; | ||
export type RailroadTrackPositionStructPropertyValue = { | ||
root: string; | ||
instanceName: string; | ||
offset: number; | ||
forward: number; | ||
}; | ||
export type InventoryItemStructPropertyValue = { | ||
unk1: number; | ||
itemName: string; | ||
unk2: string; | ||
unk3: string; | ||
properties: any[]; | ||
}; | ||
export type FICFrameRangeStructPropertyValue = { | ||
begin: string; | ||
end: string; | ||
}; | ||
export type DynamicStructPropertyValue = { | ||
type: string; | ||
properties: Properties; | ||
}; | ||
export type GENERIC_STRUCT_PROPERTY_VALUE = BasicMultipleStructPropertyValue | BasicStructPropertyValue | BoxStructPropertyValue | RailroadTrackPositionStructPropertyValue | InventoryItemStructPropertyValue | FICFrameRangeStructPropertyValue | DynamicStructPropertyValue | col4 | vec3 | vec4 | string; | ||
export declare class StructProperty extends AbstractBaseProperty { | ||
subtype: string; | ||
guid: number; | ||
value: GENERIC_STRUCT_PROPERTY_VALUE; | ||
unk1?: number; | ||
unk2?: number; | ||
unk3?: number; | ||
unk4?: number; | ||
constructor(subtype: string, ueType?: string, index?: number, guid?: number); | ||
static Parse(reader: ByteReader, ueType: string, index: number, size: number): StructProperty; | ||
static ParseValue(reader: ByteReader, subtype: string, size: number): GENERIC_STRUCT_PROPERTY_VALUE; | ||
static CalcOverhead(property: StructProperty): number; | ||
static Serialize(writer: SaveWriter, property: StructProperty): void; | ||
static SerializeValue(writer: SaveWriter, subtype: string, value: GENERIC_STRUCT_PROPERTY_VALUE): void; | ||
} | ||
export type ArrayPropertyStructValueFields = { | ||
allStructType: string; | ||
allIndex: number; | ||
allGuid: number; | ||
allUnk1?: number; | ||
allUnk2?: number; | ||
allUnk3?: number; | ||
allUnk4?: number; | ||
}; | ||
export declare class ArrayProperty<T> extends BasicProperty { | ||
subtype: string; | ||
values: T[]; | ||
structValueFields?: ArrayPropertyStructValueFields | undefined; | ||
constructor(subtype: string, values: T[], ueType?: string, index?: number, structValueFields?: ArrayPropertyStructValueFields | undefined); | ||
static Parse(reader: ByteReader, ueType: string, index: number, propertyName: string): ArrayProperty<any>; | ||
static CalcOverhead(property: ArrayProperty<any>): number; | ||
static Serialize(writer: SaveWriter, property: ArrayProperty<any>, propertyName: string): void; | ||
} | ||
export declare class SetProperty<T> extends BasicProperty { | ||
subtype: string; | ||
values: T[]; | ||
constructor(subtype: string, values: T[], ueType: string, index: number); | ||
static Parse(reader: ByteReader, ueType: string, index: number, propertyName: string): SetProperty<any>; | ||
static CalcOverhead(property: SetProperty<any>): number; | ||
static Serialize(writer: SaveWriter, property: SetProperty<any>): void; | ||
} | ||
export declare class MapProperty extends BasicProperty { | ||
keyType: string; | ||
valueType: string; | ||
modeType: number; | ||
modeUnk1: string | undefined; | ||
modeUnk2: string; | ||
modeUnk3: string; | ||
remainingData: number[]; | ||
values: { | ||
key: any; | ||
value: any; | ||
}[]; | ||
constructor(keyType: string, valueType: string, ueType: string, index: number); | ||
static Parse(reader: ByteReader, propertyName: string, buildVersion: number, size: number, ueType?: string, index?: number): MapProperty; | ||
static CalcOverhead(property: MapProperty): number; | ||
static Serialize(writer: SaveWriter, property: MapProperty): void; | ||
} | ||
export declare const ParseDynamicStructData: (reader: ByteReader, buildVersion: number, type: string) => DynamicStructPropertyValue; | ||
export declare const SerializeDynamicStructData: (writer: SaveWriter, buildVersion: number, data: DynamicStructPropertyValue) => void; | ||
export declare const ReadFINNetworkTrace: (reader: ByteReader) => any; | ||
export declare const SerializeFINNetworkTrace: (writer: SaveWriter, obj: any) => void; | ||
export declare const ReadFINLuaProcessorStateStorage: (reader: ByteReader, size: number) => any; | ||
export declare const SerializeFINLuaProcessorStateStorage: (writer: SaveWriter, stateStorage: any) => void; | ||
export declare class DataFields { | ||
properties: any[]; | ||
trailingData: number[]; | ||
shouldBeNulled: boolean; | ||
constructor(); | ||
static Parse(length: number, reader: ByteReader, buildVersion: number): DataFields; | ||
static ParseProperty(reader: ByteReader, buildVersion: number, propertyName: string): AbstractBaseProperty | null; | ||
static Serialize(writer: SaveWriter, fields: DataFields, buildVersion: number): void; | ||
static SerializeProperty(writer: SaveWriter, property: AbstractBaseProperty, propertyName: string, buildVersion: number): void; | ||
} | ||
declare abstract class SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
dataFields: DataFields; | ||
constructor(typePath: string, rootObject: string, instanceName: string); | ||
protected static ParseHeader(reader: ByteReader, obj: SaveObject): void; | ||
protected static SerializeHeader(writer: ByteWriter, obj: SaveObject): void; | ||
static ParseData(obj: SaveObject, length: number, reader: ByteReader, buildVersion: number): void; | ||
static SerializeData(writer: any, obj: SaveObject, buildVersion: number): void; | ||
} | ||
export declare class SaveComponent extends SaveObject { | ||
typePath: string; | ||
rootObject: string; | ||
instanceName: string; | ||
parentEntityName: string; | ||
static readonly TypeID = 0; | ||
readonly type = "SaveComponent"; | ||
constructor(typePath: string, rootObject: string, instanceName: string, parentEntityName?: string); | ||
static ParseHeader(reader: ByteReader, obj: SaveComponent): void; | ||
static SerializeHeader(writer: ByteWriter, component: SaveComponent): void; | ||
static ParseData(component: SaveComponent, length: number, reader: ByteReader, buildVersion: number): void; | ||
} | ||
export interface BlueprintConfig { | ||
description: string; | ||
color: col4; | ||
iconID: number; | ||
} | ||
export type BlueprintHeader = { | ||
itemCosts: [ | ||
string, | ||
number | ||
][]; | ||
recipeReferences: string[]; | ||
}; | ||
export interface Blueprint { | ||
name: string; | ||
compressionInfo: ChunkCompressionInfo; | ||
header: BlueprintHeader; | ||
config: BlueprintConfig; | ||
objects: (SaveEntity | SaveComponent)[]; | ||
} | ||
export declare class BlueprintReader extends ByteReader { | ||
compressionInfo: ChunkCompressionInfo; | ||
constructor(bluePrintBuffer: ArrayBuffer); | ||
static ReadHeader(reader: ByteReader): BlueprintHeader; | ||
inflateChunks(): any; | ||
static ParseObjects(reader: ByteReader): (SaveEntity | SaveComponent)[]; | ||
} | ||
export declare class BlueprintConfigReader extends ByteReader { | ||
bluePrintConfigBuffer: ArrayBuffer; | ||
constructor(bluePrintConfigBuffer: ArrayBuffer); | ||
parse: () => BlueprintConfig; | ||
static ParseConfig(reader: ByteReader): BlueprintConfig; | ||
} | ||
export declare class BlueprintWriter extends ByteWriter { | ||
constructor(); | ||
static SerializeHeader(writer: ByteWriter, header: BlueprintHeader): void; | ||
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
static SerializeObjects(writer: ByteWriter, objects: (SaveEntity | SaveComponent)[]): void; | ||
} | ||
export declare class BlueprintConfigWriter extends ByteWriter { | ||
constructor(); | ||
static SerializeConfig(writer: ByteWriter, config: BlueprintConfig): void; | ||
} | ||
export declare class ParserError extends Error { | ||
constructor(name: string, message: string); | ||
} | ||
export declare class UnsupportedVersionError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export declare class CorruptSaveError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export declare class CompressionLibraryError extends ParserError { | ||
constructor(message?: string); | ||
} | ||
export declare class Parser { | ||
static WriteSave(save: SatisfactorySave, onBinaryBeforeCompressing: (buffer: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[]; | ||
static ParseSaveFile(file: Buffer, onDecompressedSaveBody?: (buffer: ArrayBuffer) => void, onProgress?: (progress: number, message?: string) => void): SatisfactorySave; | ||
static WriteBlueprintFiles(blueprint: Blueprint, onMainFileBinaryBeforeCompressing?: (binary: ArrayBuffer) => void, onMainFileHeader?: (header: Uint8Array) => void, onMainFileChunk?: (chunk: Uint8Array) => void): { | ||
mainFileChunkSummary: ChunkSummary[]; | ||
configFileBinary: ArrayBuffer; | ||
}; | ||
static ParseBlueprintFiles(name: string, blueprintFile: Buffer, blueprintConfigFile: Buffer, onDecompressedBlueprintBody?: (buffer: ArrayBuffer) => void): Blueprint; | ||
static ProjectSave(save: SatisfactorySave, config: SaveProjectionConfig): SatisfactorySave; | ||
static JSONStringifyModified: (obj: any, indent?: number) => string; | ||
} | ||
} | ||
declare module '@etothepii/satisfactory-file-parser' { | ||
import main = require('@etothepii/satisfactory-file-parser/index'); | ||
export = main; | ||
} | ||
export {}; |
{ | ||
"name": "@etothepii/satisfactory-file-parser", | ||
"author": "etothepii", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "A file parser for satisfactory files. Includes save files and blueprint files.", | ||
@@ -19,3 +19,3 @@ "types": "./dist/index.d.ts", | ||
"build": "tsc && npm run bundle", | ||
"bundle": "npx webpack", | ||
"bundle": "npx webpack && dts-bundle-generator -o dist/index.d.ts src/index.ts", | ||
"prepublishOnly": "npm run build && npm version patch" | ||
@@ -22,0 +22,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143637
609