Walker.d.ts 877 B

123456789101112131415161718192021222324252627282930313233
  1. import { DepType } from './depTypes';
  2. export declare type VersionRange = string;
  3. export interface PackageJSON {
  4. name: string;
  5. dependencies: {
  6. [name: string]: VersionRange;
  7. };
  8. devDependencies: {
  9. [name: string]: VersionRange;
  10. };
  11. optionalDependencies: {
  12. [name: string]: VersionRange;
  13. };
  14. }
  15. export interface Module {
  16. path: string;
  17. depType: DepType;
  18. name: string;
  19. }
  20. export declare class Walker {
  21. private rootModule;
  22. private modules;
  23. private walkHistory;
  24. constructor(modulePath: string);
  25. private relativeModule(rootPath, moduleName);
  26. private loadPackageJSON(modulePath);
  27. private walkDependenciesForModuleInModule(moduleName, modulePath, depType);
  28. private walkDependenciesForModule(modulePath, depType);
  29. private cache;
  30. walkTree(): Promise<Module[]>;
  31. getRootModule(): string;
  32. }