instances.d.ts 2.0 KB

123456789101112131415161718192021222324
  1. import type * as typescript from 'typescript';
  2. import * as webpack from 'webpack';
  3. import type { LoaderOptions, TSInstance } 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. */
  11. export declare function getTypeScriptInstance(loaderOptions: LoaderOptions, loader: webpack.LoaderContext<LoaderOptions>): {
  12. instance?: TSInstance;
  13. error?: webpack.WebpackError;
  14. };
  15. export declare function initializeInstance(loader: webpack.LoaderContext<LoaderOptions>, instance: TSInstance): void;
  16. export declare function getCustomTransformers(loaderOptions: LoaderOptions, program: typescript.Program | undefined, getProgram: (() => typescript.Program | undefined) | undefined): any;
  17. export declare function reportTranspileErrors(instance: TSInstance, loader: webpack.LoaderContext<LoaderOptions>): void;
  18. export declare function buildSolutionReferences(instance: TSInstance, loader: webpack.LoaderContext<LoaderOptions>): void;
  19. export declare function forEachResolvedProjectReference<T>(resolvedProjectReferences: readonly (typescript.ResolvedProjectReference | undefined)[] | undefined, cb: (resolvedProjectReference: typescript.ResolvedProjectReference) => T | undefined): T | undefined;
  20. export declare function getOutputFileNames(instance: TSInstance, configFile: typescript.ParsedCommandLine, inputFileName: string): string[];
  21. export declare function getInputFileNameFromOutput(instance: TSInstance, filePath: string): string | undefined;
  22. export declare function getEmitFromWatchHost(instance: TSInstance, filePath?: string): typescript.OutputFile[] | undefined;
  23. export declare function getEmitOutput(instance: TSInstance, filePath: string): typescript.OutputFile[];
  24. //# sourceMappingURL=instances.d.ts.map