import { IpoFile } from '@emdzej/inpax-core'; /** * IPO File Parser */ export declare class IpoParser { private readonly bytes; private readonly view; private offset; private versionHi; constructor(buffer: Uint8Array | ArrayBufferLike); /** * Parse complete IPO file */ parse(): IpoFile; /** * Parse file header */ private parseHeader; /** * Parse block header */ private parseBlockHeader; /** * Parse block based on type */ private parseBlock; /** * Parse global variables block. The block stores `size` type bytes * with no values — variables are initialised to defaults at runtime. * Type-byte vocabulary differs between v1.x and v5.x, so we * translate v1.x bytes into the canonical v5.x ValueType space * (see `V1_TYPE_TO_VALUE_TYPE`). */ private parseGlobals; /** * Parse constants block */ private parseConstants; /** * v5.x constant reader — types 0x01–0x09. * * Mirrors INPA.exe's `FUN_00463bd7` (the debug-path reader) and * matches the type table verified at `INPA.exe!FUN_0046456b`. */ private parseConstantV5; /** * v1.x constant reader — types 0x01–0x05. * * Mirrors NCSEXPERT.exe's `FUN_0046a9a0(this, 1, count)` switch. * The on-disk type byte is translated into the canonical v5.x * ValueType so downstream consumers don't need to know about the * v1.x vocabulary. */ private parseConstantV1; /** * Parse function block (instructions). * * Each instruction is 4 bytes: `[opcode][operand1][operand2_lo][operand2_hi]`. * For v1.x files, four of the opcode bytes carry different meanings * than their v5.x counterparts (see `V1_OPCODE_TO_V5_OPCODE` for the * full table and rationale). We remap to canonical v5.x opcode bytes * here so the rest of the system — VM, disassembler, dispatcher — * works on a single normalised representation. * * The `raw` field preserves the original 32-bit on-disk word so any * tooling that needs to render the file faithfully (e.g. a "show me * what's actually in the bytes" disassembler view) can do so without * losing information. */ private parseFunction; /** * Parse screen block with children * Structure: Screen header -> ScreenFunc (0x21) -> LineFunc (0x22)* -> ControlFunc (0x23)? */ private parseScreen; /** * Parse menu block with children * Structure: Menu header -> MenuItemFunc (0x24)* */ private parseMenu; /** * Parse state machine block with children * Structure: StateMachine header -> StateFunc (0x25)* */ private parseStateMachine; private peekU8; private readU8; private readU16LE; private readS16LE; private readU32LE; private readS32LE; private readF64LE; private readStringUntil; private skipBytes; } /** * Parse IPO file from buffer */ export declare function parseIpo(buffer: Uint8Array | ArrayBufferLike): IpoFile; //# sourceMappingURL=ipo-parser.d.ts.map