/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
import type { ExtendableDisposer } from "@openlens/utilities";
import type { Logger } from "@openlens/logger";
export declare enum ExtensionInstallationState {
    INSTALLING = "installing",
    UNINSTALLING = "uninstalling",
    IDLE = "idle"
}
interface Dependencies {
    readonly logger: Logger;
}
export declare class ExtensionInstallationStateStore {
    private readonly dependencies;
    private readonly preInstallIds;
    private readonly uninstallingExtensions;
    private readonly installingExtensions;
    constructor(dependencies: Dependencies);
    bindIpcListeners: () => void;
    /**
     * Strictly transitions an extension from not installing to installing
     * @param extId the ID of the extension
     * @throws if state is not IDLE
     */
    setInstalling: (extId: string) => void;
    /**
     * Broadcasts that an extension is being installed by the main process
     * @param extId the ID of the extension
     */
    setInstallingFromMain: (extId: string) => void;
    /**
     * Broadcasts that an extension is no longer being installed by the main process
     * @param extId the ID of the extension
     */
    clearInstallingFromMain: (extId: string) => void;
    /**
     * Marks the start of a pre-install phase of an extension installation. The
     * part of the installation before the tarball has been unpacked and the ID
     * determined.
     * @returns a disposer which should be called to mark the end of the install phase
     */
    startPreInstall: () => ExtendableDisposer;
    /**
     * Strictly transitions an extension from not uninstalling to uninstalling
     * @param extId the ID of the extension
     * @throws if state is not IDLE
     */
    setUninstalling: (extId: string) => void;
    /**
     * Strictly clears the INSTALLING state of an extension
     * @param extId The ID of the extension
     * @throws if state is not INSTALLING
     */
    clearInstalling: (extId: string) => void;
    /**
     * Strictly clears the UNINSTALLING state of an extension
     * @param extId The ID of the extension
     * @throws if state is not UNINSTALLING
     */
    clearUninstalling: (extId: string) => void;
    /**
     * Returns the current state of the extension. IDLE is default value.
     * @param extId The ID of the extension
     */
    getInstallationState: (extId: string) => ExtensionInstallationState;
    /**
     * Returns true if the extension is currently INSTALLING
     * @param extId The ID of the extension
     */
    isExtensionInstalling: (extId: string) => boolean;
    /**
     * Returns true if the extension is currently UNINSTALLING
     * @param extId The ID of the extension
     */
    isExtensionUninstalling: (extId: string) => boolean;
    /**
     * Returns true if the extension is currently IDLE
     * @param extId The ID of the extension
     */
    isExtensionIdle: (extId: string) => boolean;
    /**
     * The current number of extensions installing
     */
    get installing(): number;
    /**
     * The current number of extensions uninstalling
     */
    get uninstalling(): number;
    /**
     * If there is at least one extension currently installing
     */
    get anyInstalling(): boolean;
    /**
     * If there is at least one extension currently uninstalling
     */
    get anyUninstalling(): boolean;
    /**
     * The current number of extensions preinstalling
     */
    get preinstalling(): number;
    /**
     * If there is at least one extension currently downloading
     */
    get anyPreinstalling(): boolean;
    /**
     * If there is at least one installing or preinstalling step taking place
     */
    get anyPreInstallingOrInstalling(): boolean;
}
export {};
