-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
50 lines (46 loc) · 1.24 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
type PkgType = import("@manypkg/get-packages").Package;
type PkgJsonType = PkgType["packageJson"];
type PartialPkgJsonType = Partial<PkgJsonType>;
interface InstallPkgReturnType {
pkgJson: PartialPkgJsonType;
}
interface InstallParamsType {
/**
* working directory, defaults to process.cwd()
*/
cwd?: string;
/**
* path to package.json, defaults to ./package.json
*/
source?: string;
/**
* path to node_modules, defaults to ./dist
*/
dist?: string;
/**
* install command, defaults to "npm install --omit=dev --prefer-offline --no-audit --no-fund"
*/
command?: string;
/**
* install command, defaults to `${process.env.HOME}/.cache`
*/
cacheDir?: string;
/**
* output package.json file
*/
outputJson?: boolean | string;
/**
* can modify package.json before install
*/
generateJson?: (pkgJson: PartialPkgJsonType) => any;
/**
* trigger after emit package.json, before npm install
*
* just in async mode
*/
onBeforeInstall?: (params: InstallPkgReturnType) => any;
}
declare module "@unmonorepo/pkg" {
export function installPkg(params?: InstallParamsType): Promise<InstallPkgReturnType>;
export function installPkgSync(params?: InstallParamsType): InstallPkgReturnType;
}