UNPKG

1.81 kBTypeScriptView Raw
1import * as typescript from 'typescript';
2import * as webpack from 'webpack';
3import { LoaderOptions, TSInstance, WebpackError } from './interfaces';
4/**
5 * The loader is executed once for each file seen by webpack. However, we need to keep
6 * a persistent instance of TypeScript that contains all of the files in the program
7 * along with definition files and options. This function either creates an instance
8 * or returns the existing one. Multiple instances are possible by using the
9 * `instance` property.
10 */
11export declare function getTypeScriptInstance(loaderOptions: LoaderOptions, loader: webpack.loader.LoaderContext): {
12 instance?: TSInstance;
13 error?: WebpackError;
14};
15export declare function initializeInstance(loader: webpack.loader.LoaderContext, instance: TSInstance): void;
16export declare function reportTranspileErrors(instance: TSInstance, loader: webpack.loader.LoaderContext): void;
17export declare function buildSolutionReferences(instance: TSInstance, loader: webpack.loader.LoaderContext): void;
18export declare function forEachResolvedProjectReference<T>(resolvedProjectReferences: readonly (typescript.ResolvedProjectReference | undefined)[] | undefined, cb: (resolvedProjectReference: typescript.ResolvedProjectReference) => T | undefined): T | undefined;
19export declare function getOutputFileNames(instance: TSInstance, configFile: typescript.ParsedCommandLine, inputFileName: string): string[];
20export declare function getInputFileNameFromOutput(instance: TSInstance, filePath: string): string | undefined;
21export declare function getEmitFromWatchHost(instance: TSInstance, filePath?: string): typescript.OutputFile[] | undefined;
22export declare function getEmitOutput(instance: TSInstance, filePath: string): typescript.OutputFile[];
23//# sourceMappingURL=instances.d.ts.map
\No newline at end of file