CodebaseCore

tcmts.cli.codebase.CodebaseCore · #lgm5hv7s · type

What the code Codebase itself uses (its views, mirrors, provided packages, kept values, placement) needs of a codebase, as an interface the class has. That code takes this, not the class: a type naming the class would make the two refer to each other, and they'd be hashed as one cycle, every change to one a change to all of them.

import type { SaltFor } from "#codebase/tcmts/cli/codebase";
import type { Mirror } from "#codebase/tcmts/cli/mirror";
import type { ProjectAnalysis } from "#codebase/tcmts/core/analyze";
import type { CompilerOptions } from "#codebase/tcmts/core/program";
import type { DefRecord } from "#codebase/tcmts/core/types";
import type { DefSource, Layout } from "#codebase/tcmts/loader";
import type { Store } from "#codebase/tcmts/store";

export interface CodebaseCore {
  readonly lay: Layout;
  readonly store: Store;
  /** a session's own directory (`TCM_BRANCH`): its scratch files, `#codebase` shim and views */
  readonly sessionDir?: string | undefined;
  source(overlay?: DefRecord[], nameAt?: (hash: string) => string | undefined): DefSource;
  adoptMirror?: (m: Mirror) => boolean;
  compilerOptions(dir?: string, mode?: "scratch" | "import"): CompilerOptions;
  analyzeProject(
    files: string[],
    saltFor: SaltFor | undefined,
    ignoreDiagnostics?: number[],
    compilerOptions?: CompilerOptions,
  ): ProjectAnalysis;
  lineageSalt(path: string): string;
  lookup(target: string): string[];
  displayRef(ref: string): string;
}

uses

used by