1 | import { BaseError } from 'make-error';
|
2 | import * as TS from 'typescript';
|
3 |
|
4 |
|
5 |
|
6 | export interface TSCommon {
|
7 | version: typeof TS.version;
|
8 | sys: typeof TS.sys;
|
9 | ScriptSnapshot: typeof TS.ScriptSnapshot;
|
10 | displayPartsToString: typeof TS.displayPartsToString;
|
11 | createLanguageService: typeof TS.createLanguageService;
|
12 | getDefaultLibFilePath: typeof TS.getDefaultLibFilePath;
|
13 | getPreEmitDiagnostics: typeof TS.getPreEmitDiagnostics;
|
14 | flattenDiagnosticMessageText: typeof TS.flattenDiagnosticMessageText;
|
15 | transpileModule: typeof TS.transpileModule;
|
16 | ModuleKind: typeof TS.ModuleKind;
|
17 | ScriptTarget: typeof TS.ScriptTarget;
|
18 | findConfigFile: typeof TS.findConfigFile;
|
19 | readConfigFile: typeof TS.readConfigFile;
|
20 | parseJsonConfigFileContent: typeof TS.parseJsonConfigFileContent;
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 | export declare const VERSION: any;
|
26 |
|
27 |
|
28 |
|
29 | export interface Options {
|
30 | typeCheck?: boolean | null;
|
31 | transpileOnly?: boolean | null;
|
32 | cache?: boolean | null;
|
33 | cacheDirectory?: string;
|
34 | compiler?: string;
|
35 | ignore?: string | string[];
|
36 | project?: string;
|
37 | skipIgnore?: boolean | null;
|
38 | skipProject?: boolean | null;
|
39 | compilerOptions?: object;
|
40 | ignoreDiagnostics?: number | string | Array<number | string>;
|
41 | readFile?: (path: string) => string | undefined;
|
42 | fileExists?: (path: string) => boolean;
|
43 | transformers?: TS.CustomTransformers;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 | export interface TypeInfo {
|
49 | name: string;
|
50 | comment: string;
|
51 | }
|
52 |
|
53 |
|
54 |
|
55 | export declare const DEFAULTS: Options;
|
56 |
|
57 |
|
58 |
|
59 | export declare function split(value: string | undefined): string[] | undefined;
|
60 |
|
61 |
|
62 |
|
63 | export declare function parse(value: string | undefined): object | undefined;
|
64 |
|
65 |
|
66 |
|
67 | export declare function normalizeSlashes(value: string): string;
|
68 |
|
69 |
|
70 |
|
71 | export declare class TSError extends BaseError {
|
72 | diagnostics: TSDiagnostic[];
|
73 | name: string;
|
74 | constructor(diagnostics: TSDiagnostic[]);
|
75 | }
|
76 | /**
|
77 | * Return type for registering `ts-node`.
|
78 | */
|
79 | export interface Register {
|
80 | cwd: string;
|
81 | extensions: string[];
|
82 | cachedir: string;
|
83 | ts: TSCommon;
|
84 | compile(code: string, fileName: string, lineOffset?: number): string;
|
85 | getTypeInfo(code: string, fileName: string, position: number): TypeInfo;
|
86 | }
|
87 |
|
88 |
|
89 |
|
90 | export declare function register(opts?: Options): Register;
|
91 |
|
92 |
|
93 |
|
94 | export declare function formatDiagnostics(diagnostics: TS.Diagnostic[], cwd: string, ts: TSCommon, lineOffset: number): TSDiagnostic[];
|
95 |
|
96 |
|
97 |
|
98 | export interface TSDiagnostic {
|
99 | message: string;
|
100 | code: number;
|
101 | }
|
102 |
|
103 |
|
104 |
|
105 | export declare function formatDiagnostic(diagnostic: TS.Diagnostic, cwd: string, ts: TSCommon, lineOffset: number): TSDiagnostic;
|
106 |
|
107 |
|
108 |
|
109 | export declare function printError(error: TSError): string;
|