index.d.ts 1.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/**
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
import type { Config } from '@jest/types';
import type { FS as HasteFS } from 'jest-haste-map';
import Resolver = require('jest-resolve');
import { SnapshotResolver } from 'jest-snapshot';
declare namespace DependencyResolver {
    type ResolvedModule = {
        file: Config.Path;
        dependencies: Array<Config.Path>;
    };
}
/**
 * DependencyResolver is used to resolve the direct dependencies of a module or
 * to retrieve a list of all transitive inverse dependencies.
 */
declare class DependencyResolver {
    private _hasteFS;
    private _resolver;
    private _snapshotResolver;
    constructor(resolver: Resolver, hasteFS: HasteFS, snapshotResolver: SnapshotResolver);
    resolve(file: Config.Path, options?: Resolver.ResolveModuleConfig): Array<Config.Path>;
    resolveInverseModuleMap(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array<DependencyResolver.ResolvedModule>;
    resolveInverse(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array<Config.Path>;
}
export = DependencyResolver;