UNPKG

gen-jhipster

Version:

Spring Boot + Angular/React/Vue in one handy generator

73 lines (72 loc) 2.71 kB
import type { PrimaryKey } from '../../../lib/types/application/entity.js'; import type { FieldType } from '../../../lib/application/field-types.js'; import type { Field } from '../../../lib/types/application/field.js'; /** * @private * Filter the relevant relationships fields on the model * @param {Array|Object} relationships - array of relationships * @returns {Array|Object} filtered relationships */ export declare const filterRelevantRelationships: (relationships: any) => any; /** * @private * Generate Entity Client Imports * * @param {Array|Object} relationships - array of relationships * @param {string} dto - dto * @param {string} clientFramework the client framework, 'angular', 'vue' or 'react'. * @returns typeImports: Map */ export declare const generateEntityClientImports: (relationships: any, dto?: any, clientFramework?: any) => Map<any, any>; /** * @private * Generate Entity Client Enum Imports * * @param {Array|Object} fields - array of the entity fields * @param {string} clientFramework the client framework, 'angular' or 'react'. * @returns typeImports: Map */ export declare const generateEntityClientEnumImports: (fields: Field[], clientFramework: string) => Map<any, any>; /** * @private * Generate a primary key, according to the type */ export declare const generateTestEntityId: (primaryKey: FieldType | PrimaryKey, index?: 0 | 1 | "random", wrapped?: boolean) => string | number; /** * Generate a test entity, according to the type */ export declare const generateTsTestEntityForFields: (fields: Field[]) => Record<string, string | number | boolean>; export declare const stringifyTsEntity: (data: Record<string, any>, options?: { sep?: string; }) => string; /** * @private * @deprecated * Generate a test entity, according to the type * * @param references * @param {number} [index] - index of the primary key sample, pass undefined for a random key. */ export declare const generateTestEntity: (references: any, index?: 0 | 1 | "random") => { [k: string]: any; }; /** * @deprecated * Generate a test entity, according to the references * * @param references * @param additionalFields * @return {String} test sample */ export declare const generateTypescriptTestEntity: (references: any, additionalFields?: {}) => string; /** * @deprecated * Generate a test entity for the PK references (when the PK is a composite key) */ export declare const generateTestEntityPrimaryKey: (primaryKey: any, index: 0 | 1 | "random") => string; /** * @private * Get a parent folder path addition for entity * @param {string} clientRootFolder */ export declare const getEntityParentPathAddition: (clientRootFolder: string) => string;