UNPKG

sc4

Version:

A command line utility for automating SimCity 4 modding tasks & modifying savegames

54 lines (53 loc) 1.92 kB
import { SmartBuffer } from 'smart-arraybuffer'; import type Color from './color.js'; import type Vertex from './vertex.js'; import type Pointer from './pointer.js'; import type { byte, double, dword, float, sint8, sint16, sint32, sint64, uint8, uint16, uint32, word, qword, TGILike } from 'sc4/types'; import type { Box3, ParseOptions } from './box-3.js'; import type TractInfo from './tract-info.js'; import type { Vector3Like } from './vector-3.js'; import type SimulatorDate from './simulator-date.js'; type HasWrite = { write: (arr: WriteBuffer) => any; }; type HasToBuffer = { toBuffer: () => Uint8Array; }; type Writable = Uint8Array | HasWrite | HasToBuffer; export default class WriteBuffer extends SmartBuffer { write(buffer: Writable, offset?: number): void; string(str: string, opts?: { length?: number; }): void; int8(value: sint8): void; int16(value: sint16): void; int32(value: sint32): void; bigint64(value: sint64): void; float(value: float): void; double(value: double): void; uint8(value: uint8): void; byte(value: byte): void; bool(value: boolean): void; uint16(value: uint16): void; word(value: word): void; uint32(value: uint32): void; dword(value: dword): void; qword(value: qword): void; zeroes(n: number): void; array<T extends Writable>(arr: T[]): void; array<T>(arr: T[], fn: (item: T) => any): void; tuple<T>(arr: T[], fn?: (item: T) => any): void; tgi(tgi: TGILike): void; gti(tgi: TGILike): void; date(date: SimulatorDate): void; version(version: string): void; pointer(ptr: Pointer | null): void; vector3(vector: Vector3Like): void; color(color: Color): void; vertex(vertex: Vertex): void; tract(tract: TractInfo): void; bbox(bbox: Box3, opts?: ParseOptions): void; seal(): Uint8Array; toBuffer(): Buffer<ArrayBufferLike>; } export {};