UNPKG

2.21 kBTypeScriptView Raw
1import { Chalk } from 'chalk';
2import * as typescript from 'typescript';
3import { FilePathKey, LoaderOptions, ResolvedModule, ReverseDependencyGraph, TSInstance, WebpackError, WebpackModule } from './interfaces';
4/**
5 * Take TypeScript errors, parse them and format to webpack errors
6 * Optionally adds a file name
7 */
8export declare function formatErrors(diagnostics: ReadonlyArray<typescript.Diagnostic> | undefined, loaderOptions: LoaderOptions, colors: Chalk, compiler: typeof typescript, merge: {
9 file?: string;
10 module?: WebpackModule;
11}, context: string): WebpackError[];
12export declare function fsReadFile(fileName: string, encoding?: string | undefined): string | undefined;
13export declare function makeError(message: string, file: string | undefined, location?: {
14 line: number;
15 character: number;
16}): WebpackError;
17export declare function appendSuffixIfMatch(patterns: (RegExp | string)[], filePath: string, suffix: string): string;
18export declare function appendSuffixesIfMatch(suffixDict: {
19 [suffix: string]: (RegExp | string)[];
20}, filePath: string): string;
21export declare function unorderedRemoveItem<T>(array: T[], item: T): boolean;
22export declare function populateDependencyGraph(resolvedModules: ResolvedModule[], instance: TSInstance, containingFile: string): void;
23export declare function populateReverseDependencyGraph(instance: TSInstance): ReverseDependencyGraph;
24/**
25 * Recursively collect all possible dependants of passed file
26 */
27export declare function collectAllDependants(reverseDependencyGraph: ReverseDependencyGraph, fileName: FilePathKey, result?: Map<FilePathKey, true>): Map<FilePathKey, true>;
28export declare function arrify<T>(val: T | T[]): T[];
29export declare function ensureTrailingDirectorySeparator<T extends string>(dir: T): T;
30export declare function ensureProgram(instance: TSInstance): typescript.Program | undefined;
31export declare function supportsSolutionBuild(instance: TSInstance): boolean;
32export declare function isReferencedFile(instance: TSInstance, filePath: string): boolean;
33export declare function useCaseSensitiveFileNames(compiler: typeof typescript, loaderOptions: LoaderOptions): boolean;
34//# sourceMappingURL=utils.d.ts.map
\No newline at end of file