import { Image } from "@devicescript/compiler";
import { JDService, JDServiceClient } from "jacdac-ts";
import { DevsDbgReg, DevsDbgSuspensionType, DevsDbgValueTag, DevsDbgStepFlags } from "@devicescript/compiler";
export interface DevsKeyValue {
    key: DevsValue | string;
    value: DevsValue;
}
export declare class DevsValue {
    parent: DevsDbgClient;
    index: number;
    tag: DevsDbgValueTag;
    v0: number;
    arg: DevsValue;
    private cachedBytes;
    numNamed: number;
    hasNamed: boolean;
    numIndexed: number;
    private _indexed;
    private _named;
    stackFrame?: {
        pc: number;
        userPc: number;
        closure: DevsValue;
        fnIdx: number;
    };
    constructor(parent: DevsDbgClient);
    get genericText(): string;
    readIndexed(): Promise<DevsValue[]>;
    readNamed(): Promise<DevsKeyValue[]>;
    readField(name: string): Promise<DevsValue>;
    private readBytes;
    get isPartial(): boolean;
    get isPrimitive(): boolean;
    get isBuffer(): boolean;
    readBuffer(): Promise<Uint8Array>;
    get isString(): boolean;
    readString(): Promise<string>;
}
export declare const EV_SUSPENDED = "dbgSuspended";
export declare class DevsDbgClient extends JDServiceClient {
    img: Image;
    private regEn;
    private lock;
    suspensionReason: DevsDbgSuspensionType;
    suspendedFiber: number;
    values: DevsValue[];
    private valueMap;
    constructor(service: JDService, img: Image);
    get suspended(): boolean;
    private clearValues;
    disable(): Promise<void>;
    private runExclusive;
    resume(): Promise<void>;
    setBoolReg(reg: DevsDbgReg, v: boolean): Promise<void>;
    private haltCmd;
    halt(): Promise<void>;
    restartAndHalt(): Promise<void>;
    step(frame: DevsValue, flags: DevsDbgStepFlags, brkPCs: number[]): Promise<void>;
    private runSuspCmd;
    clearAllBreakpoints(): Promise<void>;
    setBreakpoints(pc: number[]): Promise<void>;
    clearBreakpoints(pc: number[]): Promise<void>;
    private waitEvent;
    waitSuspended(): Promise<void>;
    get nullValue(): DevsValue;
    getValueByIndex(idx: number): DevsValue;
    getCachedValue(tag: DevsDbgValueTag, v0: number, arg?: DevsValue): DevsValue;
    mkSynthValue(tag: DevsDbgValueTag, v0: number, arg?: DevsValue): DevsValue;
    exnValue(): DevsValue;
    glbValue(): DevsValue;
    private getValue;
    readStacktrace(fibid: number): Promise<DevsValue[]>;
    readFibers(): Promise<{
        fiberId: any;
        initialFn: any;
        currFn: any;
    }[]>;
    private unpackValue;
    private indexedArg;
    readBytes(v: DevsValue, start?: number, length?: number): Promise<Uint8Array>;
    readIndexed(v: DevsValue, start?: number, length?: number): Promise<DevsValue[]>;
    private decodeString;
    readNamed(v: DevsValue): Promise<DevsKeyValue[]>;
    private pipeGet;
    private suspendedHandler;
    private xlog;
}
//# sourceMappingURL=devsdbgclient.d.ts.map