import { AsyncTransformOptions, ParseResult, PreprocessedStyles, PreprocessorError, PreprocessorResult, TransformOptions, TransformResult } from "./types.mjs"; import { CompileOptions, CompileResult } from "@astrojs/compiler-binding"; //#region src/shared.d.ts /** * Map public `TransformOptions` to the NAPI `CompileOptions`. * * Handles: * - `resolvePath` callback → `resolvePathProvided` flag * - `preprocessedStyles` opaque type → raw array */ declare function mapOptions(options?: TransformOptions | AsyncTransformOptions): CompileOptions | undefined; /** * Map the NAPI `CompileResult` to the public `TransformResult`. * * Merges preprocessed style errors into the result. */ declare function mapResult(result: CompileResult, preprocessedStyles?: PreprocessedStyles): TransformResult; /** * Map the NAPI `ParseResult` to the public `ParseResult`. * * The only transformation is parsing the AST JSON string into an object. */ declare function mapParseResult(result: { ast: string; diagnostics: CompileResult['diagnostics']; }): ParseResult; /** Sync callback signature for {@link preprocessStyles}. */ type SyncPreprocessStyleFn = (content: string, attrs: Record) => null | PreprocessorResult | PreprocessorError; /** Async callback signature for {@link preprocessStyles}. */ type AsyncPreprocessStyleFn = (content: string, attrs: Record) => Promise; /** * Extract and preprocess `