From 41a73f9e6509309c7a3b56ab9d97587fc5d7d170 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 7 Apr 2022 09:11:07 -0400 Subject: [PATCH] change some type param names to be not single letters Signed-off-by: Sebastian Malton --- src/common/k8s-api/api-manager.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/common/k8s-api/api-manager.ts b/src/common/k8s-api/api-manager.ts index 329fb00070..007483777f 100644 --- a/src/common/k8s-api/api-manager.ts +++ b/src/common/k8s-api/api-manager.ts @@ -11,14 +11,14 @@ import type { KubeApi } from "./kube-api"; import type { KubeJsonApiDataFor, KubeObject, ObjectReference } from "./kube-object"; import { parseKubeApi, createKubeApiURL } from "./kube-api-parse"; -export type RegisterableStore = S extends KubeObjectStore - ? S +export type RegisterableStore = Store extends KubeObjectStore + ? Store : never; -export type RegisterableApi = A extends KubeApi - ? A +export type RegisterableApi = Api extends KubeApi + ? Api : never; -export type KubeObjectStoreFrom = A extends KubeApi - ? KubeObjectStore +export type KubeObjectStoreFrom = Api extends KubeApi + ? KubeObjectStore : never; export class ApiManager { @@ -42,7 +42,7 @@ export class ApiManager { return iter.find(this.apis.values(), api => api.kind === kind && api.apiVersionWithGroup === apiVersion); } - registerApi(apiBase: string, api: RegisterableApi) { + registerApi(apiBase: string, api: RegisterableApi) { if (!api.apiBase) return; if (!this.apis.has(apiBase)) { @@ -78,14 +78,14 @@ export class ApiManager { } } - registerStore(store: RegisterableStore): void; + registerStore(store: RegisterableStore): void; /** * @deprecated KubeObjectStore's should only every be about a single KubeApi type */ - registerStore(store: KubeObjectStore, KubeJsonApiDataFor>, apis: KubeApi[]): void; + registerStore(store: KubeObjectStore, KubeJsonApiDataFor>, apis: KubeApi[]): void; @action - registerStore(store: KubeObjectStore, KubeJsonApiDataFor>, apis: KubeApi[] = [store.api]): void { + registerStore(store: KubeObjectStore, KubeJsonApiDataFor>, apis: KubeApi[] = [store.api]): void { for (const api of apis.filter(isDefined)) { if (api.apiBase) { this.stores.set(api.apiBase, store as never); @@ -94,11 +94,11 @@ export class ApiManager { } getStore(api: string | undefined): KubeObjectStore | undefined; - getStore(api: RegisterableApi): KubeObjectStoreFrom | undefined; + getStore(api: RegisterableApi): KubeObjectStoreFrom | undefined; /** * @deprecated use an actual cast instead of hiding it with this unused type param */ - getStore(api: string | KubeApi): S | undefined ; + getStore(api: string | KubeApi): Store | undefined ; getStore(api: string | KubeApi | undefined): KubeObjectStore | undefined { const { apiBase } = this.resolveApi(api) ?? {};