/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
import type { KubeObjectStore } from "../kube-object.store";
import type { IComputedValue } from "mobx";
import type { KubeApi } from "../kube-api";
import type { KubeObject, ObjectReference } from "@openlens/kube-object";
import type { CreateCustomResourceStore } from "./create-custom-resource-store.injectable";
export type RegisterableStore<Store> = Store extends KubeObjectStore<any, any, any> ? Store : never;
export type RegisterableApi<Api> = Api extends KubeApi<any, any> ? Api : never;
export type KubeObjectStoreFrom<Api> = Api extends KubeApi<infer KubeObj, infer ApiData> ? KubeObjectStore<KubeObj, Api, ApiData> : never;
export type FindApiCallback = (api: KubeApi<KubeObject>) => boolean;
export interface ApiManagerDependencies {
    readonly apis: IComputedValue<KubeApi[]>;
    readonly crdApis: IComputedValue<KubeApi[]>;
    readonly stores: IComputedValue<KubeObjectStore[]>;
    createCustomResourceStore: CreateCustomResourceStore;
}
export declare class ApiManager {
    private readonly dependencies;
    private readonly externalApis;
    private readonly externalStores;
    private readonly defaultCrdStores;
    private readonly apis;
    constructor(dependencies: ApiManagerDependencies);
    getApi(pathOrCallback: string | FindApiCallback): KubeApi<KubeObject<import("@openlens/kube-object").KubeObjectMetadata<import("@openlens/kube-object").KubeObjectScope>, unknown, unknown>, import("@openlens/kube-object").KubeJsonApiData<import("@openlens/kube-object").KubeObjectMetadata<import("@openlens/kube-object").KubeObjectScope>, unknown, unknown>> | undefined;
    getApiByKind(kind: string, apiVersion: string): KubeApi<KubeObject<import("@openlens/kube-object").KubeObjectMetadata<import("@openlens/kube-object").KubeObjectScope>, unknown, unknown>, import("@openlens/kube-object").KubeJsonApiData<import("@openlens/kube-object").KubeObjectMetadata<import("@openlens/kube-object").KubeObjectScope>, unknown, unknown>> | undefined;
    registerApi<Api>(api: RegisterableApi<Api>): void;
    /**
     * @deprecated Just register the `api` by itself
     */
    registerApi<Api>(apiBase: string, api: RegisterableApi<Api>): void;
    unregisterApi(apiOrBase: string | KubeApi<KubeObject>): void;
    registerStore<KubeObj>(store: RegisterableStore<KubeObj>): void;
    /**
     * @deprecated KubeObjectStore's should only every be about a single KubeApi type
     */
    registerStore<KubeObj>(store: RegisterableStore<KubeObj>, apis: KubeApi<KubeObject>[]): void;
    private apiIsDefaultCrdApi;
    getStore(api: string | undefined): KubeObjectStore | undefined;
    getStore<Api>(api: RegisterableApi<Api>): KubeObjectStoreFrom<Api> | undefined;
    /**
     * @deprecated use an actual cast instead of hiding it with this unused type param
     */
    getStore<Store extends KubeObjectStore>(api: string | KubeApi): Store | undefined;
    lookupApiLink(ref: ObjectReference, parentObject?: KubeObject): string;
}
