import type { ComponentID } from '@teambit/component'; import { Component, Snap, State } from '@teambit/component'; import type { Logger } from '@teambit/logger'; import type { ConsumerComponent } from '@teambit/legacy.consumer-component'; import type { ScopeMain } from './scope.main.runtime'; export declare class ScopeComponentLoader { private scope; private logger; private componentsCache; private importedComponentsCache; constructor(scope: ScopeMain, logger: Logger); get(id: ComponentID, importIfMissing?: boolean, useCache?: boolean): Promise; private getWithSpan; /** * a component object may point at a Version object the local scope does not have. a fetch that ran * while the remote was mid-export gets the component with its new head but no Version for it, and * every load from then on fails on the missing object, although the remote has it by now. fetch * it once and retry, rather than fail until the user runs "bit import --objects" by hand. */ private loadVersionOrFetch; getFromConsumerComponent(consumerComponent: ConsumerComponent): Promise; /** * get a component from a remote without importing it */ getRemoteComponent(id: ComponentID, fromMain?: boolean): Promise; /** * get components from a remote without importing it */ getManyRemoteComponents(ids: ComponentID[]): Promise; getState(id: ComponentID, hash: string): Promise; getSnap(id: ComponentID, hash: string): Promise; clearCache(): void; /** * 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 getTagMap; private getHeadSnap; private createSnapFromVersion; private createStateFromVersion; }