Fix incorrect typing in test

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 7938e9c4ef
commit 53dc2c853d
3 files changed
+9 -5

No files matched your search

+5 -1
View File
@@ -24,7 +24,11 @@ import { action, observable, makeObservable } from "mobx";
import { Singleton } from "../../common/utils";
import { LensExtension } from "../lens-extension";
export class BaseRegistry<T, I = T> extends Singleton {
export interface IBaseRegistry<T> {
add(items: T | T[], extension?: LensExtension): () => void;
}
export class BaseRegistry<T, I = T> extends Singleton implements IBaseRegistry<T> {
private items = observable.map<T, I>([], { deep: false });
constructor() {
@@ -20,7 +20,7 @@
*/
import type React from "react";
import { BaseRegistry } from "./base-registry";
import { BaseRegistry, IBaseRegistry } from "./base-registry";
export interface KubeObjectMenuComponents {
MenuItem: React.ComponentType<any>;
@@ -32,7 +32,7 @@ export interface KubeObjectMenuRegistration {
components: KubeObjectMenuComponents;
}
export interface IKubeObjectMenuRegistry {
export interface IKubeObjectMenuRegistry extends IBaseRegistry<KubeObjectMenuRegistration> {
getItemsForKind(kind: string, apiVersion: string): any;
}
@@ -292,7 +292,7 @@ const addDynamicMenuItem = ({
apiVersions,
kind,
}: {
di: any;
di: IConfigurableDependencyInjectionContainer;
apiVersions: string[];
kind: string;
}) => {
@@ -304,7 +304,7 @@ const addDynamicMenuItem = ({
components: { MenuItem: MenuItemComponent },
};
const kubeObjectMenuRegistry: KubeObjectMenuRegistry = di.inject(
const kubeObjectMenuRegistry = di.inject(
kubeObjectMenuRegistryInjectable,
);