catalog-import: use type locally

Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
This commit is contained in:
Himanshu Mishra
2023-07-03 15:40:10 +05:30
parent 63e880700e
commit 08b075b00a
3 changed files with 15 additions and 16 deletions
+5 -2
View File
@@ -244,7 +244,11 @@ export type PreparePullRequestFormProps<
export type PrepareResult =
| {
type: 'locations';
locations: NewLocations;
locations: Array<{
exists?: boolean;
target: string;
entities: CompoundEntityRef[];
}>;
}
| {
type: 'repository';
@@ -360,5 +364,4 @@ export interface StepPrepareCreatePullRequestProps {
// Warnings were encountered during analysis:
//
// src/api/CatalogImportApi.d.ts:25:5 - (ae-forgotten-export) The symbol "PartialEntity" needs to be exported by the entry point index.d.ts
// src/components/useImportState.d.ts:21:5 - (ae-forgotten-export) The symbol "NewLocations" needs to be exported by the entry point index.d.ts
```
@@ -31,15 +31,13 @@ type Props = {
onReset: () => void;
};
type NewLocations = Array<{
exists?: boolean;
target: string;
entities: CompoundEntityRef[];
}>;
// Among the newly registered entities, return a software entity (e.g. Component, API, Resource)
const filterComponentEntity = (
newLocations: NewLocations,
newLocations: Array<{
exists?: boolean;
target: string;
entities: CompoundEntityRef[];
}>,
): CompoundEntityRef | null => {
for (const location of newLocations) {
for (const entity of location.entities) {
@@ -32,12 +32,6 @@ export type ImportFlows =
// the available states of the stepper
type ImportStateTypes = 'analyze' | 'prepare' | 'review' | 'finish';
type NewLocations = Array<{
exists?: boolean;
target: string;
entities: CompoundEntityRef[];
}>;
/**
* Result of the prepare state.
*
@@ -46,7 +40,11 @@ type NewLocations = Array<{
export type PrepareResult =
| {
type: 'locations';
locations: NewLocations;
locations: Array<{
exists?: boolean;
target: string;
entities: CompoundEntityRef[];
}>;
}
| {
type: 'repository';