Skip to content

Commit

Permalink
Clean code: remove unused type alias
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert committed Jan 4, 2025
1 parent 5987941 commit 3950672
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
2 changes: 0 additions & 2 deletions generators/java/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof BootstrapCommand>;
type JavaOpenapiGeneratorStorageProperties = ExportStoragePropertiesFromCommand<typeof OpenapiGeneratorCommand>;

export type JavaDependencyVersion = {
name: string;
Expand Down
2 changes: 0 additions & 2 deletions lib/command/support/merge-union.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ type _MergeUnionKnownKeys<BaseType, Keys extends keyof BaseType = keyof BaseType
[K in Keys]: Keys extends K ? BaseType[Keys] : never;
};

type IsUnion<T> = [T] extends [UnionToIntersection<T>] ? false : true;

export type MergeUnion<BaseType> =
IsNever<BaseType> extends false
? Simplify<
Expand Down
31 changes: 0 additions & 31 deletions lib/command/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ type ParseableCommand = {
/** Extract contructor return type, eg: Boolean, String */
type ConstructorReturn<T> = T extends new () => infer R ? R : undefined;
type FilteredConfigScope = ConfigScope | undefined;
/** Add name to Options/Configs */
type TaggedParseableConfigUnion<D> = D extends Record<string, any> ? Simplify<TaggedUnion<'name', D>> : never;

/** Filter Options/Config by scope */
type FilterScope<D extends ParseableConfig, S extends FilteredConfigScope> = D extends Record<'scope', S> ? D : never;
Expand Down Expand Up @@ -175,35 +173,6 @@ type NormalizeChoices<Choices extends readonly [...(string | { value: string })[
[Index in keyof Choices]: GetChoiceValue<Choices[Index]>;
};

/**
* @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<U extends ParseableConfigs> = {
[K in keyof U]: U[K] extends infer RequiredChoices
? RequiredChoices extends { choices: JHipsterChoices }
? K extends infer StringKey
? StringKey extends string
? NormalizeChoices<RequiredChoices['choices']> extends infer NormalizedChoices
? // @ts-expect-error Mapped typle type is loosy https://github.com/microsoft/TypeScript/issues/27995
Simplify<DerivedPropertiesWithInferenceUnion<NormalizedChoices, StringKey>>
: never
: never
: never
: never
: never;
};

/**
* @example
* ```ts
Expand Down
2 changes: 0 additions & 2 deletions lib/types/application/entity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export type PrimaryKey<F extends BaseField = Field> = {
javaSampleValues?: string[];
};

type ClientSample = Record<string, string | number | boolean | null>;

export interface Entity<F extends BaseField = Field, R extends BaseRelationship = never>
extends Omit<Required<BaseEntity<F>>, 'relationships'>,
ServerEntity,
Expand Down

0 comments on commit 3950672

Please sign in to comment.