/** * Preprocessor for .prompt files. * Injects imports for built-in components and wraps raw JSX with export default. * * Preprocessing is determined by file extension, not by scanning source content. * .prompt files always receive full preprocessing (import injection + export wrapping). * All other files (.tsx, .ts, etc.) are returned unchanged — they are expected to * manage their own imports and exports. * * This avoids false positives from content-based regex detection, where non-JS * `import` keywords (e.g., Python's `import hashlib`) or `export default` inside * code examples could be mistakenly detected as real JS statements (issue #29). */ export interface PreprocessOptions { /** Original filename for error messages */ filename: string; } /** * Check if a file is a .prompt file based on extension. */ export declare function isPromptFile(filename: string): boolean; /** * Preprocess source code for .prompt files. * * .prompt files always receive: * - Import injection for all built-in components * - Fragment wrapping around the content (so the uses-to-import Babel plugin * can find and transform any elements within the JSX tree) * - Export default wrapping * * Non-.prompt files are returned unchanged. * * @param source - Raw source code * @param options - Preprocessing options (must include filename) * @returns Preprocessed source code ready for Babel transformation */ export declare function preprocessSource(source: string, options: PreprocessOptions): string; //# sourceMappingURL=preprocessor.d.ts.map