gen-jhipster
Version:
VHipster - Spring Boot + Angular/React/Vue in one handy generator
44 lines (43 loc) • 2.02 kB
TypeScript
import type { FieldType } from '../../../lib/jhipster/field-types.ts';
import type { Field as BaseApplicationField, PrimaryKey, Relationship as BaseApplicationRelationship, RelationshipWithEntity } from '../../base-application/types.ts';
import type { Entity as ClientEntity, Field as ClientField, Relationship as ClientRelationship } from '../types.ts';
/**
* @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: <const R extends BaseApplicationRelationship>(relationships: R[]) => R[];
/**
* @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: RelationshipWithEntity<ClientRelationship, ClientEntity>[], _dto?: string, clientFramework?: string) => Map<string, string>;
/**
* @private
* Generate Entity Client Enum Imports
*/
export declare const generateEntityClientEnumImports: (fields: BaseApplicationField[], clientFramework: string) => Map<string, string>;
/**
* @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: ClientField[]) => 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
*/
export declare const generateTestEntity: (fields: BaseApplicationField[], index?: 0 | 1 | "random") => any;