import { Graph } from '@teambit/graph.cleargraph'; import { ComponentID } from '@teambit/component-id'; import Ref from '../objects/ref'; import { BitObject } from '../objects'; import type Version from './version'; import type ModelComponent from './model-component'; export type VersionParents = { hash: Ref; parents: Ref[]; unrelated?: Ref; squashed?: Ref[]; }; export type VersionHistoryGraph = Graph; type VersionHistoryProps = { name: string; scope: string; versions: VersionParents[]; graphCompleteRefs?: string[]; }; type HashMetadata = { tag?: string; pointers?: string[]; }; export default class VersionHistory extends BitObject { name: string; scope: string; private versionsObj; graphCompleteRefs: string[]; hasChanged: boolean; constructor(props: VersionHistoryProps); get versions(): VersionParents[]; private versionParentsToObject; id(): string; static fromId(name: string, scope: string): VersionHistory; toObject(): Record; toString(pretty: boolean): string; toBuffer(pretty: any): Buffer; getVersionData(ref: Ref): VersionParents | undefined; hasHash(ref: Ref): boolean; addFromVersionsObjects(versions: Version[]): void; isEmpty(): boolean; getAllHashesFrom(start: Ref): { found?: string[]; missing?: string[]; }; isRefPartOfHistory(startFrom: Ref, searchFor: Ref): boolean | undefined; isGraphCompleteSince(ref: Ref): boolean; getAllHashesAsString(): string[]; merge(versionHistory: VersionHistory): void; getAncestor(numOfGenerationsToGoBack: number, ref: Ref): Ref; getGraph(modelComponent?: ModelComponent, laneHeads?: { [hash: string]: string[]; }, shortHash?: boolean, limitVersions?: number): VersionHistoryGraph; get compId(): ComponentID; static create(name: string, scope: string, versions: VersionParents[]): VersionHistory; static parse(contents: string): VersionHistory; } export declare function versionParentsToGraph(versions: VersionParents[]): Graph; export {};