import type { Diagnostic, DiagnosticCategory } from '@typescript/native/unstable/sync'; import { PositionConverter } from './position-converter.js'; /** * A located version of a diagnostic reported by the native TypeScript compiler (TypeScript 7). * Locations are resolved eagerly, because diagnostic positions refer to in-memory (mutated) * content that is reset after each check. */ export interface NativeDiagnostic { fileName: string | undefined; code: number; text: string; column: number; line: number; } /** * Mirrors `DiagnosticCategory.Error` of the TypeScript 7 API. * The value is inlined here because @typescript/native is imported type-only (it is an optional dependency). */ export declare const diagnosticCategoryError: DiagnosticCategory.Error; /** * Converts a diagnostic of the native TypeScript compiler to a located {@link NativeDiagnostic}. * @param diagnostic The diagnostic to convert * @param positionConverter The position converter to use */ export declare function toNativeDiagnostic(diagnostic: Diagnostic, positionConverter?: PositionConverter): NativeDiagnostic; /** * Formats diagnostics the same way as `ts.formatDiagnostics` does, * i.e. `path/to/file.ts(line,character): error TS1234: message` */ export declare function formatDiagnostics(diagnostics: readonly NativeDiagnostic[]): string; //# sourceMappingURL=native-diagnostic.d.ts.map