index.d.ts 1.2 KB

123456789101112131415161718192021222324252627
  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. */
  7. import type { Config } from '@jest/types';
  8. import type { FS as HasteFS } from 'jest-haste-map';
  9. import type { ResolveModuleConfig, default as Resolver } from 'jest-resolve';
  10. import { SnapshotResolver } from 'jest-snapshot';
  11. export 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. */
  19. export 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. }