/** * What a line of commits touched across package boundaries, counted. * * Every figure is a count over a named denominator, and each is a different * question, so none is merged into a score: a share of commits says what was * touched together, and the commit never says why. * * A package is one the workspace lists that holds source now, whatever a window * changed, so a figure does not move with the window. A test-only tree is a * package or a top folder holding tests and no source. A commit is counted when a person changed source in a * package, and what is left out is counted by the first reason that takes it. */ import { type CommitChange, type PathKinds } from '@variance-authority/sense'; /** What counts as source: the code the index parses, and code it does not, which a commit changes all the same. */ export declare const SOURCE_EXTENSIONS: ReadonlySet; /** A count and what it is out of. */ export interface Share { readonly count: number; readonly of: number; } /** The commits not counted, by the first reason that took each. */ export interface LeftOut { /** A root or a shallow clone's oldest commit: its diff is the whole tree. */ readonly noParent: number; readonly bot: number; readonly noSource: number; /** Source only outside every package that holds source. */ readonly noPackage: number; } /** The figures, each over the commits it names. */ export interface ContainmentCount { /** Commits read from the line. */ readonly read: number; /** Commits that changed source in a package. */ readonly counted: number; readonly leftOut: LeftOut; /** Any file in exactly one package, over the counted commits. */ readonly onePackage: Share; /** A test in another package that holds source, over the counted commits. */ readonly testInAnotherPackage: Share; /** A test in a package or top folder that holds no source, over the counted commits. */ readonly testOnlyTree: Share; /** A test in another package, over the commits that edited their own tests. */ readonly anotherGivenOwnTests: Share; /** A test in another package, over the commits that did not. */ readonly anotherGivenNoOwnTests: Share; } /** * Counts `commits`, each path read by `kinds`, the rule the addon read * `holdingSource` by: which packages and top folders hold source now, a tree * holding a file with one of {@link SOURCE_EXTENSIONS} that is no test. */ export declare function countContainment(commits: readonly CommitChange[], holdingSource: ReadonlySet, kinds: PathKinds): ContainmentCount; //# sourceMappingURL=containment-count.d.ts.map