import type { Config } from "@marko/compiler"; import { type Diagnostic as CompilerDiagnostic } from "@marko/compiler/babel-utils"; import type { TextDocument } from "vscode-languageserver-textdocument"; import type { Plugin } from "../types"; /** * The result of compiling a document for diagnostics: either the compiler's * diagnostics or the error thrown while trying to compile it. */ export type MarkoDiagnosticsResult = { diagnostics: CompilerDiagnostic[]; error?: undefined; } | { diagnostics?: undefined; error: unknown; }; /** * Shared compiler config used to surface diagnostics. Runs through the * `migrate` output (the latest stage diagnostic fixes can be registered in) * with error recovery so that all recoverable diagnostics are returned on * `meta.diagnostics` instead of being thrown. The code action provider reuses * this same config so the diagnostics (and their indices) line up exactly with * what is reported here. */ export declare const compilerConfig: Config; /** * Compiles the document for diagnostics, caching the result per document * version. Both `doValidate` and the code action provider call this so the * document is only compiled once per change. */ export declare function getMarkoDiagnostics(doc: TextDocument): MarkoDiagnosticsResult; export declare const doValidate: Plugin["doValidate"];