/**
 * Runtime - Execute user code with shimmed Node.js globals
 *
 * ESM to CJS transformation is now handled during npm install by transform.ts
 * using esbuild-wasm. This runtime just executes the pre-transformed CJS code.
 */
import { VirtualFS } from './virtual-fs';
import type { IExecuteResult } from './runtime-interface';
import { Process } from './shims/process';
export interface Module {
    id: string;
    filename: string;
    exports: unknown;
    loaded: boolean;
    children: Module[];
    paths: string[];
}
export interface RuntimeOptions {
    cwd?: string;
    env?: Record<string, string>;
    onConsole?: (method: string, args: unknown[]) => void;
}
export interface RequireFunction {
    (id: string): unknown;
    resolve: (id: string) => string;
    cache: Record<string, Module>;
}
/**
 * Runtime class for executing code in virtual environment
 * Note: This class has sync methods for backward compatibility.
 * Use createRuntime() factory for IRuntime interface compliance.
 */
export declare class Runtime {
    private vfs;
    private fsShim;
    private process;
    private moduleCache;
    private options;
    constructor(vfs: VirtualFS, options?: RuntimeOptions);
    /**
     * Set up a polyfilled TextDecoder that handles binary encodings
     */
    private setupTextDecoderPolyfill;
    /**
     * Execute code as a module (synchronous - backward compatible)
     */
    execute(code: string, filename?: string): {
        exports: unknown;
        module: Module;
    };
    /**
     * Execute code as a module (async version for IRuntime interface)
     * Alias: executeSync() is the same as execute() for backward compatibility
     */
    executeSync: (code: string, filename?: string) => {
        exports: unknown;
        module: Module;
    };
    /**
     * Execute code as a module (async - for IRuntime interface)
     */
    executeAsync(code: string, filename?: string): Promise<IExecuteResult>;
    /**
     * Run a file from the virtual file system (synchronous - backward compatible)
     */
    runFile(filename: string): {
        exports: unknown;
        module: Module;
    };
    /**
     * Alias for runFile (backward compatibility)
     */
    runFileSync: (filename: string) => {
        exports: unknown;
        module: Module;
    };
    /**
     * Run a file from the virtual file system (async - for IRuntime interface)
     */
    runFileAsync(filename: string): Promise<IExecuteResult>;
    /**
     * Clear the module cache
     */
    clearCache(): void;
    /**
     * Get the virtual file system
     */
    getVFS(): VirtualFS;
    /**
     * Get the process object
     */
    getProcess(): Process;
}
/**
 * Create and execute code in a new runtime (synchronous - backward compatible)
 */
export declare function execute(code: string, vfs: VirtualFS, options?: RuntimeOptions): {
    exports: unknown;
    module: Module;
};
export type { IRuntime, IExecuteResult, IRuntimeOptions } from './runtime-interface';
export default Runtime;
//# sourceMappingURL=runtime.d.ts.map