-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
29 lines (22 loc) · 856 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export * from './dist/shared'
export interface PackageInfo {
name: string
rootPath: string
packageJsonPath: string
version: string
packageJson: {
name: string
version: string
dependencies?: Record<string, string>
devDependencies?: Record<string, string>
[key: string]: any
}
}
export interface PackageResolvingOptions {
paths?: string[]
}
export function isPackageExists(name: string, options?: PackageResolvingOptions): boolean
export function getPackageInfo(name: string, options?: PackageResolvingOptions): Promise<PackageInfo | undefined>
export function getPackageInfoSync(name: string, options?: PackageResolvingOptions): PackageInfo | undefined
export function resolveModule(path: string, options?: PackageResolvingOptions): string | undefined
export function importModule<T = any>(path: string): Promise<T>