UNPKG

@teambit/isolator

Version:
23 lines (22 loc) 1.21 kB
import type { Component } from '@teambit/component'; import type { DependencyResolverMain } from '@teambit/dependency-resolver'; import { Graph } from '@teambit/graph.cleargraph'; import type { ComponentID } from '@teambit/component-id'; import type { Capsule } from './capsule'; export default class CapsuleList extends Array<Capsule> { getCapsule(id: ComponentID): Capsule | undefined; getCapsuleByLegacyId(id: ComponentID): Capsule | undefined; getCapsuleIgnoreVersion(id: ComponentID): Capsule | undefined; getAllCapsuleDirs(): string[]; getIdByPathInCapsule(pathInCapsule: string): ComponentID | null; getAllComponents(): Component[]; getAllComponentIDs(): ComponentID[]; getGraphIds(): Graph<Component, string>; toposort(depResolver: DependencyResolverMain): Promise<CapsuleList>; static fromArray(capsules: Capsule[]): CapsuleList; /** * determines whether or not a capsule can theoretically use the dists saved in the last snap, rather than re-compile them. * practically, this optimization is used for components that have typescript as their compiler. */ static capsuleUsePreviouslySavedDists(component: Component): Promise<boolean>; }