mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix incorrect typing in test
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
7938e9c4ef
commit
53dc2c853d
@ -24,7 +24,11 @@ import { action, observable, makeObservable } from "mobx";
|
|||||||
import { Singleton } from "../../common/utils";
|
import { Singleton } from "../../common/utils";
|
||||||
import { LensExtension } from "../lens-extension";
|
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 });
|
private items = observable.map<T, I>([], { deep: false });
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
import { BaseRegistry } from "./base-registry";
|
import { BaseRegistry, IBaseRegistry } from "./base-registry";
|
||||||
|
|
||||||
export interface KubeObjectMenuComponents {
|
export interface KubeObjectMenuComponents {
|
||||||
MenuItem: React.ComponentType<any>;
|
MenuItem: React.ComponentType<any>;
|
||||||
@ -32,7 +32,7 @@ export interface KubeObjectMenuRegistration {
|
|||||||
components: KubeObjectMenuComponents;
|
components: KubeObjectMenuComponents;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IKubeObjectMenuRegistry {
|
export interface IKubeObjectMenuRegistry extends IBaseRegistry<KubeObjectMenuRegistration> {
|
||||||
getItemsForKind(kind: string, apiVersion: string): any;
|
getItemsForKind(kind: string, apiVersion: string): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -292,7 +292,7 @@ const addDynamicMenuItem = ({
|
|||||||
apiVersions,
|
apiVersions,
|
||||||
kind,
|
kind,
|
||||||
}: {
|
}: {
|
||||||
di: any;
|
di: IConfigurableDependencyInjectionContainer;
|
||||||
apiVersions: string[];
|
apiVersions: string[];
|
||||||
kind: string;
|
kind: string;
|
||||||
}) => {
|
}) => {
|
||||||
@ -304,7 +304,7 @@ const addDynamicMenuItem = ({
|
|||||||
components: { MenuItem: MenuItemComponent },
|
components: { MenuItem: MenuItemComponent },
|
||||||
};
|
};
|
||||||
|
|
||||||
const kubeObjectMenuRegistry: KubeObjectMenuRegistry = di.inject(
|
const kubeObjectMenuRegistry = di.inject(
|
||||||
kubeObjectMenuRegistryInjectable,
|
kubeObjectMenuRegistryInjectable,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user