index.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031
  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 { Config } from '@jest/types';
  8. import { FS as HasteFS } from 'jest-haste-map';
  9. import Resolver from 'jest-resolve';
  10. import { SnapshotResolver } from 'jest-snapshot';
  11. declare namespace DependencyResolver {
  12. type ResolvedModule = {
  13. file: Config.Path;
  14. dependencies: Array<Config.Path>;
  15. };
  16. }
  17. /**
  18. * DependencyResolver is used to resolve the direct dependencies of a module or
  19. * to retrieve a list of all transitive inverse dependencies.
  20. */
  21. declare class DependencyResolver {
  22. private _hasteFS;
  23. private _resolver;
  24. private _snapshotResolver;
  25. constructor(resolver: Resolver, hasteFS: HasteFS, snapshotResolver: SnapshotResolver);
  26. resolve(file: Config.Path, options?: Resolver.ResolveModuleConfig): Array<Config.Path>;
  27. resolveInverseModuleMap(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array<DependencyResolver.ResolvedModule>;
  28. resolveInverse(paths: Set<Config.Path>, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array<Config.Path>;
  29. }
  30. export = DependencyResolver;
  31. //# sourceMappingURL=index.d.ts.map