From: =?utf-8?q?Bastien_Roucari=C3=A8s?= Date: Sat, 7 Mar 2026 22:29:12 +0100 Subject: Import types from jupyter origin: https://sources.debian.org/src/jupyterlab/4.0.11%2Bds1%2B~cs11.25.27-9/builder/src/duplicate-package-checker-webpack-plugin.d.ts License: BSD-3-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- .../index.d.ts | 82 ++++++++++++++-------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/types-duplicate-package-checker-webpack-plugin/index.d.ts b/types-duplicate-package-checker-webpack-plugin/index.d.ts index e13703e..897d28d 100644 --- a/types-duplicate-package-checker-webpack-plugin/index.d.ts +++ b/types-duplicate-package-checker-webpack-plugin/index.d.ts @@ -1,42 +1,64 @@ -import { Plugin } from "webpack"; +/* + * Copyright (c) Jupyter Development Team. + * Distributed under the terms of the Modified BSD License. + */ -export = DuplicatePackageCheckerWebpackPlugin; +// Type definitions for duplicate-package-checker-webpack-plugin 2.1 +// Project: https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#readme +// Definitions by: Matt Traynham +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -declare class DuplicatePackageCheckerWebpackPlugin extends Plugin { +// Modified to work with Webpack 5 typings by Jason Grout + +/* eslint-disable @typescript-eslint/naming-convention */ + +// Once to get a typed module first. +declare module 'duplicate-package-checker-webpack-plugin'; + +// Then we expand the definition with the things we use. +declare module 'duplicate-package-checker-webpack-plugin' { + import * as webpack from 'webpack'; + + export = DuplicatePackageCheckerWebpackPlugin; + + class DuplicatePackageCheckerWebpackPlugin { constructor(options?: DuplicatePackageCheckerWebpackPlugin.Options); -} + apply(compiler: webpack.Compiler): void; + } -declare namespace DuplicatePackageCheckerWebpackPlugin { + namespace DuplicatePackageCheckerWebpackPlugin { /** The properties of the instance of a package */ interface PackageInstanceProperties { - /** The name of the package */ - name: string; - /** The version of the package */ - version: string; - /** Absolute path to the package */ - path: string; - /** Absolute path to the module that requested the package */ - issuer?: string | undefined; + /** The name of the package */ + name: string; + /** The version of the package */ + version: string; + /** Absolute path to the package */ + path: string; + /** Absolute path to the module that requested the package */ + issuer?: string; } /** The configurable options for the plugin */ interface Options { - /** Also show module that is requiring each duplicate package (default: false) */ - verbose?: boolean | undefined; - /** Emit errors instead of warnings (default: false) */ - emitError?: boolean | undefined; - /** Show help message if duplicate packages are found (default: true) */ - showHelp?: boolean | undefined; - /** Warn also if major versions differ (default: true) */ - strict?: boolean | undefined; - - /** - * Exclude instances of packages from the results. - * If all instances of a package are excluded, or all instances except one, - * then the package is no longer considered duplicated and won't be emitted as a warning/error. - * @param instance The instance of a package being evaluated for exclusion. - * @returns true to exclude the instance, false otherwise - */ - exclude?: ((instance: PackageInstanceProperties) => boolean) | undefined; + /** Also show module that is requiring each duplicate package (default: false) */ + verbose?: boolean; + /** Emit errors instead of warnings (default: false) */ + emitError?: boolean; + /** Show help message if duplicate packages are found (default: true) */ + showHelp?: boolean; + /** Warn also if major versions differ (default: true) */ + strict?: boolean; + + /** + * Exclude instances of packages from the results. + * If all instances of a package are excluded, or all instances except one, + * then the package is no longer considered duplicated and won't be emitted as a warning/error. + * @param instance The instance of a package being evaluated for exclusion. + * @returns true to exclude the instance, false otherwise + */ + exclude?: (instance: PackageInstanceProperties) => boolean; } + } }