1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { Config } from '@jest/types';
|
8 | import type { ModuleMap } from 'jest-haste-map';
|
9 | import type { ResolverConfig } from './types';
|
10 | import ModuleNotFoundError from './ModuleNotFoundError';
|
11 | declare type FindNodeModuleConfig = {
|
12 | basedir: Config.Path;
|
13 | browser?: boolean;
|
14 | extensions?: Array<string>;
|
15 | moduleDirectory?: Array<string>;
|
16 | paths?: Array<Config.Path>;
|
17 | resolver?: Config.Path | null;
|
18 | rootDir?: Config.Path;
|
19 | throwIfNotFound?: boolean;
|
20 | };
|
21 | declare type BooleanObject = Record<string, boolean>;
|
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 ModuleNotFoundError: typeof ModuleNotFoundError;
|
37 | static tryCastModuleNotFoundError(error: unknown): ModuleNotFoundError | null;
|
38 | static clearDefaultResolverCache(): void;
|
39 | static findNodeModule(path: Config.Path, options: FindNodeModuleConfig): Config.Path | null;
|
40 | resolveModuleFromDirIfExists(dirname: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path | null;
|
41 | resolveModule(from: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path;
|
42 | private _isAliasModule;
|
43 | isCoreModule(moduleName: string): boolean;
|
44 | getModule(name: string): Config.Path | null;
|
45 | getModulePath(from: Config.Path, moduleName: string): Config.Path;
|
46 | getPackage(name: string): Config.Path | null;
|
47 | getMockModule(from: Config.Path, name: string): Config.Path | null;
|
48 | getModulePaths(from: Config.Path): Array<Config.Path>;
|
49 | getModuleID(virtualMocks: BooleanObject, from: Config.Path, _moduleName?: string): string;
|
50 | private _getModuleType;
|
51 | private _getAbsolutePath;
|
52 | private _getMockPath;
|
53 | private _getVirtualMockPath;
|
54 | private _isModuleResolved;
|
55 | resolveStubModuleName(from: Config.Path, moduleName: string): Config.Path | null;
|
56 | }
|
57 | export = Resolver;
|
58 | //# sourceMappingURL=index.d.ts.map |
\ | No newline at end of file |