import { NatModule } from "../lib/nat";
export type Compilation = {
    success: boolean;
    tex: string;
};
export type CoreFile = {
    path: string;
    content: string;
    type: "tree" | "blob";
};
type OutputHandler = (stdout: string) => void;
type OutputHandlerMap = {
    [key: string]: OutputHandler;
};
export declare const CORE_DIR = "core", SRC_DIR = "src";
export declare const abs: (path: string) => string;
export declare enum InterpretationStatus {
    OK = 0,
    COMPILATION_ERROR = 1,
    RUNTIME_ERROR = 2
}
declare class Runtime {
    wasmModule?: NatModule;
    stdOutHandlers: OutputHandlerMap;
    stdErrHandlers: OutputHandlerMap;
    errors: string[];
    constructor();
    handleStdOut: (stdout: string) => void;
    handleStdErr: (stderr: string) => void;
    storeErr: (err: string) => number;
    onStdout: (handler: OutputHandler) => () => void;
    loadWasmModule: () => Promise<NatModule>;
    readStrMem: (pointer: number) => Promise<string>;
    typeset: (path: string) => Promise<{
        success: boolean;
        tex: string;
        errors: never[];
    }>;
    interpret: (path: string) => Promise<InterpretationStatus>;
    getCoreFiles: (dir?: string) => Promise<CoreFile[]>;
    mkDir: (path: string) => Promise<void>;
    getFile: (path: string) => Promise<CoreFile>;
    setFile: (path: string, content: string) => Promise<void>;
}
export default Runtime;
