UNPKG

vite-esbuild-typescript-checker

Version:

* Speeds up [TypeScript](https://github.com/Microsoft/TypeScript) type checking * Supports [Vue Single File Component](https://vuejs.org/v2/guide/single-file-components.html) * Displays nice error messages with the [code frame](https://babeljs.io/docs/en/

49 lines (48 loc) 1.54 kB
import type { Message } from 'esbuild'; import ts from 'typescript'; export interface EsbuildDiagnosticOutput { pretty: string; standard: string; } export interface EsbuildDiagnosticMessage { type: 'error' | 'warning'; message: Message; } export interface WorkerDiagnosticsMessage { type: 'diagnostic' | 'summary'; diagnostics: readonly EsbuildDiagnosticMessage[]; output: EsbuildDiagnosticOutput; } export interface WorkerBuildMessage { type: 'build'; } export interface WorkerStartMessage { type: 'start'; build?: boolean; watch?: boolean; } export interface WorkerDoneMessage { type: 'done'; errorCount: number; duration: number; } export type WorkerMessage = WorkerDiagnosticsMessage | WorkerBuildMessage | WorkerStartMessage | WorkerDoneMessage; export declare class Reporter { private readonly basedir; private readonly postMessage; private start; constructor(basedir: string, postMessage?: (msg: WorkerMessage) => void); markBuildStart(): void; reportBuildStart: ({ build, watch }?: { build?: boolean; watch?: boolean; }) => void; reportBuildDone: (errorCount: number) => void; reportDiagnostic: (diagnostic: ts.Diagnostic) => void; reportDiagnostics: (diagnostics: readonly ts.Diagnostic[]) => void; reportSummaryDiagnostic: (diagnostic: ts.Diagnostic) => void; private static readonly formatHost; private static extractErrorCount; private static getOutput; private static transformDiagnostics; }