UNPKG

@liferay/generator-js

Version:

Yeoman generators for Liferay DXP and Portal CE JavaScript projects.

91 lines (90 loc) 2.99 kB
/** * SPDX-FileCopyrightText: © 2017 Liferay, Inc. <https://liferay.com> * SPDX-License-Identifier: LGPL-3.0-or-later */ export interface FormattedLabels { js: object; jsx: object; quoted: object; raw: object; template: object; } /** * A class to help copying Yeoman templates. */ export declare class Copier { /** * @param {Generator} generator a Yeoman generator */ constructor(generator: any); /** * Instantiate a Yeoman template file. * @param {String} src path to template * @param {Object} context optional context object to use when * instantiating the template (defaults to {}) * @param {String} dest optional destination name (defaults to src) */ copyFile(src: any, { context, dest }?: { context?: {}; dest?: any; }): void; /** * Instantiate all Yeoman template files found in a directory tree. * @param {String} src path to template * @param {Object} context optional context object to use when * instantiating the template (defaults to {}) */ copyDir(src: any, { context }?: { context?: {}; }): void; private _generator; } /** * Format label values according to different formats. * @param {object} labels * @return {object} returns an object with labels transformed according to * different formats: 'raw', 'quoted', 'template', 'js' */ export declare function formatLabels(labels: any): FormattedLabels; /** * Get the portlet name. * @param {ProjectAnalyzer} projectAnalyzer * @return {string} */ export declare function getPortletName(projectAnalyzer: any): string; /** * Get the semver constraints for a SDK package based on user's * .generator-liferay-js.json file and running SDK version. * @param {string} packageName * @param {boolean} ignoreConfig return the true SDK version */ export declare function getSDKVersion(packageName: any, { ignoreConfig }?: { ignoreConfig?: boolean; }): string; /** * Convert key from camel case to hyphens. * @param {string} key * @return {string} */ export declare function hyphenate(key: any): string; /** * A function to process prompts as specified in the configuration file. * @param {Generator} generator a Yeoman generator * @param {string} namespace the generator namespace as defined in * config.getDefaultAnswer() * @param {Array} prompts a Yeoman prompts array * @return {object} the set of answers */ export declare function promptWithConfig(generator: any, namespace: any, prompts?: any): Promise<object>; /** * Converts a technical string to human readable form. * @param {string} string string to capitalize * @return {string} */ export declare function toHumanReadable(string: any): string; /** * Check if a given directory path contains a valid Liferay installation. * @param {String} input directory path * @return {boolean|string} */ export declare function validateLiferayDir(input: any): string | boolean;