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/

46 lines (45 loc) 1.86 kB
import type * as ts from 'typescript'; interface Issue { severity: IssueSeverity; code: string; message: string; file?: string; location?: IssueLocation; } interface IssueLocation { start: IssuePosition; end: IssuePosition; } interface IssuePosition { line: number; column: number; } interface FilesMatch { files: string[]; dirs: string[]; excluded: string[]; extensions: string[]; } type IssueSeverity = 'error' | 'warning'; interface TypeScriptHostExtension { extendWatchSolutionBuilderHost?<TProgram extends ts.BuilderProgram, THost extends ts.SolutionBuilderWithWatchHost<TProgram>>(host: THost, parsedCommandLine?: ts.ParsedCommandLine): THost; extendWatchCompilerHost?<TProgram extends ts.BuilderProgram, THost extends ts.WatchCompilerHost<TProgram>>(host: THost, parsedCommandLine?: ts.ParsedCommandLine): THost; extendCompilerHost?<THost extends ts.CompilerHost>(host: THost, parsedCommandLine?: ts.ParsedCommandLine): THost; extendParseConfigFileHost?<THost extends ts.ParseConfigFileHost>(host: THost): THost; } export interface TypeScriptReporterExtension { extendIssues?(issues: Issue[]): Issue[]; extendDependencies?(dependencies: FilesMatch): FilesMatch; } export interface TypeScriptExtension extends TypeScriptHostExtension, TypeScriptReporterExtension { } interface TypeScriptEmbeddedSource { sourceText: string; extension: '.ts' | '.tsx' | '.js'; } interface TypeScriptEmbeddedExtensionHost { embeddedExtensions: string[]; getEmbeddedSource(fileName: string): TypeScriptEmbeddedSource | undefined; } declare function createTypeScriptEmbeddedExtension({ embeddedExtensions, getEmbeddedSource }: TypeScriptEmbeddedExtensionHost): TypeScriptExtension; export { TypeScriptEmbeddedExtensionHost, TypeScriptEmbeddedSource, createTypeScriptEmbeddedExtension };