/* auto-generated by NAPI-RS */ /* eslint-disable */ /** Stateful compiler exposed to Node callers. */ export declare class XmdxCompiler { /** Creates a compiler that can be reused across Vite transform hooks. */ constructor(config?: CompilerConfig | undefined | null) /** * Compiles Markdown/MDX into an Astro-compatible module string. * * Internally this delegates to `compile_ir` for parsing/rewriting, then * formats the legacy Astro module code. A future adapter hook can replace * the codegen step without changing the JS-facing signature. */ compile(source: string, filepath: string, options?: FileOptions | undefined | null): CompileResult /** * Compiles multiple Markdown/MDX files in parallel using Rayon. * * This method uses the compiler's configuration for all files and processes * them concurrently for faster batch compilation. Returns IR results. * * # Arguments * * * `inputs` - Array of files to compile * * `options` - Optional batch processing options (thread count, error handling) * * # Returns * * Returns a `BatchProcessingResult` containing individual IR results and statistics. */ compileBatch(inputs: Array, options?: BatchOptions | undefined | null): BatchProcessingResult /** * Compiles multiple Markdown/MDX files to complete Astro modules in parallel. * * Unlike `compileBatch` which returns IR for further processing in TypeScript, * this method returns complete Astro module code ready for esbuild transformation. * This eliminates the need for TypeScript's `wrapHtmlInJsxModule` step. * * # Arguments * * * `inputs` - Array of files to compile * * `options` - Optional batch processing options (thread count, error handling) * * # Returns * * Returns a `ModuleBatchProcessingResult` containing complete module code and statistics. */ compileBatchToModule(inputs: Array, options?: BatchOptions | undefined | null): ModuleBatchProcessingResult /** * Compiles multiple MDX files in parallel using mdxjs-rs. * * Uses the compiler's configuration for JSX import source and directive * settings. Non-MDX files are rejected with an error. * * # Arguments * * * `inputs` - Array of MDX files to compile * * `options` - Optional batch processing options (thread count, error handling) * * # Returns * * Returns a `MdxBatchProcessingResult` containing individual results and statistics. */ compileMdxBatch(inputs: Array, options?: BatchOptions | undefined | null): MdxBatchProcessingResult } /** Structured batch error with a machine-readable code and human-readable message. */ export interface BatchError { /** Error category for programmatic handling (e.g., "PARSE_ERROR", "RENDER_ERROR"). */ code: string /** Human-readable error message. */ message: string } /** Input for batch processing - represents a single file to compile. */ export interface BatchInput { /** File identifier (typically the file path). */ id: string /** Markdown/MDX source content. */ source: string /** Optional filepath override for error messages and file type detection. */ filepath?: string } /** Options for batch processing. */ export interface BatchOptions { /** Maximum number of threads to use. Defaults to number of CPU cores. */ maxThreads?: number /** Whether to continue processing after an error. Defaults to true. */ continueOnError?: boolean /** * Compiler configuration for standalone batch functions. * Ignored by class methods which use `self.config` instead. */ config?: CompilerConfig } /** Result of batch processing containing all results and statistics. */ export interface BatchProcessingResult { /** Individual results for each input file. */ results: Array /** Processing statistics. */ stats: BatchStats } /** Result for a single file in a batch. */ export interface BatchResult { /** File identifier matching the input. */ id: string /** Compilation result (present on success). */ result?: CompileIrResult /** Structured error (present on failure). */ error?: BatchError } /** Statistics for batch processing. */ export interface BatchStats { /** Total number of files processed. */ total: number /** Number of successfully compiled files. */ succeeded: number /** Number of failed compilations. */ failed: number /** Total processing time in milliseconds. */ processingTimeMs: number } /** Options for the mdast v2 block renderer. */ export interface BlockOptions { /** Enable directive preprocessing (:::note, etc.). Defaults to true. */ enableDirectives?: boolean /** Enable smart punctuation transformations. Defaults to false. */ enableSmartypants?: boolean /** Enable lazy loading for images. Defaults to false. */ enableLazyImages?: boolean /** Allow raw HTML (