import { InstrArgResolver, StrIdx } from "./format";
import { SrcMapResolver, DebugInfo, FunctionDebugInfo } from "@devicescript/interop";
export interface DisassembleOptions {
    detailed?: boolean;
    diff?: boolean;
}
export declare class OpTree {
    opcode: number;
    args: OpTree[];
    intArg: number;
    constructor(opcode: number);
}
export declare class OpStmt extends OpTree {
    index: number;
    pc: number;
    pcEnd: number;
    srcPos: number;
    srcLen: number;
    jmpTrg: OpStmt;
    error: string;
}
export declare class ImgFunction {
    parent: Image;
    index: number;
    bytecode: Uint8Array;
    name: string;
    numArgs: number;
    numSlots: number;
    flags: number;
    numTryFrames: number;
    imgOffset: number;
    dbg: FunctionDebugInfo;
    private stmtsCache;
    get numLocals(): number;
    constructor(parent: Image, index: number, bytecode: Uint8Array, name: string);
    disassemble(options: DisassembleOptions): string;
    toStmts(): OpStmt[];
    stmtByGlobalPc(pc: number): OpStmt;
    findZoneExits(start: OpStmt, inZone: (s: OpStmt) => boolean): OpStmt[];
    private parseBytecode;
}
export declare function parseBytecode(bytecode: Uint8Array, throwOnError?: boolean): OpStmt[];
export declare function stringifyInstr(stmt: OpStmt, resolver?: InstrArgResolver): string;
export declare class Image {
    errors: string[];
    devsBinary: Uint8Array;
    numGlobals: number;
    numSpecs: number;
    floatTable: Float64Array;
    bultinTable: string[];
    asciiTable: string[];
    utf8Table: string[];
    utf8TableInfo: string[];
    bufferTable: Uint8Array[];
    functions: ImgFunction[];
    dbg: DebugInfo;
    srcmap: SrcMapResolver;
    sizeInfo: string;
    private specData;
    private dcfgData;
    constructor(input: Uint8Array | string | DebugInfo);
    private error;
    stringTable(tp: StrIdx): string[] | Uint8Array[];
    describeString(tp: StrIdx, idx: number, detail?: boolean): string;
    getString(tp: StrIdx, idx: number): string | Uint8Array;
    private load;
    disassemble(options: DisassembleOptions): string;
}
export declare function disassemble(data: string | Uint8Array | DebugInfo, options?: DisassembleOptions): string;
//# sourceMappingURL=disassemble.d.ts.map