UNPKG

1.8 kBTypeScriptView Raw
1/**
2 * Ensure the integrity of a package.
3 *
4 * @param options - The options used to ensure the package.
5 *
6 * @returns A list of changes that were made to ensure the package.
7 */
8export declare function ensurePackage(options: IEnsurePackageOptions): Promise<string[]>;
9/**
10 * An extra ensure function just for the @jupyterlab/ui-components package.
11 * Ensures that the icon svg import statements are synced with the contents
12 * of ui-components/style/icons.
13 *
14 * @param pkgPath - The path to the @jupyterlab/ui-components package.
15 * @param dorequire - If true, use `require` function in place of `import`
16 * statements when loading the icon svg files
17 *
18 * @returns A list of changes that were made to ensure the package.
19 */
20export declare function ensureUiComponents(pkgPath: string, dorequire?: boolean): Promise<string[]>;
21/**
22 * The options used to ensure a package.
23 */
24export interface IEnsurePackageOptions {
25 /**
26 * The path to the package.
27 */
28 pkgPath: string;
29 /**
30 * The package data.
31 */
32 data: any;
33 /**
34 * The cache of dependency versions by package.
35 */
36 depCache?: {
37 [key: string]: string;
38 };
39 /**
40 * A list of dependencies that can be unused.
41 */
42 unused?: string[];
43 /**
44 * A list of dependencies that can be missing.
45 */
46 missing?: string[];
47 /**
48 * A map of local package names and their relative path.
49 */
50 locals?: {
51 [key: string]: string;
52 };
53 /**
54 * Whether to enforce that dependencies get used. Default is true.
55 */
56 noUnused?: boolean;
57 /**
58 * The css import list for the package.
59 */
60 cssImports?: string[];
61 /**
62 * Packages which are allowed to have multiple versions pulled in
63 */
64 differentVersions?: string[];
65}