import type { Harmony } from '@teambit/harmony'; import type { Component } from '@teambit/component'; import type { ComponentID } from '@teambit/component-id'; import type { VariantPolicyConfigArr } from '@teambit/dependency-resolver'; import { ExtensionDataList } from '@teambit/legacy.extension-data'; import type { ExtensionsOrigin, Workspace } from './workspace'; import { MergeConflictFile } from './merge-conflict-file'; export declare class AspectsMerger { private workspace; private harmony; readonly mergeConflictFile: MergeConflictFile; private mergeConfigDepsResolverDataCache; constructor(workspace: Workspace, harmony: Harmony); getDepsDataOfMergeConfig(id: ComponentID): VariantPolicyConfigArr; /** * Calculate the component config based on: * the config property in the .bitmap file * the component.json file in the component folder * matching pattern in the variants config * defaults extensions from workspace config * extensions from the model. */ merge(componentId: ComponentID, componentFromScope?: Component, excludeOrigins?: ExtensionsOrigin[]): Promise<{ extensions: ExtensionDataList; beforeMerge: Array<{ extensions: ExtensionDataList; origin: ExtensionsOrigin; extraData: any; }>; errors?: Error[]; }>; /** * before version 0.0.882 it was possible to save Version object with the same extension twice. */ private getComponentFromScopeWithoutDuplications; /** * from the merge-config we get the dep-resolver policy as an array, because it needs to support "force" prop. * however, when we save the config, we want to save it as an object, so we need split the data into two: * 1. force: true, which gets saved into the config. * 2. force: false, which gets saved into the data.dependencies later on. see the workspace.getAutoDetectOverrides() */ private removeAutoDepsFromConfig; private getUnmergedData; private filterEnvsFromExtensionsIfNeeded; /** * This will mutate the entries with extensionId prop to have resolved legacy id * This should be worked on the extension data list not the new aspect list * @param extensionList */ private resolveExtensionListIds; }