1 |
|
2 | import * as fs from 'fs';
|
3 | import * as ts from 'typescript';
|
4 | import { Checker } from './checker';
|
5 | import { CompilerInfo, LoaderConfig, TsConfig } from './interfaces';
|
6 | export interface Instance {
|
7 | id: number;
|
8 | babelImpl?: any;
|
9 | compiledFiles: {
|
10 | [key: string]: boolean;
|
11 | };
|
12 | configFilePath: string;
|
13 | compilerConfig: TsConfig;
|
14 | loaderConfig: LoaderConfig;
|
15 | checker: Checker;
|
16 | cacheIdentifier: any;
|
17 | context: string;
|
18 | }
|
19 | export interface Compiler {
|
20 | inputFileSystem: typeof fs;
|
21 | _tsInstances: {
|
22 | [key: string]: Instance;
|
23 | };
|
24 | options: {
|
25 | watch: boolean;
|
26 | };
|
27 | }
|
28 | export interface Loader {
|
29 | _compiler: Compiler;
|
30 | cacheable: () => void;
|
31 | query: string;
|
32 | async: () => (err: Error, source?: string, map?: string) => void;
|
33 | resourcePath: string;
|
34 | resolve: () => void;
|
35 | addDependency: (dep: string) => void;
|
36 | clearDependencies: () => void;
|
37 | emitFile: (fileName: string, text: string) => void;
|
38 | emitWarning: (msg: string) => void;
|
39 | emitError: (msg: string) => void;
|
40 | options: {
|
41 | ts?: LoaderConfig;
|
42 | };
|
43 | }
|
44 | export declare type QueryOptions = LoaderConfig & ts.CompilerOptions;
|
45 | export declare function getRootCompiler(compiler: any): any;
|
46 | export declare function ensureInstance(webpack: Loader, query: QueryOptions, options: LoaderConfig, instanceName: string, rootCompiler: any): Instance;
|
47 | export declare function setupTs(compiler: string): CompilerInfo;
|
48 | export interface Configs {
|
49 | configFilePath: string;
|
50 | compilerConfig: TsConfig;
|
51 | loaderConfig: LoaderConfig;
|
52 | }
|
53 | export declare function readConfigFile(context: string, query: QueryOptions, options: LoaderConfig, tsImpl: typeof ts): Configs;
|