/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
import type { ObservableMap } from "mobx";
import type { ExternalInstalledExtension, InstalledExtension, LensExtensionConstructor, LensExtensionId, BundledExtension, LegacyLensExtension } from "@openlens/legacy-extensions";
import type { LensExtension } from "../lens-extension";
import type { Extension } from "./extension/extension.injectable";
import type { Logger } from "@openlens/logger";
import type { JoinPaths } from "../../common/path/join-paths.injectable";
import type { GetDirnameOfPath } from "../../common/path/get-dirname.injectable";
import type { UpdateExtensionsState } from "../../features/extensions/enabled/common/update-state.injectable";
interface Dependencies {
    readonly extensionInstances: ObservableMap<LensExtensionId, LegacyLensExtension>;
    readonly bundledExtensions: BundledExtension[];
    readonly logger: Logger;
    readonly extensionEntryPointName: "main" | "renderer";
    updateExtensionsState: UpdateExtensionsState;
    getExtension: (instance: LegacyLensExtension) => Extension;
    joinPaths: JoinPaths;
    getDirnameOfPath: GetDirnameOfPath;
}
interface ExtensionBeingActivated {
    instance: LensExtension;
    installedExtension: InstalledExtension;
    activated: Promise<void>;
}
export interface ExtensionLoading {
    isBundled: boolean;
    loaded: Promise<void>;
}
/**
 * Loads installed extensions to the Lens application
 */
export declare class ExtensionLoader {
    protected readonly dependencies: Dependencies;
    protected readonly extensions: ObservableMap<string, InstalledExtension>;
    /**
     * This is the set of extensions that don't come with either
     * - Main.LensExtension when running in the main process
     * - Renderer.LensExtension when running in the renderer process
     */
    protected readonly nonInstancesByName: import("mobx").ObservableSet<string>;
    protected readonly instancesByName: import("mobx").IComputedValue<Map<string, LegacyLensExtension>>;
    private readonly onRemoveExtensionId;
    readonly isLoaded: import("mobx").IObservableValue<boolean>;
    constructor(dependencies: Dependencies);
    readonly userExtensions: import("mobx").IComputedValue<Map<string, InstalledExtension>>;
    /**
     * Get the extension instance by its manifest name
     * @param name The name of the extension
     * @returns one of the following:
     * - the instance of `Main.LensExtension` on the main process if created
     * - the instance of `Renderer.LensExtension` on the renderer process if created
     * - `null` if no class definition is provided for the current process
     * - `undefined` if the name is not known about
     */
    getInstanceByName(name: string): LegacyLensExtension | null | undefined;
    readonly storeState: import("mobx").IComputedValue<(readonly [string, {
        readonly enabled: boolean;
        readonly name: string;
    }])[]>;
    init(): Promise<void>;
    initExtensions(extensions: Map<LensExtensionId, InstalledExtension>): void;
    addExtension(extension: InstalledExtension): void;
    removeInstance(lensExtensionId: LensExtensionId): void;
    removeExtension(lensExtensionId: LensExtensionId): void;
    setIsEnabled(lensExtensionId: LensExtensionId, isEnabled: boolean): void;
    protected initMain(): Promise<void>;
    protected initRenderer(): Promise<void>;
    broadcastExtensions(): void;
    syncExtensions(extensions: [LensExtensionId, InstalledExtension][]): void;
    protected loadBundledExtensions(): Promise<ExtensionBeingActivated[]>;
    protected loadExtensions(extensions: ExtensionBeingActivated[]): Promise<ExtensionLoading[]>;
    protected loadUserExtensions(installedExtensions: Map<string, InstalledExtension>): Promise<ExtensionBeingActivated[]>;
    autoInitExtensions(): Promise<ExtensionLoading[]>;
    protected requireExtension(extension: ExternalInstalledExtension): LensExtensionConstructor | null;
    getExtensionById(extId: LensExtensionId): InstalledExtension | undefined;
    getInstanceById(extId: LensExtensionId): LegacyLensExtension | undefined;
    toJSON(): Map<LensExtensionId, InstalledExtension>;
}
export {};
