1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import { Config } from '@jest/types';
|
8 | import { ModuleMap } from 'jest-haste-map';
|
9 | import { ResolverConfig } from './types';
|
10 | declare type FindNodeModuleConfig = {
|
11 | basedir: Config.Path;
|
12 | browser?: boolean;
|
13 | extensions?: Array<string>;
|
14 | moduleDirectory?: Array<string>;
|
15 | paths?: Array<Config.Path>;
|
16 | resolver?: Config.Path | null;
|
17 | rootDir?: Config.Path;
|
18 | };
|
19 | declare type BooleanObject = {
|
20 | [key: string]: boolean;
|
21 | };
|
22 | declare namespace Resolver {
|
23 | type ResolveModuleConfig = {
|
24 | skipNodeResolution?: boolean;
|
25 | paths?: Array<Config.Path>;
|
26 | };
|
27 | }
|
28 | declare class Resolver {
|
29 | private readonly _options;
|
30 | private readonly _moduleMap;
|
31 | private readonly _moduleIDCache;
|
32 | private readonly _moduleNameCache;
|
33 | private readonly _modulePathCache;
|
34 | private readonly _supportsNativePlatform;
|
35 | constructor(moduleMap: ModuleMap, options: ResolverConfig);
|
36 | static findNodeModule(path: Config.Path, options: FindNodeModuleConfig): Config.Path | null;
|
37 | resolveModuleFromDirIfExists(dirname: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path | null;
|
38 | resolveModule(from: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path;
|
39 | isCoreModule(moduleName: string): boolean;
|
40 | getModule(name: string): Config.Path | null;
|
41 | getModulePath(from: Config.Path, moduleName: string): string;
|
42 | getPackage(name: string): Config.Path | null;
|
43 | getMockModule(from: Config.Path, name: string): Config.Path | null;
|
44 | getModulePaths(from: Config.Path): Array<Config.Path>;
|
45 | getModuleID(virtualMocks: BooleanObject, from: Config.Path, _moduleName?: string): string;
|
46 | private _getModuleType;
|
47 | private _getAbsolutePath;
|
48 | private _getMockPath;
|
49 | private _getVirtualMockPath;
|
50 | private _isModuleResolved;
|
51 | resolveStubModuleName(from: Config.Path, moduleName: string): Config.Path | null;
|
52 | }
|
53 | export = Resolver;
|
54 | //# sourceMappingURL=index.d.ts.map |
\ | No newline at end of file |