import type { VirtualCode } from "@volar/language-core"; /** * The subset of `vfile-message`'s VFileMessage that we read. When * `@mdx-js/language-service` fails to parse a document it stores the thrown * message here and emits an empty fallback virtual file, so the parse error * would otherwise never reach `tsc`. */ export interface ParseError { reason?: string; line?: number | null; column?: number | null; place?: { offset?: number; line?: number; column?: number; } | { start?: { offset?: number; line?: number; column?: number; }; } | null; } /** * Rewrite a failed document's embedded JS so the MDX parse error surfaces as a * `tsc` diagnostic at the original location. * * We prepend `// @ts-check` (so this reports even when the project has no * `checkJs`) and append a call whose string argument — the parse reason — is * passed to a `never` parameter. TypeScript then emits TS2345 with the reason * quoted in the message, and our CodeMapping relocates it onto the MDX source. */ export declare function injectParseErrorDiagnostic(embedded: VirtualCode, mdx: string, error: ParseError): VirtualCode;