1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { Config } from '@jest/types';
|
8 | import type { DuplicatesSet, HTypeValue, IModuleMap, RawModuleMap, SerializableModuleMap } from './types';
|
9 | export default class ModuleMap implements IModuleMap<SerializableModuleMap> {
|
10 | static DuplicateHasteCandidatesError: typeof DuplicateHasteCandidatesError;
|
11 | private readonly _raw;
|
12 | private json;
|
13 | private static mapToArrayRecursive;
|
14 | private static mapFromArrayRecursive;
|
15 | constructor(raw: RawModuleMap);
|
16 | getModule(name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null): Config.Path | null;
|
17 | getPackage(name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | null): Config.Path | null;
|
18 | getMockModule(name: string): Config.Path | undefined;
|
19 | getRawModuleMap(): RawModuleMap;
|
20 | toJSON(): SerializableModuleMap;
|
21 | static fromJSON(serializableModuleMap: SerializableModuleMap): ModuleMap;
|
22 | /**
|
23 | * When looking up a module's data, we walk through each eligible platform for
|
24 | * the query. For each platform, we want to check if there are known
|
25 | * duplicates for that name+platform pair. The duplication logic normally
|
26 | * removes elements from the `map` object, but we want to check upfront to be
|
27 | * extra sure. If metadata exists both in the `duplicates` object and the
|
28 | * `map`, this would be a bug.
|
29 | */
|
30 | private _getModuleMetadata;
|
31 | private _assertNoDuplicates;
|
32 | static create(rootDir: Config.Path): ModuleMap;
|
33 | }
|
34 | declare class DuplicateHasteCandidatesError extends Error {
|
35 | hasteName: string;
|
36 | platform: string | null;
|
37 | supportsNativePlatform: boolean;
|
38 | duplicatesSet: DuplicatesSet;
|
39 | constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet);
|
40 | }
|
41 | export {};
|