bit-bin
Version: 
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
35 lines (34 loc) • 1.64 kB
TypeScript
import { Graph } from 'graphlib';
import { BitId } from '../../bit-id';
import { ModelComponent, Version } from '../models';
import Scope from '../scope';
import Component from '../../consumer/component/consumer-component';
import Consumer from '../../consumer/consumer';
export declare type DependenciesInfo = {
    id: BitId;
    depth: number;
    parent: string;
    dependencyType: string;
};
export default class DependencyGraph {
    graph: Graph;
    scopeName: string;
    constructor(graph: Graph);
    setScopeName(scopeName: string): void;
    static loadAllVersions(scope: Scope): Promise<DependencyGraph>;
    static loadLatest(scope: Scope): Promise<DependencyGraph>;
    static loadFromString(str: object): DependencyGraph;
    static buildGraphWithAllVersions(scope: Scope): Graph;
    static buildGraphFromScope(scope: Scope): Promise<Graph>;
    static buildGraphFromWorkspace(consumer: Consumer, onlyLatest?: boolean, reverse?: boolean): Promise<Graph>;
    static buildGraphFromCurrentlyUsedComponents(consumer: Consumer): Promise<Graph>;
    static _addDependenciesToGraph(id: BitId, graph: Graph, component: Version | Component, reverse?: boolean): void;
    getSubGraphOfConnectedComponents(id: BitId): Graph;
    getDependenciesInfo(id: BitId): DependenciesInfo[];
    getDependentsInfo(id: BitId): DependenciesInfo[];
    _getIdWithLatestVersion(id: BitId): BitId;
    getComponent(id: BitId): ModelComponent;
    getImmediateDependentsPerId(id: BitId, returnNodeValue?: boolean): Array<string | Component | BitId>;
    getImmediateDependenciesPerId(id: BitId): string[];
    serialize(graph?: Graph): Object;
}