index.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. */
  7. import type {default as default_2} from 'jest-resolve';
  8. import type {IHasteFS} from 'jest-haste-map';
  9. import type {ResolveModuleConfig} from 'jest-resolve';
  10. import {SnapshotResolver} from 'jest-snapshot';
  11. /**
  12. * DependencyResolver is used to resolve the direct dependencies of a module or
  13. * to retrieve a list of all transitive inverse dependencies.
  14. */
  15. export declare class DependencyResolver {
  16. private readonly _hasteFS;
  17. private readonly _resolver;
  18. private readonly _snapshotResolver;
  19. constructor(
  20. resolver: default_2,
  21. hasteFS: IHasteFS,
  22. snapshotResolver: SnapshotResolver,
  23. );
  24. resolve(file: string, options?: ResolveModuleConfig): Array<string>;
  25. resolveInverseModuleMap(
  26. paths: Set<string>,
  27. filter: (file: string) => boolean,
  28. options?: ResolveModuleConfig,
  29. ): Array<ResolvedModule>;
  30. resolveInverse(
  31. paths: Set<string>,
  32. filter: (file: string) => boolean,
  33. options?: ResolveModuleConfig,
  34. ): Array<string>;
  35. }
  36. export declare type ResolvedModule = {
  37. file: string;
  38. dependencies: Array<string>;
  39. };
  40. export {};