import ts from 'typescript'; import { PikkuError } from '@pikku/core'; export declare class PikkuTypecheckFailedError extends PikkuError { } export interface TscDiagnostic { file: string; line: number; column: number; code: number; category: 'error' | 'warning' | 'suggestion' | 'message'; message: string; } export interface TscCheckResult { errorCount: number; warningCount: number; fileCount: number; diagnostics: TscDiagnostic[]; } /** * Turn raw tsc diagnostics into a filtered, structured result. Pure — it takes * already-computed diagnostics so it can be unit-tested without a program. * Anything under node_modules or outside the project root is dropped so the * output stays focused on the user's own code (and not lib .d.ts noise). */ export declare const collectTscDiagnostics: (diagnostics: readonly ts.Diagnostic[], rootDir: string) => TscCheckResult; /** * Compact, token-frugal render of a type-check result: a one-line header plus * one line per diagnostic (no code frames), capped. Used by `--tsc-summary` so * AI agents and CI logs get the signal without the flood. */ export declare const renderTscSummary: (result: TscCheckResult, maxLines?: number) => string; /** * Full render: tsc's own formatter with code frames, filtered to project files. */ export declare const renderTscFull: (diagnostics: readonly ts.Diagnostic[], rootDir: string, formatHost: ts.FormatDiagnosticsHost) => string; /** * Run a real `tsc --noEmit` over the project's own tsconfig — the correct * source of truth (lib, paths, strict), unlike the inspector's stripped-down * traversal program. Returns both a structured result and the raw diagnostics * so the caller can pick the compact (`--tsc-summary`) or full (`--tsc`) render. */ export declare const runProjectTypecheck: (tsconfigPath: string, rootDir: string) => { result: TscCheckResult; diagnostics: ts.Diagnostic[]; formatHost: ts.FormatDiagnosticsHost; };