UNPKG

@etothepii/satisfactory-file-parser

Version:

A file parser for satisfactory files. Includes save files and blueprint files.

58 lines (57 loc) 2.08 kB
/// <reference types="node" /> import { ReadableStreamDefaultReader } from "stream/web"; import { Alignment } from "../byte/alignment.enum"; import { BinaryReadable } from "../byte/binary-readable.interface"; export interface StreamBinaryReadable extends BinaryReadable { pause: () => void; resume: () => void; hasInput: () => boolean; } export declare abstract class ByteStreamReader implements StreamBinaryReadable { private reader; onCloseCallback: () => Promise<void>; private timeout; maxBufferThreshold: number; alignment: Alignment; protected operatingStreamBuffer: Uint8Array; protected operatingDataView: DataView; protected callbackAfterRead: undefined | (() => void); protected currentByte: number; protected inputStreamIsDone: boolean; protected paused: boolean; debug: boolean; protected closedAlready: boolean; protected neededNextAmountOfBytes: number; private readLoopHandle; private waitingTimeoutHandle; protected totalNumberOfBytesRead: number; protected trailingBufferSize: number; constructor(reader: ReadableStreamDefaultReader<Uint8Array>, onCloseCallback: () => Promise<void>, timeout?: number, maxBufferThreshold?: number, alignment?: Alignment); pause(): void; resume(): void; hasInput(): boolean; close(): Promise<void>; protected continuousRead: () => Promise<void>; allocate(count: number): Promise<void>; private waitUntilNumBytesAvailable; skipBytes(byteLength?: number): void; readByte(): number; readBytes(count: number): Uint8Array; readHex(hexLength: number): string; readInt8(): number; readUint8(): number; readInt16(): number; readUint16(): number; readInt32(): number; readUint32(): number; readLong(): bigint; readInt64(): bigint; readUint64(): bigint; readFloat32(): number; readDouble(): number; readString(): string; getBufferPosition(): number; getBufferProgress(): number; getBufferLength(): number; getAmountAllocatedLeft(): number; }