import type { AnatomyFile, AnatomyFolder, AnatomySnapshot, DefinitionView, DocumentView, FindingView, } from "@banes-lab/web/types/anatomy.types.js"; import type { FileEntry, ModuleReport, RepoContext, WalkCell } from "@govlab/patterns"; import type { AnatomyRecords } from "@banes-lab/web/types/record.types.js"; import type { DiskFolder } from "#types/structure.types"; import type { SourceReferences } from "@banes-lab/web/types/code.types.js"; import type { docsHostFor } from "@govlab/docs"; export interface WalkAssets { readonly cells: Map; readonly sources: Map; readonly walks: Map; } export interface AnatomyInputs { readonly cells: ReadonlyMap; readonly charts: AnatomySnapshot["charts"]; readonly documents: ReadonlyMap; readonly entries: readonly FileEntry[]; readonly generatedSources?: boolean; readonly imports: AnatomySnapshot["imports"]; readonly report: ModuleReport; readonly tree: DiskFolder; readonly vectors: ReadonlyMap; } export interface AnatomyLookups { readonly assets: WalkAssets; readonly documents: ReadonlyMap; readonly definitions: ReadonlyMap; readonly edgesByFile: ReadonlyMap; readonly entries: ReadonlyMap; readonly findingsByFile: ReadonlyMap; readonly flagged: ReadonlyMap; readonly inputs: AnatomyInputs; } export type ReferenceReader = (path: string, text: string, document: boolean) => SourceReferences; export type ReferenceChannel = keyof Pick; export interface CatalogRule { readonly canonical?: readonly string[] | undefined; readonly ruleId: string; } export interface ReferenceSite { readonly references: SourceReferences; readonly source: string; } export interface ExactReference { readonly channel: ReferenceChannel; readonly path: string; readonly text: string; } export interface RecordReader { readonly file: (file: AnatomyFile) => AnatomyRecords; readonly folder: (folder: AnatomyFolder) => AnatomyRecords; } export type SpecifierResolver = (specifier: string, fromPath: string) => string | null; export interface TreeOptions { readonly qualifyPath: (tab: string, path: string) => string; readonly record: ((roots: readonly AnatomyFolder[]) => RecordReader) | null; readonly refer: ((roots: readonly AnatomyFolder[]) => ReferenceReader) | null; readonly specifiers: ((files: ReadonlySet) => SpecifierResolver) | null; } export interface DerivedTree { readonly exportName: string; readonly snapshot: AnatomySnapshot; readonly tab: string; } export interface AnatomyFiles { readonly anatomy: string; readonly sources: string; readonly walks: string; } export interface AnatomyScope { readonly assets: WalkAssets; readonly context: RepoContext; readonly host: Awaited>; readonly options: TreeOptions; readonly pruned: (folder: string) => boolean; }