UNPKG

sc4

Version:

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

61 lines (60 loc) 2.33 kB
import { SmartBuffer, type SmartBufferOptions } from 'smart-arraybuffer'; import Pointer from './pointer.js'; import SGProp from './sgprop.js'; import Color from './color.js'; import Vertex from './vertex.js'; import TractInfo from './tract-info.js'; import type { byte, double, dword, float, qword, sint16, sint32, sint64, sint8, uint16, uint32, uint64, uint8, word } from 'sc4/types'; import type { Class } from 'type-fest'; import type { FileTypeId, SavegameRecord } from './types.js'; import { Box3, type ParseOptions } from './box-3.js'; import Vector3 from './vector-3.js'; import Matrix3 from './matrix-3.js'; import NetworkCrossing from './network-crossing.js'; import TGI from './tgi.js'; import SimulatorDate from './simulator-date.js'; type StreamOptions = Uint8Array | ArrayBuffer | Stream | SmartBufferOptions; export default class Stream extends SmartBuffer { constructor(opts?: StreamOptions); skip(n?: number): void; read(length?: number): Uint8Array<ArrayBufferLike>; string(length?: number): string; chunk(): Uint8Array<ArrayBufferLike>; rest(): Uint8Array<ArrayBufferLike>; int8(offset?: number): sint8; int16(offset?: number): sint16; int32(offset?: number): sint32; bigint64(offset?: number): sint64; float(offset?: number): float; double(offset?: number): double; uint8(offset?: number): uint8; uint16(offset?: number): uint16; uint32(offset?: number): uint32; biguint64(offset?: number): uint64; byte(offset?: number): byte; word(offset?: number): word; dword(offset?: number): dword; qword(offset?: number): qword; bool(offset?: number): boolean; type<T extends FileTypeId = FileTypeId>(offset?: number): T; size(offset?: number): number; version(n?: number): string; tgi(): TGI; gti(): TGI; date(): SimulatorDate; pointer<T extends SavegameRecord>(): Pointer<T> | null; vector3(): Vector3; matrix3(): Matrix3; color(): Color; vertex(): Vertex; tract(): TractInfo; bbox(opts?: ParseOptions): Box3; array<T>(fn: (this: this, rs?: this, i?: number) => T, size?: number): T[]; struct<T extends { parse: (rs: Stream) => any; }>(Constructor: Class<T>): T; sgprops(): SGProp[]; crossings(): NetworkCrossing[]; assert(): void; } export {};