From 395067213a53167e5fb6ea9b8276865e6573509a Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 4 Jan 2025 22:47:33 +0100 Subject: [PATCH] Clean code: remove unused type alias --- generators/java/types.d.ts | 2 -- lib/command/support/merge-union.d.ts | 2 -- lib/command/types.d.ts | 31 ---------------------------- lib/types/application/entity.d.ts | 2 -- 4 files changed, 37 deletions(-) diff --git a/generators/java/types.d.ts b/generators/java/types.d.ts index b869ddc9e321..6f5a45998412 100644 --- a/generators/java/types.d.ts +++ b/generators/java/types.d.ts @@ -4,11 +4,9 @@ import type { EditFileCallback } from '../base/api.js'; import type { MavenDefinition } from '../maven/types.js'; import type { ExportStoragePropertiesFromCommand } from '../../lib/command/index.js'; import type { JavaAnnotation } from './support/add-java-annotation.ts'; -import type { default as OpenapiGeneratorCommand } from './generators/openapi-generator/command.js'; import type { default as BootstrapCommand } from './generators/bootstrap/command.js'; type JavaBootstrapStorageProperties = ExportStoragePropertiesFromCommand; -type JavaOpenapiGeneratorStorageProperties = ExportStoragePropertiesFromCommand; export type JavaDependencyVersion = { name: string; diff --git a/lib/command/support/merge-union.d.ts b/lib/command/support/merge-union.d.ts index 3800e124cbc0..088bf834442c 100644 --- a/lib/command/support/merge-union.d.ts +++ b/lib/command/support/merge-union.d.ts @@ -7,8 +7,6 @@ type _MergeUnionKnownKeys = [T] extends [UnionToIntersection] ? false : true; - export type MergeUnion = IsNever extends false ? Simplify< diff --git a/lib/command/types.d.ts b/lib/command/types.d.ts index be90e67e8e23..06521bb7aeb1 100644 --- a/lib/command/types.d.ts +++ b/lib/command/types.d.ts @@ -130,8 +130,6 @@ type ParseableCommand = { /** Extract contructor return type, eg: Boolean, String */ type ConstructorReturn = T extends new () => infer R ? R : undefined; type FilteredConfigScope = ConfigScope | undefined; -/** Add name to Options/Configs */ -type TaggedParseableConfigUnion = D extends Record ? Simplify> : never; /** Filter Options/Config by scope */ type FilterScope = D extends Record<'scope', S> ? D : never; @@ -175,35 +173,6 @@ type NormalizeChoices; }; -/** - * @example - * ```ts - * type ExplodedCommandChoices = ExplodeCommandChoicesWithInference<{ clientFramework: { choices: ['angular', 'no'] }, clientTestFramework: { choices: ['cypress', 'no'] } }> - * { - * clientFramework: - * | { clientFrameworkAngular: true; clientFrameworkNo: false; clientFramework: 'angular'; clientFrameworkAny: true; }; - * | { clientFrameworkAngular: false; clientFrameworkNo: true; clientFramework: 'no'; clientFrameworkAny: false; } - * clientTestFramework: - * |{ clientTestFrameworkCypress: true; clientTestFrameworkNo: false; clientTestFramework: 'cypress'; clientTestFrameworkAny: true; }; - * |{ clientTestFrameworkCypress: false; clientTestFrameworkNo: true; clientTestFramework: 'no'; clientTestFrameworkAny: false; }; - * } - * ``` - */ -type DerivedPropertiesWithInferenceUnionFromParseableConfigs = { - [K in keyof U]: U[K] extends infer RequiredChoices - ? RequiredChoices extends { choices: JHipsterChoices } - ? K extends infer StringKey - ? StringKey extends string - ? NormalizeChoices extends infer NormalizedChoices - ? // @ts-expect-error Mapped typle type is loosy https://github.com/microsoft/TypeScript/issues/27995 - Simplify> - : never - : never - : never - : never - : never; -}; - /** * @example * ```ts diff --git a/lib/types/application/entity.d.ts b/lib/types/application/entity.d.ts index 8af049b96112..342f5a96d9c1 100644 --- a/lib/types/application/entity.d.ts +++ b/lib/types/application/entity.d.ts @@ -42,8 +42,6 @@ export type PrimaryKey = { javaSampleValues?: string[]; }; -type ClientSample = Record; - export interface Entity extends Omit>, 'relationships'>, ServerEntity,