import { Component, InvalidComponent } from '@teambit/component';
import { ComponentID } from '@teambit/component-id';
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
import { DependencyResolverMain } from '@teambit/dependency-resolver';
import { Logger } from '@teambit/logger';
import { EnvsMain } from '@teambit/envs';
import { AspectLoaderMain } from '@teambit/aspect-loader';
import { ComponentLoadOptions as LegacyComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';
import { Workspace } from '../workspace';
type GetManyRes = {
    components: Component[];
    invalidComponents: InvalidComponent[];
};
export type ComponentLoadOptions = LegacyComponentLoadOptions & {
    loadExtensions?: boolean;
    executeLoadSlot?: boolean;
    idsToNotLoadAsAspects?: string[];
    loadSeedersAsAspects?: boolean;
    resolveExtensionsVersions?: boolean;
};
type ComponentGetOneOptions = {
    resolveIdVersion?: boolean;
};
export type LoadCompAsAspectsOptions = {
    /**
     * In case the component we are loading is app, whether to load it as app (in a scope aspects capsule)
     */
    loadApps?: boolean;
    /**
     * In case the component we are loading is env, whether to load it as env (in a scope aspects capsule)
     */
    loadEnvs?: boolean;
    /**
     * In case the component we are loading is a regular aspect, whether to load it as aspect (in a scope aspects capsule)
     */
    loadAspects?: boolean;
    idsToNotLoadAsAspects?: string[];
    /**
     * Are this core aspects
     */
    core?: boolean;
    /**
     * Are this aspects seeders of the load many operation
     */
    seeders?: boolean;
};
export declare class WorkspaceComponentLoader {
    private workspace;
    private logger;
    private dependencyResolver;
    private envs;
    private aspectLoader;
    private componentsCache;
    /**
     * Cache components that loaded from scope (especially for get many for perf improvements)
     */
    private scopeComponentsCache;
    /**
     * Cache extension list for components. used by get many for perf improvements.
     * And to make sure we load extensions first.
     */
    private componentsExtensionsCache;
    private componentLoadedSelfAsAspects;
    constructor(workspace: Workspace, logger: Logger, dependencyResolver: DependencyResolverMain, envs: EnvsMain, aspectLoader: AspectLoaderMain);
    getMany(ids: Array<ComponentID>, loadOpts?: ComponentLoadOptions, throwOnFailure?: boolean): Promise<GetManyRes>;
    private getAndLoadSlotOrdered;
    private buildLoadGroups;
    private regroupExtIdsFromTheList;
    private getAndLoadSlot;
    loadCompsAsAspects(components: Component[], opts?: LoadCompAsAspectsOptions): Promise<void>;
    private populateScopeAndExtensionsCache;
    private warnAboutMisconfiguredEnvs;
    private groupAndUpdateIds;
    private isInWsIncludeDeleted;
    private getComponentsWithoutLoadExtensions;
    getInvalid(ids: Array<ComponentID>): Promise<InvalidComponent[]>;
    get(componentId: ComponentID, legacyComponent?: ConsumerComponent, useCache?: boolean, storeInCache?: boolean, loadOpts?: ComponentLoadOptions, getOpts?: ComponentGetOneOptions): Promise<Component>;
    getIfExist(componentId: ComponentID): Promise<Component | undefined>;
    private resolveVersion;
    private addMultipleEnvsIssueIfNeeded;
    clearCache(): void;
    clearComponentCache(id: ComponentID): void;
    private loadOne;
    private saveInCache;
    /**
     * make sure that not only the id-str match, but also the legacy-id.
     * this is needed because the ComponentID.toString() is the same whether or not the legacy-id has
     * scope-name, as it includes the defaultScope if the scope is empty.
     * as a result, when out-of-sync is happening and the id is changed to include scope-name in the
     * legacy-id, the component is the cache has the old id.
     */
    private getFromCache;
    private getConsumerComponent;
    private isComponentNotExistsError;
    private executeLoadSlot;
    private newComponentFromState;
    private upsertExtensionData;
    private getDataEntry;
}
export {};
