gen-jhipster
Version:
Spring Boot + Angular/React/Vue in one handy generator
66 lines (65 loc) • 3.42 kB
TypeScript
import type { JDLApplicationConfig } from './core/types/parsing.js';
/**
* Creates a new JDL importer from files.
* There are two ways to create an importer:
* - By providing an existing application content, if there's one
* - Deprecated: providing some application options
*
* @param {Array} files - the JDL files to parse.
* @param {Object} configuration - a configuration object.
* @param {Object} configuration.application - an existing application file content
* @param {String} configuration.applicationName - deprecated, the application's name, optional if parsing applications
* @param {String} configuration.applicationType - deprecated, the application type, optional if parsing applications
* @param {String} configuration.databaseType - deprecated, the database type, optional if parsing applications
* @returns {Object} a JDL importer.
* @throws {Error} if files aren't passed.
*/
export declare function createImporterFromFiles(files: any, configuration?: any, definition?: JDLApplicationConfig): {
/**
* Processes JDL files and converts them to JSON.
* @param {Object} logger - the logger to use, default to the console.
* @returns {object} the state of the process:
* - exportedDeployments: the exported deployments, or an empty list
* - exportedApplications: the exported applications, or an empty list
* - exportedEntities: the exported entities, or an empty list
*/
import: (logger?: Console) => ImportState;
};
/**
* Creates a new JDL importer from a JDL string content.
* There are two ways to create an importer:
* - By providing an existing application content, if there's one
* - Deprecated: providing some application options
*
* @param {String} jdlString - the JDL String content to parse.
* @param {Object} configuration - a configuration object.
* @param {Object} configuration.application - an existing application file content
* @param {String} configuration.applicationName - deprecated, the application's name, optional if parsing applications
* @param {String} configuration.applicationType - deprecated, the application type, optional if parsing applications
* @param {String} configuration.databaseType - deprecated, the database type, optional if parsing applications
* @param {Array} configuration.blueprints - the blueprints used.
* @returns {Object} a JDL importer.
* @throws {Error} if the content isn't passed.
*/
export declare function createImporterFromContent(jdlString: any, configuration?: any, definition?: JDLApplicationConfig): {
/**
* Processes JDL files and converts them to JSON.
* @param {Object} logger - the logger to use, default to the console.
* @returns {object} the state of the process:
* - exportedDeployments: the exported deployments, or an empty list
* - exportedApplications: the exported applications, or an empty list
* - exportedEntities: the exported entities, or an empty list
*/
import: (logger?: Console) => ImportState;
};
export type ApplicationWithEntities = {
config: any;
namespaceConfigs: Record<string, Record<string, any>>;
entities: any[];
};
export type ImportState = {
exportedApplications: any[];
exportedApplicationsWithEntities: Record<string, ApplicationWithEntities>;
exportedEntities: any[];
exportedDeployments: any[];
};