/** * ES Module evaluator using dynamic import(). * Supports both browser (Blob URLs) and Node.js environments. * * Uses Option 2 (Full Path Rewriting) from design/module-import-design.md: * All bare specifiers are resolved to absolute file:// URLs at transform time, * eliminating the need for Node.js module resolution at runtime. */ export interface EvaluateOptions { /** Filename for error messages */ filename: string; } /** * Evaluate JavaScript code as an ES module. * Uses Blob URLs in browser and temp files in Node.js. * * In Node.js, all bare specifiers (like '@pupt/lib', 'zod') are rewritten * to absolute file:// URLs before evaluation, eliminating module resolution issues. * * @param code - JavaScript code to evaluate (should be valid ES module) * @param options - Evaluation options * @returns The module's exports object * * @example * ```typescript * const code = ` * import { Prompt } from '@pupt/lib'; * export default ; * `; * const module = await evaluateModule(code, { filename: 'test.tsx' }); * const element = module.default; * ``` */ export declare function evaluateModule(code: string, options: EvaluateOptions): Promise<{ default?: unknown; [key: string]: unknown; }>; //# sourceMappingURL=module-evaluator.d.ts.map