liferay-npm-bundler-preset-reactjs
Version:
liferay npm bundler preset react
56 lines (55 loc) • 1.94 kB
TypeScript
/**
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
/**
* An object to describe the parts composing a module name.
* @see splitModuleName
*/
export interface ModuleNameParts {
/** Module file path relative to package root (starts with /) */
modulePath?: string;
/** Package name of module */
pkgName: string;
/** Scope of module (starts with at sign) */
scope?: string;
}
/**
* Test if a module name is local to current package.
* @param modulePath the module path
* @return true if module is local to current package
*/
export declare function isLocalModule(modulePath: string): boolean;
/**
* Test whether a module name is a Node.js core module
* @param modulePath the module path
* @return true if module is a Node.js core module
*/
export declare function isNodeCoreModule(modulePath: string): boolean;
/**
* Test whether a module name is a reserved AMD dependency
* @param modulePath the module path
* @return true if module is a reserved AMD dependency
*/
export declare function isReservedDependency(modulePath: string): boolean;
/**
* Test whether a module name is an external dependency
* @param modulePath the module path
* @return true if module is an external dependency
*/
export declare function isExternalDependency(modulePath: string): boolean;
/**
* Splits a module name into scope, package and module path parts.
* @param scope
* @param pkgName
* @param modulePath
* @retur a full module name
*/
export declare function joinModuleName(scope: string, pkgName: string, modulePath: string): string;
/**
* Splits a module name into scope, package and module path parts.
* @param moduleName a full module name
* @return {Object} a hash with scope (starts with at sign), pkgName and
* modulePath (starts with /)
*/
export declare function splitModuleName(moduleName: string): ModuleNameParts;