UNPKG

1.26 kBTypeScriptView Raw
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7import type {default as default_2} from 'jest-resolve';
8import type {IHasteFS} from 'jest-haste-map';
9import type {ResolveModuleConfig} from 'jest-resolve';
10import {SnapshotResolver} from 'jest-snapshot';
11
12/**
13 * DependencyResolver is used to resolve the direct dependencies of a module or
14 * to retrieve a list of all transitive inverse dependencies.
15 */
16export declare class DependencyResolver {
17 private readonly _hasteFS;
18 private readonly _resolver;
19 private readonly _snapshotResolver;
20 constructor(
21 resolver: default_2,
22 hasteFS: IHasteFS,
23 snapshotResolver: SnapshotResolver,
24 );
25 resolve(file: string, options?: ResolveModuleConfig): Array<string>;
26 resolveInverseModuleMap(
27 paths: Set<string>,
28 filter: (file: string) => boolean,
29 options?: ResolveModuleConfig,
30 ): Array<ResolvedModule>;
31 resolveInverse(
32 paths: Set<string>,
33 filter: (file: string) => boolean,
34 options?: ResolveModuleConfig,
35 ): Array<string>;
36}
37
38export declare type ResolvedModule = {
39 file: string;
40 dependencies: Array<string>;
41};
42
43export {};