UNPKG

1.26 kBTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
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 { Config } from '@jest/types';
8import type { FS as HasteFS } from 'jest-haste-map';
9import type { ResolveModuleConfig, default as Resolver } from 'jest-resolve';
10import { SnapshotResolver } from 'jest-snapshot';
11export declare type ResolvedModule = {
12 file: Config.Path;
13 dependencies: Array<Config.Path>;
14};
15/**
16 * DependencyResolver is used to resolve the direct dependencies of a module or
17 * to retrieve a list of all transitive inverse dependencies.
18 */
19export declare class DependencyResolver {
20 private _hasteFS;
21 private _resolver;
22 private _snapshotResolver;
23 constructor(resolver: Resolver, hasteFS: HasteFS, snapshotResolver: SnapshotResolver);
24 resolve(file: Config.Path, options?: ResolveModuleConfig): Array<Config.Path>;
25 resolveInverseModuleMap(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: ResolveModuleConfig): Array<ResolvedModule>;
26 resolveInverse(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: ResolveModuleConfig): Array<Config.Path>;
27}