index.d.ts 856 B

1234567891011121314151617181920212223242526272829
  1. export * from './dist/shared'
  2. export interface PackageInfo {
  3. name: string
  4. rootPath: string
  5. packageJsonPath: string
  6. version: string
  7. packageJson: {
  8. name: string
  9. version: string
  10. dependencies?: Record<string, string>
  11. devDependencies?: Record<string, string>
  12. [key: string]: any
  13. }
  14. }
  15. export interface PackageResolvingOptions {
  16. paths?: string[]
  17. }
  18. export function isPackageExists(name: string, options?: PackageResolvingOptions): boolean
  19. export function getPackageInfo(name: string, options?: PackageResolvingOptions): Promise<PackageInfo | undefined>
  20. export function getPackageInfoSync(name: string, options?: PackageResolvingOptions): PackageInfo | undefined
  21. export function resolveModule(path: string, options?: PackageResolvingOptions): string | undefined
  22. export function importModule<T = any>(path: string): Promise<T>