/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
import type { IComputedValue, IReactionDisposer } from "mobx";
import type { StorageLayer } from "../../utils/storage-helper";
import { noop } from "@openlens/utilities";
import type { KubeObjectStoreDependencies, KubeObjectStoreLoadingParams } from "../../../common/k8s-api/kube-object.store";
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
import type { NamespaceApi } from "../../../common/k8s-api/endpoints/namespace.api";
import { Namespace } from "@openlens/kube-object";
export interface NamespaceTree {
    id: string;
    namespace: Namespace;
    children?: NamespaceTree[];
}
interface Dependencies extends KubeObjectStoreDependencies {
    readonly storage: StorageLayer<string[]>;
    readonly clusterConfiguredAccessibleNamespaces: IComputedValue<string[]>;
}
export declare class NamespaceStore extends KubeObjectStore<Namespace, NamespaceApi> {
    protected readonly dependencies: Dependencies;
    constructor(dependencies: Dependencies, api: NamespaceApi);
    onContextChange(callback: (namespaces: string[]) => void, opts?: {
        fireImmediately?: boolean;
    }): IReactionDisposer;
    /**
     * @private
     * The current value (list of namespaces names) in the storage layer
     */
    private get selectedNamespaces();
    /**
     * @deprecated This doesn't contain the namespaces from cluster settings or from cluster context
     */
    get allowedNamespaces(): string[];
    /**
     * The list of selected namespace names (for filtering)
     * @deprecated This doesn't contain the namespaces from cluster settings or from cluster context
     */
    get contextNamespaces(): string[];
    /**
     * The set of select namespace names (for filtering)
     * @deprecated This doesn't contain the namespaces from cluster settings or from cluster context
     */
    get selectedNames(): Set<string>;
    /**
     * Is true when the the set of namespace names selected is implicitly all
     *
     * Namely, this will be true if the user has deselected all namespaces from
     * the filter or if the user has clicked the "All Namespaces" option
     */
    get areAllSelectedImplicitly(): boolean;
    subscribe(): typeof noop;
    protected loadItems(params: KubeObjectStoreLoadingParams): Promise<Namespace[]>;
    selectNamespaces: (namespace: string | string[]) => void;
    clearSelected(namespaces?: string | string[]): void;
    /**
     * Checks if namespace names are selected for filtering
     * @param namespaces One or several names of namespaces to check if they are selected
     * @returns `true` if all the provided names are selected
     */
    hasContext(namespaces: string | string[]): boolean;
    /**
     * Is `true` if all available namespaces are selected, otherwise `false`
     */
    get hasAllContexts(): boolean;
    /**
     * Acts like `toggleSingle` but can work on several at a time
     * @param namespaces One or many names of namespaces to select
     */
    toggleContext(namespaces: string | string[]): void;
    /**
     * Toggles the selection state of `namespace`. Namely, if it was previously
     * specifically or implicitly selected then after this call it will be
     * explicitly deselected.
     * @param namespace The name of a namespace
     */
    toggleSingle(namespace: string): void;
    /**
     * Makes the given namespace the sole selected namespace
     */
    selectSingle(namespace: string): void;
    /**
     * Selects all available namespaces.
     *
     * Note: If new namespaces appear in the future those will be selected too
     */
    selectAll(): void;
    /**
     * This function selects all namespaces implicitly.
     *
     * NOTE: does not toggle any namespaces
     * @param selectAll NOT USED
     * @deprecated Use `NamespaceStore.selectAll` instead.
     */
    toggleAll(selectAll?: boolean): void;
    getNamespaceTree(root: Namespace): NamespaceTree;
    remove(item: Namespace): Promise<void>;
}
export declare function getDummyNamespace(name: string): Namespace;
export {};
