xcom2charpool
Version:
Library for reading, manipulating, and managing XCOM 2 character pool binary files, supporting both browser and Node.js environments.
41 lines (40 loc) • 1.18 kB
TypeScript
import { Writer } from '../Writer';
/**
* Auto-growing ArrayBuffer-backed Writer implementation for binary encoding.
*/
export declare class ArrayBufferWriter implements Writer {
#private;
position: number;
constructor(initialSize?: number);
/**
* Writes a 32-bit unsigned integer at the current position.
*/
uint32(value: number): this;
/**
* Writes a 32-bit signed integer at the current position.
*/
int32(value: number): this;
/**
* Writes a byte at the current position.
*/
byte(value: number): this;
/**
* Writes padding (4 zero bytes) at the current position.
*/
padding(): this;
/**
* Writes a string using UE4StringCodec
*/
string(value: string): this;
/**
* Retrieves the underlying buffer up to the current length of data written.
* @returns A sliced ArrayBuffer containing the written data.
*/
getBuffer(): ArrayBuffer;
bytes(value: Uint8Array): Writer;
withLength(fn: () => void | number): void | number;
/**
* Ensures the internal buffer has enough capacity to write additional bytes.
*/
private ensureCapacity;
}