Organize some interfaces to communicate intent

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2021-12-04 12:20:42 +02:00
1 parent 0fc9fe626d
commit 550abfcc0d
2 files changed
+7 -8

No files matched your search

+4 -2
View File
@@ -37,10 +37,12 @@ import { ClusterMetadataKey, initialNodeShellImage, ClusterStatus } from "../com
import { disposer, storedKubeConfigFolder, toJS } from "../common/utils"; import { disposer, storedKubeConfigFolder, toJS } from "../common/utils";
import type { Response } from "request"; import type { Response } from "request";
export interface ICluster { export interface IHasClusterName {
name: string name: string;
} }
export interface ICluster extends IHasClusterName {}
/** /**
* Cluster * Cluster
* *
@@ -20,18 +20,15 @@
*/ */
import { lifecycleEnum } from "@ogre-tools/injectable"; import { lifecycleEnum } from "@ogre-tools/injectable";
import type { ICluster } from "../../../../main/cluster"; import type { IHasClusterName } from "../../../../main/cluster";
import type { IInjectable } from "@ogre-tools/injectable"; import type { IInjectable } from "@ogre-tools/injectable";
import clusterInjectable from "./cluster.injectable"; import clusterInjectable from "./cluster.injectable";
interface IDependencies { interface IDependencies {
cluster: ICluster; cluster: IHasClusterName;
} }
const clusterNameInjectable: IInjectable< const clusterNameInjectable: IInjectable<string | undefined, IDependencies> = {
string | undefined,
IDependencies
> = {
getDependencies: di => ({ getDependencies: di => ({
cluster: di.inject(clusterInjectable), cluster: di.inject(clusterInjectable),
}), }),