UNPKG

3.19 kBTypeScriptView Raw
1import * as webpack from 'webpack';
2/**
3 * A namespace for JupyterLab build utilities.
4 */
5export declare namespace Build {
6 /**
7 * The options used to ensure a root package has the appropriate
8 * assets for its JupyterLab extension packages.
9 */
10 interface IEnsureOptions {
11 /**
12 * The output directory where the build assets should reside.
13 */
14 output: string;
15 /**
16 * The directory for the schema directory, defaults to the output directory.
17 */
18 schemaOutput?: string;
19 /**
20 * The directory for the theme directory, defaults to the output directory
21 */
22 themeOutput?: string;
23 /**
24 * The names of the packages to ensure.
25 */
26 packageNames: ReadonlyArray<string>;
27 /**
28 * The package paths to ensure.
29 */
30 packagePaths?: ReadonlyArray<string>;
31 }
32 /**
33 * The JupyterLab extension attributes in a module.
34 */
35 interface ILabExtension {
36 /**
37 * Indicates whether the extension is a standalone extension.
38 *
39 * #### Notes
40 * If `true`, the `main` export of the package is used. If set to a string
41 * path, the export from that path is loaded as a JupyterLab extension. It
42 * is possible for one package to have both an `extension` and a
43 * `mimeExtension` but they cannot be identical (i.e., the same export
44 * cannot be declared both an `extension` and a `mimeExtension`).
45 */
46 readonly extension?: boolean | string;
47 /**
48 * Indicates whether the extension is a MIME renderer extension.
49 *
50 * #### Notes
51 * If `true`, the `main` export of the package is used. If set to a string
52 * path, the export from that path is loaded as a JupyterLab extension. It
53 * is possible for one package to have both an `extension` and a
54 * `mimeExtension` but they cannot be identical (i.e., the same export
55 * cannot be declared both an `extension` and a `mimeExtension`).
56 */
57 readonly mimeExtension?: boolean | string;
58 /**
59 * The local schema file path in the extension package.
60 */
61 readonly schemaDir?: string;
62 /**
63 * The local theme file path in the extension package.
64 */
65 readonly themePath?: string;
66 }
67 /**
68 * A minimal definition of a module's package definition (i.e., package.json).
69 */
70 interface IModule {
71 /**
72 * The JupyterLab metadata/
73 */
74 jupyterlab?: ILabExtension;
75 /**
76 * The main entry point in a module.
77 */
78 main?: string;
79 /**
80 * The name of a module.
81 */
82 name: string;
83 }
84 /**
85 * Ensures that the assets of plugin packages are populated for a build.
86 *
87 * @ Returns An array of lab extension config data.
88 */
89 function ensureAssets(options: IEnsureOptions): webpack.Configuration[];
90 /**
91 * Returns JupyterLab extension metadata from a module.
92 */
93 function normalizeExtension(module: IModule): ILabExtension;
94}