import { ComponentID, ComponentIdList } from '@teambit/component-id'; import { LaneId } from '@teambit/lane-id'; import type { Scope } from '@teambit/legacy.scope'; import type { Repository } from '../objects'; import { BitObject, Ref } from '../objects'; export type Log = { date: string; username?: string; email?: string; profileImage?: string; }; export type LaneProps = { name: string; scope: string; log: Log; components?: LaneComponent[]; hash: string; schema?: string; readmeComponent?: LaneReadmeComponent; forkedFrom?: LaneId; updateDependents?: ComponentID[]; overrideUpdateDependents?: boolean; }; export type LaneComponent = { id: ComponentID; head: Ref; isDeleted?: boolean; }; export type LaneReadmeComponent = { id: ComponentID; head: Ref | null; }; export default class Lane extends BitObject { name: string; scope: string; components: LaneComponent[]; log: Log; schema: string; readmeComponent?: LaneReadmeComponent; forkedFrom?: LaneId; _hash: string; isNew: boolean; hasChanged: boolean; /** * populated when a user clicks on "update" in the UI. it's a list of components that are dependents on the * components in the lane. their dependencies are updated according to the lane. * from the CLI perspective, it's added by "bit _snap" and merged by "bit _merge-lane". * otherwise, the user is not aware of it. it's not imported to the workspace and the objects are not fetched. */ updateDependents?: ComponentID[]; private overrideUpdateDependents?; constructor(props: LaneProps); id(): string; hash(): Ref; changeName(name: string): void; changeScope(scope: string): void; refs(): Ref[]; validateBeforePersisting(str: string): void; toObject(): import("lodash").Dictionary; static from(props: LaneProps): Lane; static create(name: string, scope: string, forkedFrom?: LaneId, bitCloudUser?: { username?: string; email?: string; profileImage?: string; }): Lane; static parse(contents: string, hash: string): Lane; toBuffer(pretty?: boolean): Buffer; addComponent(component: LaneComponent): void; removeComponentFromUpdateDependentsIfExist(componentId: ComponentID): void; addComponentToUpdateDependents(componentId: ComponentID): void; removeAllUpdateDependents(): void; shouldOverrideUpdateDependents(): boolean | undefined; /** * !!! important !!! * this should get called only on a "temp lane", such as running "bit _snap", which the scope gets destroys after the * command is done. when _scope exports the lane, this "overrideUpdateDependents" is not saved to the remote-scope. * * on a user local lane object, this prop should never be true. otherwise, it'll override the remote-scope data. */ setOverrideUpdateDependents(overrideUpdateDependents: boolean): void; removeComponent(id: ComponentID): boolean; getComponent(id: ComponentID): LaneComponent | undefined; getComponentHead(bitId: ComponentID): Ref | null; setLaneComponents(laneComponents: LaneComponent[]): void; setReadmeComponent(id?: ComponentID): void; isFullyMerged(scope: Scope): Promise; getMergedAndUnmergedIds(scope: Scope): Promise<{ merged: ComponentID[]; unmerged: ComponentID[]; }>; /** * @deprecated use toComponentIds instead */ toBitIds(): ComponentIdList; toComponentIds(): ComponentIdList; toComponentIdsIncludeUpdateDependents(): ComponentIdList; toLaneId(): LaneId; collectObjectsById(repo: Repository): Promise>; includeDeletedData(): boolean; setSchemaToSupportDeletedData(): void; setSchemaToNotSupportDeletedData(): void; getCompHeadIncludeUpdateDependents(componentId: ComponentID): Ref | undefined; validate(): void; isEqual(lane: Lane): boolean; clone(): Lane; }