UNPKG

816 BTypeScriptView Raw
1import { MappingEntry } from "./mapping-entry";
2export interface TryPath {
3 readonly type: "file" | "extension" | "index" | "package";
4 readonly path: string;
5}
6/**
7 * Builds a list of all physical paths to try by:
8 * 1. Check for file named exactly as request.
9 * 2. Check for files named as request ending in any of the extensions.
10 * 3. Check for file specified in package.json's main property.
11 * 4. Check for files named as request ending in "index" with any of the extensions.
12 */
13export declare function getPathsToTry(extensions: ReadonlyArray<string>, absolutePathMappings: ReadonlyArray<MappingEntry>, requestedModule: string): ReadonlyArray<TryPath> | undefined;
14export declare function getStrippedPath(tryPath: TryPath): string;
15export declare function exhaustiveTypeException(check: never): never;