UNPKG

3.39 kBTypeScriptView Raw
1import DuplicatePackageCheckerPlugin from 'duplicate-package-checker-webpack-plugin';
2import * as webpack from 'webpack';
3import { LicenseWebpackPlugin } from 'license-webpack-plugin';
4import { LicenseIdentifiedModule } from 'license-webpack-plugin/dist/LicenseIdentifiedModule';
5import { PluginOptions } from 'license-webpack-plugin/dist/PluginOptions';
6export declare namespace WPPlugin {
7 /**
8 * A WebPack Plugin that copies the assets to the static directory
9 */
10 class FrontEndPlugin {
11 constructor(buildDir: string, staticDir: string);
12 apply(compiler: webpack.Compiler): void;
13 buildDir: string;
14 staticDir: string;
15 private _first;
16 }
17 /**
18 * A WebPack Plugin that ignores files files that are filtered
19 * by a callback during a `--watch` build
20 */
21 class FilterWatchIgnorePlugin {
22 constructor(ignored: (path: string) => boolean);
23 apply(compiler: webpack.Compiler): void;
24 ignored: (path: string) => boolean;
25 }
26 class NowatchDuplicatePackageCheckerPlugin extends DuplicatePackageCheckerPlugin {
27 apply(compiler: webpack.Compiler): void;
28 options: DuplicatePackageCheckerPlugin.Options;
29 }
30 /**
31 * A top-level report of the licenses for all code included in a bundle
32 *
33 * ### Note
34 *
35 * This is roughly informed by the terms defined in the SPDX spec, though is not
36 * an SPDX Document, since there seem to be several (incompatible) specs
37 * in that repo.
38 *
39 * @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
40 **/
41 interface ILicenseReport {
42 packages: IPackageLicenseInfo[];
43 }
44 /**
45 * A best-effort single bundled package's information.
46 *
47 * ### Note
48 *
49 * This is roughly informed by SPDX `packages` and `hasExtractedLicenseInfos`,
50 * as making it conformant would vastly complicate the structure.
51 *
52 * @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
53 **/
54 interface IPackageLicenseInfo {
55 /** the name of the package as it appears in node_modules */
56 name: string;
57 /** the version of the package, or an empty string if unknown */
58 versionInfo: string;
59 /** an SPDX license or LicenseRef, or an empty string if unknown */
60 licenseId: string;
61 /** the verbatim extracted text of the license, or an empty string if unknown */
62 extractedText: string;
63 }
64 /**
65 * A well-known filename for third-party license information.
66 *
67 * ### Note
68 * If an alternate JupyterLab-based ecosystem wanted to implement a different
69 * name, they may _still_ need to handle the presence of this file if reusing
70 * any core files or extensions.
71 *
72 * If multiple files are found by `jupyterlab_server, their `packages` will
73 * be concatenated.
74 */
75 const DEFAULT_LICENSE_REPORT_FILENAME = "third-party-licenses.json";
76 /**
77 * a plugin that creates a predictable, machine-readable report of licenses for
78 * all modules included in this build
79 */
80 class JSONLicenseWebpackPlugin extends LicenseWebpackPlugin {
81 constructor(pluginOptions?: PluginOptions);
82 /** render an SPDX-like record */
83 renderLicensesJSON(modules: LicenseIdentifiedModule[]): string;
84 }
85}