import type { CheckFacet } from "#types/check.types"; import type { UnreadKey } from "#types/record.types"; export interface Logger { warn: (message: string, detail?: unknown) => void; } export interface OntologyIssues { duplicateIds: string[]; danglingEdges: { from: string; relation: string; target: string }[]; } export interface Edge { relation: string; targets: string[]; } export interface Ontology { get: (id: string) => R | null; all: () => R[]; ids: () => string[]; query: (matcher: (record: R) => boolean) => R[]; index: () => ReadonlyMap; validateOntology: (edgesOf: (record: R) => Edge[], resolveId?: (target: string) => string) => OntologyIssues; } export interface OntologyOptions { records: readonly R[]; idOf: (record: R) => string; label: string; logger?: Logger | undefined; } export interface OntologyAudit { attributions: () => string[]; unread: () => UnreadKey[]; } export interface BaseFaceConfig { audit: OntologyAudit; idOf: (record: R) => string; label: string; matches: (record: R, filter: F) => boolean; logger?: Logger | undefined; } export interface FaceContext { logger?: Logger | undefined; canonicalizeId?: ((term: string) => string) | undefined; } export interface OntologyFaceDefinition

{ name: string; dependsOn?: readonly string[]; build: (context: FaceContext, dependencies: Record) => P; } export interface JsonDirOptions { only?: (name: string) => boolean; exclude?: (name: string) => boolean; } export type Normalizer = ( raw: Record, category: string, declared: CheckFacet | null, group: Record, ) => R;