import type { ComponentID } from '@teambit/component-id'; import type { ApplyVersionResults } from '@teambit/component.modules.merge-helper'; import type { Lane } from '@teambit/objects'; import type { CheckoutProps } from '@teambit/checkout'; import type { Workspace } from '@teambit/workspace'; import type { Logger } from '@teambit/logger'; import type { LanesMain } from './lanes.main.runtime'; export type SwitchProps = { laneName: string; ids?: ComponentID[]; laneBitIds?: ComponentID[]; pattern?: string; skipFetch?: boolean; existingOnWorkspaceOnly?: boolean; /** * switch only the lane components from these scopes. the lane's other components are left * untouched: not written to the filesystem, not added to .bitmap, and not reverted to their main * version either if this workspace happens to track them. the lane object itself is still fetched * and saved whole, so a later snap/export preserves them. (`bit ci sync` mirrors only a lane's * own-scope slice into a git repository.) */ restrictToScopes?: string[]; remoteLane?: Lane; localTrackedLane?: string; alias?: string; }; /** * Which component ids a switch operates on: the lane's own components, plus the workspace components * the lane does not carry (they stay at their main version, as they always have). * * `restrictToScopes` narrows the lane side to those scopes. Its components are then excluded from * BOTH sides - a lane component outside the restriction must not reappear as "main-only", which * would check it out at its main version and write it after all. Excluded means untouched. */ export declare function partitionSwitchIds(laneIds: ComponentID[], mainIds: ComponentID[], restrictToScopes?: string[]): { ids: ComponentID[]; laneBitIds: ComponentID[]; }; export declare class LaneSwitcher { private workspace; private logger; private switchProps; private checkoutProps; private lanes; private consumer; private laneIdToSwitchTo; private laneToSwitchTo; constructor(workspace: Workspace, logger: Logger, switchProps: SwitchProps, checkoutProps: CheckoutProps, lanes: LanesMain); switch(): Promise; private populateSwitchProps; /** * `--workspace-only`: switch only the components the workspace already tracks. a lane can carry * components this workspace doesn't have - e.g. one that was removed from the source after it was * snapped onto the lane - and checking those out would write them back into .bitmap and to the * filesystem. this flag is how a caller says "move the lane pointer, leave my working tree as is" * (`bit ci pr` relies on it: the git checkout is the source of truth there). */ private filterIdsNotInWorkspaceIfNeeded; private populateIdsAccordingToPattern; private populatePropsAccordingToRemoteLane; private populatePropsAccordingToDefaultLane; private populatePropsAccordingToLocalLane; private throwForSwitchingToCurrentLane; private saveLanesData; }