import { ComponentID } from '@teambit/component-id'; import type { ScopeMain } from '@teambit/scope'; import type { Component } from '@teambit/component'; import type { DependenciesMain } from '@teambit/dependencies'; import type { DependencyResolverMain, VariantPolicyConfigArr } from '@teambit/dependency-resolver'; import type { FileData, SnappingMain, SnapDataParsed } from './snapping.main.runtime'; export type NewDependency = { id: string; version?: string; isComponent?: boolean; type?: 'runtime' | 'dev' | 'peer'; }; export type NewDependencies = NewDependency[]; export type CompData = { componentId: ComponentID; dependencies: string[]; aspects: Record | undefined; message: string | undefined; files: FileData[] | undefined; mainFile?: string; newDependencies?: NewDependencies; }; /** * normally new components are created from a workspace. the files are in the filesystem and the ConsumerComponent * object is created from the files. * here, we need to create the ConsumerComponent object "on the fly". we don't have workspace, only scope. the files * are in-memory (we got them from snap-from-scope command). * the way how it is done is by creating a minimal ConsumerComponent object, then convert `Version` object from it, * write the version and files into the scope as objects, so then it's possible to load Component object using the * ConsumerComponent. */ export declare function generateCompFromScope(scope: ScopeMain, depsResolver: DependencyResolverMain, compData: CompData, snapping: SnappingMain): Promise; export declare function addDeps(component: Component, snapData: SnapDataParsed, scope: ScopeMain, deps: DependenciesMain, depsResolver: DependencyResolverMain, snapping: SnappingMain, autoDetect?: VariantPolicyConfigArr): Promise;