UNPKG

liferay-npm-bundler-preset-reactjs

Version:

liferay npm bundler preset react

53 lines (52 loc) 1.67 kB
/** * SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com> * SPDX-License-Identifier: LGPL-3.0-or-later */ import { ModuleFlags, Package } from './api/manifest'; import PkgDesc from './pkg-desc'; export { ModuleFlags, Package }; /** * A class to hold information about processed modules and optionally dump/read * it to/from disk. */ export default class Manifest { /** * @param filePath an optional path to a file to load initial status */ constructor(filePath?: string); /** * Set to true when the manifest has been loaded from a file. */ get loadedFromFile(): boolean; /** * Add a processed package entry * @param srcPkg the source package descriptor * @param destPkg the destination package descriptor */ addPackage(srcPkg: PkgDesc, destPkg: PkgDesc): void; addModuleFlags(pkgId: string, moduleName: string, flags: ModuleFlags): void; /** * Get a processed package entry * @param srcPkg the source package descriptor * @return the processed package entry (see addPackage for format description) */ getPackage(srcPkg: PkgDesc): Package; /** * Tests whether a package must be regenerated * @param destPkg destination package * @return true if package is outdated */ isOutdated(destPkg: PkgDesc): boolean; /** * Save current manifest to a file * @param filePath path to file or null to use default path */ save(filePath?: string): void; /** * Return the JSON serialization of this manifest */ toJSON(): string; private _loadedFromFile; private _filePath; private _data; }