1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Replacing types on interfaces

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-06-19 15:54:15 +03:00
parent f8d2892a74
commit 1db1212ed9
3 changed files with 10 additions and 9 deletions

View File

@ -23,9 +23,9 @@ import { navigate } from "../../renderer/navigation";
import { CatalogCategory, CatalogEntity, CatalogEntityMetadata, CatalogEntitySpec, CatalogEntityStatus } from "../catalog"; import { CatalogCategory, CatalogEntity, CatalogEntityMetadata, CatalogEntitySpec, CatalogEntityStatus } from "../catalog";
import { catalogCategoryRegistry } from "../catalog/catalog-category-registry"; import { catalogCategoryRegistry } from "../catalog/catalog-category-registry";
type GeneralEntitySpec = { interface GeneralEntitySpec extends CatalogEntitySpec {
path: string; path: string;
} & CatalogEntitySpec; }
export class GeneralEntity extends CatalogEntity<CatalogEntityMetadata, CatalogEntityStatus, GeneralEntitySpec> { export class GeneralEntity extends CatalogEntity<CatalogEntityMetadata, CatalogEntityStatus, GeneralEntitySpec> {
public readonly apiVersion = "entity.k8slens.dev/v1alpha1"; public readonly apiVersion = "entity.k8slens.dev/v1alpha1";

View File

@ -30,7 +30,7 @@ import { app } from "electron";
import type { CatalogEntitySpec } from "../catalog/catalog-entity"; import type { CatalogEntitySpec } from "../catalog/catalog-entity";
import { HotbarStore } from "../hotbar-store"; import { HotbarStore } from "../hotbar-store";
export type KubernetesClusterPrometheusMetrics = { export interface KubernetesClusterPrometheusMetrics {
address?: { address?: {
namespace: string; namespace: string;
service: string; service: string;
@ -38,16 +38,16 @@ export type KubernetesClusterPrometheusMetrics = {
prefix: string; prefix: string;
}; };
type?: string; type?: string;
}; }
export type KubernetesClusterSpec = { export interface KubernetesClusterSpec extends CatalogEntitySpec {
kubeconfigPath: string; kubeconfigPath: string;
kubeconfigContext: string; kubeconfigContext: string;
metrics?: { metrics?: {
source: string; source: string;
prometheus?: KubernetesClusterPrometheusMetrics; prometheus?: KubernetesClusterPrometheusMetrics;
} }
} & CatalogEntitySpec; }
export interface KubernetesClusterStatus extends CatalogEntityStatus { export interface KubernetesClusterStatus extends CatalogEntityStatus {
phase: "connected" | "disconnected" | "deleting"; phase: "connected" | "disconnected" | "deleting";

View File

@ -147,13 +147,14 @@ export interface CatalogEntityAddMenuContext {
menuItems: CatalogEntityAddMenu[]; menuItems: CatalogEntityAddMenu[];
} }
export type CatalogEntitySpec = { export interface CatalogEntitySpec {
icon?: { icon?: {
src?: string; src?: string;
material?: string; material?: string;
background?: string; background?: string;
} };
} & Record<string, any>; [key: string]: any;
}
export interface CatalogEntityData< export interface CatalogEntityData<
Metadata extends CatalogEntityMetadata = CatalogEntityMetadata, Metadata extends CatalogEntityMetadata = CatalogEntityMetadata,